Forwarding Tracking Cookies Between Different Domains

Understand Tracking Cookies and Different Domains

When there are multiple domains where a test needs to run or where the conversions need to be tracked, things get a little bit complicated. A common scenario would be the one where there's a main site that hosts all the products to be sold but the actual checkout happens on another domain.

In this situation, without forwarding the cookies to the checkout domain, the conversions will not be tracked accurately. Convert Experiments uses also a third party cookie to track conversions in this situations but those are not always allowed to be set by browsers.

The culprit of this is the fact that cookies are stored and accessed under a specific domain and they are not available on any other domain. Therefore, the cookies have to be passed along when leaving one domain and going to the other one. Convert Experiment does this by default for interlinking and form submissions between the domains inside the same projects. This is done on document ready by modifying the submit and click handlers for forms and links respectively. Sometimes, due to dynamic content being added via JavaScript, this process is not working well and the site owner needs to pass the convert cookies inside their scripts. 

Mainly, there are two cookies that need to be passed as GET parameters:

  • _conv_v - is the visitor level cookie that holds data that describe visitor's activity
  • _conv_s - session level cookie;

They need to be passed in the URL as GET parameters, under the same names. To get their value, we make available the following cookie:

convert.getCookie(name);

If the outgoing URL is http://www.mysite.com/page.html then the final destination URL, put together with JavaScript code, would be something like this:

"http://www.mysite.com/page.html?_conv_v="+encodeURIComponent(convert.getCookie("_conv_v"))+"&_conv_s="+encodeURIComponent(convert.getCookie("_conv_s"))

Of course, the destination page needs to have convert experiment's code installed correctly for this to work.

Have more questions? Submit a request

Comments