fr | en | es | de

Redirections

New!
Discover the latest tools in the
Analytics Suite, thanks to our new online help.

Contents: Hide

Redirection to the same domain name

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:

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:

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:

<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:

Important

- 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.

Redirection to a different domain name

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.

 

ico_up.gif