How to Track Traffic Across Multiple Websites
Do you have a main site + a blog or an ecommerce site that uses a different URL from the main site? Cross-domain tracking is used to capture visitors that are bumping between your various websites. It’s easy to set up, but also a headache to troubleshoot. Here’s a quick look at how to track website traffic moving between your main domain and a subdomain or other URL.
Google Analytics makes it easy to track traffic for multiple sites using a single Google Analytics code. That's not always the best practice, so caveat, caveat, caveat. Here's when it's worthwhile. Say you have a main website (example.com) and a blog (blog.example.com). People view pages on the main site and following a link to blog content, or they come to the blog then click through to view the product detail page on the main site. You want to understand in Google Analytics that this is the same person moving between the two websites in a single session.
The problem with having two separate Google Analytics codes is that one person in a single session looks instead like two different people visiting the two different sites. That double counting can inflate your number of visitors and visits (users and sessions), especially if the website content encourages people to bump back and forth between the two sites.
The solution is cross-domain tracking, which you can set up using Google Tag Manager or by modifying the analytics code that goes on your websites. The support documentation is pretty good on this: https://support.google.com/analytics/answer/1034342?hl=en
Basically there are a few things to do:
- Make some minor edits to the code for the main domain so that Google understands that you want to track across multiple sites.
- Make some minor edits to the code for the secondary domain so that you can use the same analytics account as the main domain.
- Set up a filter in Google Analytics to show the domains (i.e., so you can tell the difference between pageviews of main domain pages vs. the secondary pages in the Behavior Reports)
- Add domains to the Referral Exclusion List so Google understands that people are moving between the related websites vs. tracking those visitors as “referrals” from one site to the other.
To make those changes see the support.google link above.
The filter will look like this:
Cross-domain tracking requires a bit of setup because you basically have to tell Google Analytics that you want to do something beyond the standard tracking. Jeff Sauer has a great blog and an excellent, in-depth post on some of the considerations and troubleshooting needed to track traffic across multiple sites.
Recommended Reading: https://www.jeffalytics.com/cross-domain-tracking/