Google Analytics cross-domain tracking: Creating a custom filter in View to add the domain to URIs
In Google Analytics reports, you usually only get the page path such as /about or /blog/2015/foo. This default is perfect until you want to track multiple domains in the same Property.
For example if I have a single Property code UA-0000000-1 used for cross-domain tracking on sites bar.com and foo.bar.com I have no way to distinguish between pageviews on bar.com/about and foo.bar.com/about as they are both logged as /about.
We can get around this problem by creating a new View on the Property with a custom Filter. Google’s help on this is ok but it didn’t make things as obvious as it could have. So here’s a screenshot of the Filter settings needed:
With this in place, the View will include the full URI in reports.
I saw a recommendation to create a new View for this rather than editing an existing one. I’m not sure what the advantages of that are but given that you can’t go back on historic data to see domains in reports, I think I’ll configure this Filter as a matter of course for any View that might have cross-domain tracking one day. This is probably going to be every Analytics account ever, so I guess that makes it my new default set up.