New!
Discover the latest tools in the Analytics
Suite, thanks to our new online help.
Contents: Hide
This type of redirection generally sends Internet users to a URL which is different from the one that they have entered into the address bar of their browser. This type of redirection can be carried out in two ways:
Server side (and therefore transparent for the Internet user): this case does not pose a problem.
Client side (META, JavaScript, detection of plug-ins, etc.): this type of redirection means that it is not possible for some browsers to retrieve the referrer that has directed Internet users to the site. A redirection tag must be used.
Placing a redirection tag on a site involves tagging the page that causes redirection to take place (usually transparent for the user) so that the referrer can be retrieved, and so that it can be subsequently retrieved by the page that is displayed. Two methods are available, depending on the possibilities and configuration of your site.
By way of an example we will consider your home page as being automatically redirected to a specific page using JavaScript.
For example:
http://www.site.com/welcome.asp
which automatically redirects to:
http://www.site.com/en/800/homepage.asp
This type of redirection has two major consequences for your site's measurements:
you will lose the referrer (the JavaScript "referrer" function is empty). When you arrive on the page "homepage.asp", it is impossible to find out what its referrer is (and also the "welcome.asp" referrer).
you will lose the xtor variable with the different ROI characteristics of your campaign.
There are 2 different types of redirection:
<script language=javascript>
<!--
document.location='/en/800/homepage.asp';
//-->
</script>
Or
<meta http-equiv="refresh" content="2; url= http://www.site.com/en/800/homepage.asp">
The solution which allows you to retrieve both the referrer and any xtor variable exists involves:
placing the full tag code before the redirection (this is a very important phase)
replacing the xtsite variable (your site number) with the redirection:
xtsite = "redirect";
creating an xtdmc variable which contains your domain name in the format ".domain.com" - see example below
<script type="text/javascript">
<!--
xtnv = document; //parent.document or top.document or document
xtsd = "http://logxxxx";
xtsite = "redirect"; //site number
xtn2 = ""; //level 2 site
xtpage = ""; //page name (with the use of :: to create chapters)
xtdi = ""; //implication degree
xt_multc = ""; //customised indicators
xt_an = ""; //numeric identifier
xt_ac = ""; //category
xtdmc = ".site.com";
xtloc = "/en/800/homepage.asp'";
//-->
</script>
<script type="text/javascript" src="http://www.mysite.com/xtcore.js"></script>
Note that the NOSCRIPT part is not of any use in this case, simply because it would not have any effect.
The consequences of this are as follows:
the redirection page is not traced (even if it contains the tag code)
the referrer and any possible xtor value are stored in a cookie so that they can be retrieved in the destination page (transparently for the user)
- The page which
creates the cookie (the redirection page) and the page which retrieves
the cookie (the redirected page) must both be part of the same URL domain.
- As far as multiple redirections
are concerned, only the first page needs to contain the code xtsite =
"redirect". No code is required for any other intermediate pages.
- Should you have any queries
on how to install this code please contact our Customer Service.
In this case an extra piece of code needs to be placed on the redirection page.
In the file "welcome.asp", the following lines of JavaScript code need to be added before the redirection, and an xtref variable as well as an xtor variable need to be added to the redirection:
<script language=javascript>
<!--
xtref = document.referrer.replace(/[<>]/g, '').replace(/&/g, '$');
if (document.location.search.indexOf("xtor=") > 0){
xtquery = document.location.search.substring(1, document.location.search.length);
monquery = xtquery.substring(xtquery.indexOf("xtor="), xtquery.length);
pos3 = monquery.indexOf("&");
if (pos3 == -1) pos3 = monquery.indexOf("%26");
if (pos3 == -1) pos3 = monquery.length;
xtor = "&xtor=" + monquery.substring(monquery.indexOf("=")+1, pos3);
}else{xtor = ""; }
//-->
</script>
…
<script language=javascript>
<!--
document.location='/fr/800/accueil.asp'+'?xtref='+(xtref?xtref:'acc_dir') + xtor;
//-->
</script>
This will retrieve the page's referrer whilst respecting the AT Internet format. Note that you can also carry out this operation on the server side using a dynamic language.
The tag on the destination page will be able to interpret the xtref/xtor variable contained in the URL, and any referrer information will not be lost.
www.atinternet.com/support
© AT Internet - 2016 - All rights reserved