How to track multiple domains with Google Universal Analytics?

This can be a tough question. At least It has been for me before doing some research and testing several things.

In our agency we are used to work with international sites dealing with more than one domain. In some cases, we want to keep the data of 2 or more domains in one single report, cross tracking sites.

So to explain how to do it, I will assume that you want to cross-domain and subdomain track (e.g. have a visitor appear as a single visit and share cookie information across all sites.

Before you implement cross domain tracking, you should configure your Google Analytics property to ignore the destination domains as self-referrals through the admin section of the web interface.

Google Analytics recognises the URL you use to set up a new property in your account and automatically excludes this domain from your referral traffic, so you won’t see self-referrals in your Analytics reports.

However, you need to add the cross tracked domain to the exclusion list.

Here is how to do it:

Lets assume the web property is initially created for domain.com. You need to cross track to domain.it.

Follow these steps:

1. Navigate to a property. If you’re not in the settings screen, click Admin.
2. Click Tracking Info then Referral Exclusion List.
3. Enter domain.com and domain.it.
4. Click Apply to save.

Once you have this, you will need to work on your tracking code.

For your tracking code, do the following, using the cross domain auto link method:

If you need to subdomain and cross-domain track between all domains/subdomains on domain.com & sub.domain.com place the following tracking code before the closing tag
swapping out the UA# with your own from your account:

Google Analytics Cross Domain Tracking

On domain.it (the other domain):

Place the following tracking code before the closing tag swapping out the UA# with your own from your account:

Google Analytics Cross domain tracking

The next step is to work on our filter settings in Google Analytics.

You will not be able to distinguish which page is from which domain with the current default settings. To show the domain in the page reports, we have to set a filter to include all components of the page URL.

Remember to leave your default view without any filters. We will create the filter on a new view.

Create a copy of it via the provided link to do so at the lower right of the View Settings Page.

Then create and apply the following filter to the copied View in this way:

In the View (Profile) Settings page, click the Add Filter link.

  1. Choose Add New Filter and provide the filter a name.
  2. Choose Custom Filter and select Advanced on the Filter type settings.
  3. Under Advanced settings:
    a. FieldA should be set to Hostname
    b. FieldB should be set to Request URI
  4. Set the values for both Field A and Field B to (.*), which is an expression that captures all characters.
  5. Set the Output To –> Constructor option to Request URI and provide $A1$B1 as the value for that choice.

Your reports will now show:
 www.domain.com/index.php
 — sub.domain.com/more.php.
 This will capture the www.domain.com portion of your URL and include that at the beginning of your page URL in the content reports section.

If you want to create separate views for the 2 domains I advise you to create 3 new profiles: one to include traffic from both domains, one to track only the .com and one for tracking the second domain.

You can do this applying the simple “predefined” filter in the 2 views that will show only data for a single domain:

  1. Choose Add New Filter and provide the filter a name.
  2. Choose Predefined Filter int he Filter type settings.
  3. Select Include only, traffic to the hostname, that contain:
  4. In the Hostname field write the domain that you want to include in this view ( e.g. domain.it)In this example your reports in this new view will now show only data related to domain.it.  You will have to replicate this on the other filter so that you can track the other domain, and keep the third view without “include” filters.

I hope this is useful. If you have any questions, don’t hesitate to comment! I will try to answer as soon as possible.

Leave a Reply

Your email address will not be published. Required fields are marked *


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>