Google Analytics Subdomain Tracking | The ROI Revolution Blog

If you do a quick search on “Google Analytics Subdomain Tracking”, you may have noticed that many of the top results are either woefully out of date or rather confusing. The purpose of this post is to provide my recommendations for Google Analytics subdomain tracking as of the current version of the asynchronous Google Analytics Tracking Code.

Currently there’s no specific article on Google Code dedicated to Google Analytics subdomain tracking. The closest is this, which recommends the following:

//Tracking code customizations only

var _gaq = _gaq || [];

_gaq.push([‘_setAccount’, ‘UA-12345-1′]);

_gaq.push([‘_setDomainName’, ‘.example-petstore.com’]);

_gaq.push([‘_setAllowHash’, false]);

_gaq.push([‘_trackPageview’]);

I propose that instead, for the vast majority of sites with subdomains, you should use the following:

//Tracking code customizations only

var _gaq = _gaq || [];

_gaq.push([‘_setAccount’, ‘UA-12345-1′]);

_gaq.push([‘_setDomainName’, ‘example-petstore.com’]);

_gaq.push([‘_addIgnoredRef’, ‘example-petstore.com’]);

_gaq.push([‘_trackPageview’]);

So what’s wrong with the code recommended on Google Code? It turns out there are three issues with the code that cause unnecessary problems:

via Google Analytics Subdomain Tracking | The ROI Revolution Blog.

Advertisements

About Bob Warfield

Here's my bio: http://www.smoothspan.com/management.html
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s