Cookies and Cross-Domain Testing



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 the 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, then the tracking code can recognize cookies with the domain and it can set cookies for the 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.


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:



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


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="" onclick="window.location=this.href+'?_conv_v='+escape(convert.getCookie("_conv_v"))+'&_conv_s='+escape(convert.getCookie("_conv_s")); return false;" >

You can also add the parameters to all links manually with the following code that you add to your Convert > Project > Global Javascript section. Just change the for the domain where the cookies need to be transferred.

document.addEventListener("DOMContentLoaded", function () {
document.querySelectorAll("a[href*='']").forEach(function(link) {
var url = new URL(link.href, location.href);

// Check if the query parameters already exist, and only append if they don't
if (!url.searchParams.has("_conv_s")) {
url.searchParams.append("_conv_s", convert.getCookie("_conv_s"));
if (!url.searchParams.has("_conv_v")) {
url.searchParams.append("_conv_v", convert.getCookie("_conv_v"));

link.href = url.toString();

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.

Need assistance? Start a conversation with our Support Team.

Reliably Convert More Site Visitors, Even If Everything Else is Changing in Your Business.

✓ No Credit Card  ✓ Easy Set-Up  ✓ Access All Features