Mobile app version of vmapp.org
Login or Join
Angela700

: Broken links in content reports when tracking subdomains with Google Analytics I have a tracking code that I use on my main site and my blog, which is on a subdomain: www.example.com blog.example.com

@Angela700

Posted in: #GoogleAnalytics #Subdomain

I have a tracking code that I use on my main site and my blog, which is on a subdomain:

example.com blog.example.com


I have a single profile in Google Analytics. I use advanced segments to look at traffic to the main site vs. traffic to the blog.

Problem 1:

When I'm browsing my content reports under Standard Reporting, the "Page" column doesn't show the top-level or sub-domain, so I can't differentiate example.com/index.html from blog.example.com/index.html easily.

According to the docs, this filter is supposed to make GA prepend the hostname to the page URL in your content reports, but it doesn't seem to work.

Problem 2:

When I click on the little "Open in new window" icon next to a given page in a content report line, it always assumes the page lives on example.com, so I get 404s when the page is actually on blog.example.com.

Is there a good solution for these subdomain tracking problems?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Angela700

1 Comments

Sorted by latest first Latest Oldest Best

 

@XinRu657

Is there a good solution for these subdomain tracking problems?


Prepend the subdomain to the content URI in your tracking snippet - while this will not address your present tracking problems, it will create unique URI's for your subdomain (providing you don't also have a directory named "blog" under your primary domain) for all future tracking.

Tracking snippet example for blog.example.com:

_gaq.push(['_trackPageview']);


... becomes ...

_gaq.push(['_trackPageview', '/blog' + window.location.pathname]);


If you want to simplify navigation between your analytics reports and content on your site, you can create permanent redirects for the /blog directory at example.com

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme