Search code examples
google-analyticscross-domainuniversal-analytics

Universal Analytics - Cross Domain Tracking on multiple eCommerce sites with shared checkout


I manage multiple e-commerce sites that all share the same checkout process but have individual google-analytics accounts. Under the old google analytics for cross-domain tracking we used:

['_setDomainName', 'none']

When on the SSL checkout part of the process.

Under universal analytics I understand you can use linker plugin for cross-domain tracking but I don't see an equivalent to the 'none' configuration above. What is the correct way to achieve this?


Solution

  • I hope I understand your problem correctly. The best explanation is on the Google Documentation page but I'll try to make a summary.

    The _setDomainName configuration, on ga.js, sets the domain name for the Google Analytics cookies:

    _gaq.push(['_setDomainName', 'mywebsite.com']); 
    

    On analytics.js, the new way to do this is:

    ga('create', 'UA-XXXXX-Y', {
        cookieDomain: 'mywebsite.com'
    });
    

    And if you'd like to use the legacy cookies (from ga.js), you also should populate the legacyCookieDomain setting:

    ga('create', 'UA-XXXXX-Y', {
        cookieDomain: 'mywebsite.com',
        legacyCookieDomain: 'mywebsite.com'
    });
    

    There are two ways to have an equivalent to the 'none' configuration. The first one is:

    ga('create', 'UA-XXXX-Y', {
        'cookieDomain': 'none'
    });
    

    But Google suggests to use this solution to set cookies on localhost. The second solution is sending data directly to Google Analytics without the use of cookies.

    ga('create', 'UA-XXXX-Y', {
        'storage': 'none',
        'clientId': '35009a79-1a05-49d7-b876-2b884d0f825b'
    });
    

    Here you'll have to supply your own clientId parameter.