Cross Domain Support

Cross Domain switches on your website? Don't worry we got you covered - learn what to do if your website switches between domains.

János Moldvay avatar
Written by János Moldvay
Updated over a week ago

What is a Cross Domain switch? 

Normally a website runs on one domain - like www.mywebsite.de but sometimes due to architectual constrains the domain switches during a session of a user.
Let's assume the following example: 

  1. A user enters your website www.mywebsite.de 

  2. He adds a product to his shopping cart and proceeds to the checkout 

  3. Once he hits the checkout he leaves www.mywebsite.de and enters www.mywebsite.com/checkout 

Why is a Cross Domain switch critical for the Adtriba tracking? 

Once your user leaves the original domain and 'switches' to another the firstpartycookie we set on www.mydomain.de and all it's information gets lost on www.mydomain.com/checkout
If Adtriba is integrated on the .com as well we'll set a new firstparty cookie which and the new touchpoint is direct. 

As you can see by now - a cross domain switch will cause trouble in case of: 

  • you will loose your 'real' touchpoints 

  • your customer journeys on myword.de won't be any successful (in this specific case) 

What to do to prevent any tracking issues?

Adtriba provides a pixelbased solution to solve the most common cross domain challenges. 

Please follow the instructions below. If any questions rise please don't hesitate to contact support@adtriba.com 

Extend the Integration Snippet with the Cross Domain Option

Define the "data-project-cross-domain" option in the configuration block with the required domain name.

<script type="text/javascript">
(function(){
    var id = "adtriba-js";
    var init = document.getElementById(id);

    if (!init) {
        var a = document.createElement("script");
        var s = document.getElementsByTagName("script")[0];
     
        a.setAttribute("data-project-tracker-id", "YOUR_PROJECT_TRACKER_ID");
        a.setAttribute("data-project-cross-domain", "my-project.com");
     
        a.type = "text/javascript";
        a.async = true;
        a.id = id;
        a.src = "https://cdn.adtriba.com/v2/adtriba.js";
        s.parentNode.insertBefore(a, s);
    }

    window.adtriba = window.adtriba || [];
    window.adtriba.push(["pageview"]);
})();
</script>

If you have more than one domain, just enter them as a comma separated list.

<script type="text/javascript">
(function(){
    var id = "adtriba-js";
    var init = document.getElementById(id);

    if (!init) {
        var a = document.createElement("script");
        var s = document.getElementsByTagName("script")[0];
     
        a.setAttribute("data-project-tracker-id", "YOUR_PROJECT_TRACKER_ID");
        a.setAttribute("data-project-cross-domain", "my-project-a.com,my-project-b.com,my-project-c.com");
     
        a.type = "text/javascript";
        a.async = true;
        a.id = id;
        a.src = "https://cdn.adtriba.com/v2/adtriba.js";
        s.parentNode.insertBefore(a, s);
    }

    window.adtriba = window.adtriba || [];
    window.adtriba.push(["pageview"]);
})();
</script>
Did this answer your question?