Cookies and Cross-Domain Testing

Introduction

This article describes how Convert Experiments handles cross domain testing; e.g. if your website spans multiple domain names - this is often the case if you are using a third-party shopping cart. 

First Party Cookies

Before we get into the details, it’s important to understand the fundamentals of how Convert tracks visitors. Convert uses first party cookies to identify your site visitors. First party cookies are set with the same domain name that is in the location bar of the visitor’s browser. It is very important to understand that cookies can only be 'seen', and changed, by the domain that sets them. In fact, it is almost impossible for a website to set a cookie for a different website. This is due to a default security setting that most browsers have. Website A can not set a cookie on website B.

Third Party Cookies

Let’s take this knowledge and apply it to how Convert works. When a user lands on a page on your site, the Convert Tracking Code looks for the Convert Tracking Cookies. If it finds the cookies then it updates them. If it does not find the cookies it sets them. Remember, if your website domain is www.convert.com, then the tracking code can recognize cookies with the www.convert.com domain and it can set cookies for the www.convert.com domain.

As the user continues their session the tracking code interacts with the tracking cookies. Continuing with our example, the user on our site is just about to click on a link to different domain, the third party e-commerce platform we use. They will leave our domain and go to the e-commerce provider’s domain. We’ve been tracking this user with a specific set of cookies on our domain. When the visitor leaves our domain we want them to take their cookies with them. The cookies identify them as a unique visitor, and if they don’t take their cookies to the next domain then we will lose the rest of their session information and that’s not good.

Tip

Transfer Cookies to a Third Domain via Active Websites

In Convert Experiments we organize Experiments into Projects. A Project is an entity that can contain any number of Experiments and which includes domains (Active Websites) which are part of the Project:

Tip

The way cookies are shared between domains is done by automatically passing cookies between domains that belong to the same project when a visitor clicks on links or submits forms. Those cookies get passed to your other domains through GET variables. Two variables are added to the query string in order to pass cookies:

  • _conv_v
  • _conv_s

Do not allow Cross Domain Linking

Some systems do not allow extra query variables. If that is the case, you can deactivate automatic cookie passing inside your Project's Settings:

Pass Cookies Manually

It’s also possible to manually pass cookies to selected links or forms. All you need to do is to pass the _conv_v and _conv_s variables in the URL of the link or action of the form. Here is an example:

<a href="http://www.myothersite.com/page.html" onclick="window.location=this.href+'?_conv_v='+escape(convert.getCookie("_conv_v"))+'&_conv_s='+escape(convert.getCookie("_conv_s")); return false;" >

GDPR Warning Message

The cross domain cookie will be by default turned off for all projects in Convert Experiences due to GDPR. Activating this will create a warning message as shown here.

Have more questions? Submit a request

Comments