I have been trying to get Google Analytics (Universal) working across two related domains, say www.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 https://support.google.com/analytics/answer/1034342?hl=en#Next but it makes no difference.What am I doing wrong?
Google Analytics tracking across multiple domains - not showing domain, not tracking
google analytics;universal analytics
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 Chromehttps://developers.google.com/analytics/resources/articles/gaTrackingTroubleshooting#usingDebuggerThen 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.