1. Home
  2. Docs
  3. Google Tag Manager Guide
  4. Google Tag Manager Practical Guide
  5. Cross-Domain Tracking

Cross-Domain Tracking

In this section we will talk about how to do cross-site tracking in Google Analytics and send data from two websites to the same property.

Cross-Domain Tracking

Principle: Each site corresponds to a GTM container. Each site performs the same configuration in GTM, and sends data of different sites to the same GA-Property. The allowLinker and cookieDomain in the tag are to solve the identification problem of the same user at different sites. The problem of uniqueness of cross-site users is solved by passing the user’s uniquely labeled Client ID to another site during cross-site.

Setup Process:

Here I have two websites that need to do cross-site tracking, http://www.bbccss.com and http://www.ichdata.com. We first create a new Property for cross-site tracking to collect data, the tracking ID is UA-69988360-24, now let’s go to GTM to do the configuration:

Create a constant to store the Tracking ID:

Cross-Domain Tracking

Create a constant to store the domain name of the site, which is a virtual top-level domain, separated by commas:

Cross-Domain Tracking

Create a Google Analytics Settings and do some configuration:

Cross-Domain Tracking

allowLinker is to ensure the delivery of the Client ID, when the jump to another website will have an ID on the URL.

Auto Link Domains, this is a virtual primary domain that is shared by two websites.

Tracker Name is to ensure that data is sent to different properties. If your site sends data to multiple properties, be sure to set the Tracker Name.

In the final step, set the tag, this step is the same as configuring the base tracking code.:

Cross-Domain Tracking

On another website, do the same configuration as above.

Finally, let’s test it, click Preview in the upper right corner, and open http://www.bbccss.com:

Cross-Domain Tracking

Click on the link to jump to another website and notice the changes on the URL:

Cross-Domain Tracking

The Client ID is passed in and the two sites recognize the same visitor.


If you don't understand, You can leave a comment below or email me (haran.huang@ichdata.com).
Tags , ,
Was this article helpful to you? Yes No

How can we help?

Post my comment
Cancel comment
Expression Texture Bold Strikethrough Center Italic Sign in

Hi, you need to fill in your nickname and email!

  • Nickname (required)
  • Email (required)
  • Website