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?