Mobile app version of vmapp.org
Login or Join
Michele947

: Google Analytics tracking across multiple domains - not showing domain, not tracking I have been trying to get Google Analytics (Universal) working across two related domains, say www.foo.com and

@Michele947

Posted in: #GoogleAnalytics #UniversalAnalytics

I have been trying to get Google Analytics (Universal) working across two related domains, say foo.com and app.foo.com.

According to the Google Docs, I should be able to use the Universal code with domain 'auto' and it should just work.

I did the standard tracking codes in both sites (ID changed):

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'MY-CODE-1', 'auto');
ga('send', 'pageview');




I have two problems:


When I go to "Real-Time" pane, I see the visitor count and page visited correct when I go to a page in the www site, but nothing for the app. site.
I cannot get it to show me the domain name of the page visited. I tried using custom filters on the global view per support.google.com/analytics/answer/1034342?hl=en#Next but it makes no difference.


What am I doing wrong?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Michele947

1 Comments

Sorted by latest first Latest Oldest Best

 

@LarsenBagley505

With analytics.js, there's no need to do more.

So, first thing to check is the implementation of the code.

One good way is to use the official Google Analytics Debugger for Chrome developers.google.com/analytics/resources/articles/gaTrackingTroubleshooting#usingDebugger Then activate it, open up the console with F12 and see if the code is working, like this:



If Initializing Google Analytics isn't present, here's the problem. So, look back to both the script and see what could be the differences between the working one and the other.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme