Cardinal Path’s response to COVID-19 Cardinal Path is sharing all we know to help marketers during COVID-19.  Learn more.

You’re getting AdWords traffic. You’re sure that some of those visitors are converting. But Google Analytics is not giving your Campaigns the credit they are due. Could Sub-domain tracking be the problem?

All sub-domain tracking problems lead to _setDomainName() and _initData(). _initData()? Just when you thought it was deprecated, dropped, kaput, gone and forgotten !!!

When Sub-domain tracking goes wrong or does not exist when it should, the following problems will occur:

Most typically your Traffic Sources | Referring Sites report will list your own site as a referring site – perhaps as its own top referring site! This occurs when visitors move between sub-domains without already being recognized as visitors to the domain.

Pages that are unreachable without first logging in or following a process (eg Thank you pages, Receipt pages, etc) appear in your Landing Pages Report

As depicted here, where such pages are Goal Pages and are counted as such in your Funnel Visualization report but show as entrances to the Funnel

All sub-domain tracking problems roads lead to the _setDomainName() function – its only the on-ramps and turn-pikes that differ.

Common Scenarios:

  1. Where _setDomainName() is not used on any pages:
    • The root sub-domain ( is not redirected to the www sub-domain ( Visitors may type in/bookmark either and then click on links that don’t consistently refer to either.
    • The use of sub-domains causing users to move between sub-domains (eg to
    • Inconsistent redirection between root and/or other sub-domains.


    • Have your WebMaster/ISP/IT guy configure your root sub-domain to redirect to www.
    • Follow the Best Practises listed below.


  2. A mix of urchin.js (legacy version) and ga.js (current version) resulting from:
    • A migration from one version to the other
    • The incorporation of pages with one version into a site that uses the other.
    • Incorporation of specific pages (eg Receipt/Thank you pages with Ecommerce)
    • Using urchin.js for Google Website Optimizer on a ga.js site (or vice-versa)


    • Urchin’s _udn variable must be be consistently translated to ga.js’ _setDomainName() function.
      (e.g.: _udn =”” becomes _setDomainName(“”)
  3. Running tests with Google Website Optimizer and coding it’s GA components differently than the rest of the site’s GA tracking code.

    • Correct the GWO code to use _setDomainName() consistently and check for the issues discussed below.


  4. Incorrect order of GA’s _set* functions and either _initData() or any of the functions that send data to GA (eCommerce, events and _setVar functions)
    • _initData() has been deprecated and its use is now be optional.However, all functions that send data to GA still call _initData() internally.
      That is why its no longer necessary to call it ourselves.
      I’m calling those functions The _initData Hombres.
    • It’s purpose is to initialize the tracking objects and (re-)creating the __utm* cookies.
    • _initData() does so according to the settings in place at the time it is called. Subsequent _set* functions are ignored.


    • all _set* functions (other than _setVar()) must be called before any of The _initData Hombres or their settings will have no effect.
      (_setVar() should, perhaps, not have the _set prefix – just remember it is the odd one out.)
  5. General coding inconsistency between pages resulting from evolutionary development, multiple developers and other such consequences of real life.

How AdWords gets robbed of its Due

  • In the following example, _initData() causes a set of cookies to be created for the sub-domain since _setDomainName(“”) is called too late:
    var pageTracker = _gat._getTracker(“UA-987654321-99”);
    pageTracker. _initData();
    pageTracker._setDomainName(“”); // wrong order

    The campaign cookie it creates records the “ILoveWidgets” campaign as follows:

    Name: __utmz
    Value: 187400622.1251739746.1.1.utmcsr=google|utmccn=ILoveWidgets|utmcmd=cpc
  • On a subsequent page, the following code creates a different set of cookies in “”

    var pageTracker = _gat._getTracker(“UA-987654321-99”);
    pageTracker._setDomainName(“”); // correct order

    Name: __utmz
    Value: 18180582.1251739746.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)

  • If a Goal or an Ecommerce transaction is recorded at this point, the AdWords campaign would be robbed and conversions will be credited to “Direct”.Using any of The _initData Hombres before _setDomainName() will have the same effect:
    var pageTracker = _gat._getTracker(“UA-987654321-99”);
    pageTracker. _setVar(“Leads”);
    var pageTracker = _gat._getTracker(“UA-987654321-99”);
    pageTracker. _setVar(“Leads”);

The Best Practices we recommend:

  1. Having your GA tracking code (“var pageTracker = … etc) in a single .js file that is called from every page. This is the best way to ensure consistency and to make sure new pages are tagged in the same way as existing pages.
  2. Always using _setDomainName(“”); whether you have sub-domains or not.
  3. Always using _set* functions before any of the The _initData Hombres (the Pageview, event, setVar, or ecommerce functions) that send data to GA).
  4. Using these 3 Best Practises together.


State of Digital Marketing Analytics

The 2020 State of Digital Marketing Analytics examines the marketing technology that supports the world's most successful enterprises and highlights the challenges and strategies for navigating the new normal..