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:
- Where _setDomainName() is not used on any pages:
- The root sub-domain (MyWidgets.com) is not redirected to the www sub-domain (www.MyWidgets.com). 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 www.MyWidgets.com to store.MyWidgets.com)
- Inconsistent redirection between root and/or other sub-domains.
Solutions:
- Have your WebMaster/ISP/IT guy configure your root sub-domain to redirect to www.
- Follow the Best Practises listed below.
- 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)
Solution:
- Urchin’s _udn variable must be be consistently translated to ga.js’ _setDomainName() function.
(e.g.: _udn =”.MyWidgets.com” becomes _setDomainName(“.MyWidgets.com”)
- Running tests with Google Website Optimizer and coding it’s GA components differently than the rest of the site’s GA tracking code.
Solution: - Correct the GWO code to use _setDomainName() consistently and check for the issues discussed below.
- 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.
Solution:
- 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.)
- 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 www.MyWidgets.com sub-domain since _setDomainName(“.MyWidgets.com”) is called too late:
var pageTracker = _gat._getTracker(“UA-987654321-99”);
pageTracker. _initData();
pageTracker._setDomainName(“.MyWidgets.com”); // wrong order
pageTracker._trackPageview();
The campaign cookie it creates records the “ILoveWidgets” campaign as follows:
Name: __utmz
Value: 187400622.1251739746.1.1.utmcsr=google|utmccn=ILoveWidgets|utmcmd=cpc
Host: www.MyWidgets.com
- On a subsequent page, the following code creates a different set of cookies in “.MyWidgets.com”
var pageTracker = _gat._getTracker(“UA-987654321-99”);
pageTracker._setDomainName(“.MyWidgets.com”); // correct order
pageTracker._initData();
pageTracker._trackPageview();
Name: __utmz
Value: 18180582.1251739746.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)
Host: .MyWidgets.com
- 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:
Wrong:
var pageTracker = _gat._getTracker(“UA-987654321-99”);
pageTracker. _setVar(“Leads”);
pageTracker._setDomainName(“.MyWidgets.com”);
pageTracker._trackPageview();
Right:
var pageTracker = _gat._getTracker(“UA-987654321-99”);
pageTracker._setDomainName(“.MyWidgets.com”);
pageTracker. _setVar(“Leads”);
pageTracker._trackPageview();
The Best Practices we recommend:
- 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.
- Always using _setDomainName(“.MyWidgets.com”); whether you have sub-domains or not.
- Always using _set* functions before any of the The _initData Hombres (the Pageview, event, setVar, or ecommerce functions) that send data to GA).
- Using these 3 Best Practises together.