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.
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:
Create a constant to store the domain name of the site, which is a virtual top-level domain, separated by commas:
Create a Google Analytics Settings and do some configuration:
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.:
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:
Click on the link to jump to another website and notice the changes on the URL:
The Client ID is passed in and the two sites recognize the same visitor.