EARLY ACCESS: If you're interested in using this feature and you're on the Enterprise plan, feel free to reach out to your success manager who will activate this for you.
---
⚠️ Google has announced that Universal Analytics will be deprecated and stop processing data on July 1, 2023. Tracking publications in GA4 is now available via Google Tag Manager. Click here to learn more.
Looking at how much traffic came from the publication domain is a great way to identify how well your online publications have performed. In order to allocate online purchases to the original source (e.g. paid advertising) you need the recorded session to be uninterrupted from the moment the site is first entered until the moment a purchase is made.
By setting up cross domain tracking, Google Analytics will treat the online publications as part of your own environment which will avoid the online publications from initiating a new session with a new campaign when it sends traffic back to your site.
In this article:
Prerequisites
- You have connected Google Tag Manager to your publications
- You have configured publication tracking in Google Tag Manager
- You are able to change the settings of the target Google Analytics property (custom dimensions, view filters)
- You are able to make and publish changes in the Google Tag Manager Container
If your Google Tag Manager has not been connected to your online publications yet, you can use this article to configure publication tracking in Google Tag Manager.
It is important to consider that adding publication data to an existing property can significantly increase the number of events and pageview recorded by the property's views. Make sure to update the filters of each view to either include or exclude the publication data.
Requirements
- All domains are tracked by the same Google Analytics property
- view.publitas.com and applicable custom domains are added to the referral exclusion list
- The Google Analytics configuration for both website and publications have the following setting applied: AllowLinker=true
- The Google Analytics configuration for both website and publications include the list of Auto Link Domains
- In case publications are embedded, the iframe decorator script is added to website
- No UTM parameters are appended to the URLs, linked in the publications
Below, the instructions for each step are described in more detail.
1. All domains are tracked by the same Google Analytics property
Make sure that Google Analytics configurations in Google Tag Manager, for both your website as the online publications, are connected to the same tracking ID.
TIP: It can help to have both the website and the publications share the same GA settings. In this case, don't forget to copy over the custom dimensions and the cookieFlags setting from the imported GA Settings Variable before deleting the redundant variable.
2. view.publitas.com and applicable custom domains are added to the referral exclusion list
Add view.publitas.com and the custom domain (if applicable) to the referral exclusion list in Google Analytics. This will avoid new sessions from being recorded when traffic is transferred between domains.
Click here to read more about referral exclusion.
3. The Google Analytics configuration for both website and publications have the following setting applied: AllowLinker=true
In the Fields to Set section, add a new field that says allowLinker = true. Make sure that this setting is applied to the page view tracking for both the website and the publications.
4. The Google Analytics configuration for both website and publications include the list of Auto Link Domains
In the Cross Domain Tracking section of the Google Analytics settings, submit all domains that require uninterrupted tracking. Subdomains are not automatically included. That is why we recommend adding all relevant subdomains individually.
Make sure that this setting is applied to the page view tracking for both the website and the publications.
5. In case publications are embedded, the iframe decorator script is added to website
The allowLinker function ensures that the client ID is shared between domains whenever a link between two domains is clicked. For example, when a link on the website is clicked that will open an online publication. When a publication is embedded on a webpage, both the website and publication load simultaneously and the allowLinker function does not trigger.
In this case, we need to install a separate function in Google Tag Manager to pass along the client ID from the website to the embedded publication.
- Download the file attached to this article (see Downloads)
- Open the Container, responsible for cross domain tracking, in Google Tag Manager
- Go to the Admin section and select Import container
- Choose the downloaded file
- Select the correct workspace to apply the changes to
- Select Overwrite and click Confirm
- Locate the Google Analytics settings that is responsible for tracking pageviews of the website.
- In the Fields to Set section, add a new field that says customTask = {{CJS - Publitas Iframe Decorator}}
! IMPORTANT !
If you are not using the JavaScript embed code from Publitas, please follow these additional instructions: Locate and edit the CJS - Publitas Iframe Decorator variable and replace [id^="embed-container-publitas-embed-"] with the id (e.g. #publitas-container) or the class (e.g. .publitas-container) of the div that contains the iframe of the publication.
For example, when a publication is embedded like this:
<div class="publitas-container">
<iframe style="display: block; box-sizing: border-box;" src="https://view.publitas.com/PUBLICATION-URL-GOES-HERE?publitas_embed=maximized" frameborder="0" allowfullscreen="allowfullscreen"></iframe>
</div>
The third line in the custom JavaScript variable needs to look like this:
selector: '.publitas-container iframe',
6. No UTM parameters are appended to the URLs, linked in the publications
With cross domain tracking active, the online publications are tracked at the same level other pages of the website are tracked. This mens, there is no longer a need for UTM parameters which are used by Google Analytics to help determine the source of external traffic.
Be sure to remove the UTM parameters from the product feed used in Publitas, from the hotspots added manually to the publications (e.g. Link hotspots) and disable the UTM automation feature in case you've used it in the past.
How to test if cross domain tracking works
To test if cross domain tracking is working you can visit your website, navigate to the online publication and use the hotspots to navigate back to the website, while checking if the Google Analytics client ID is passed along with each step.
To know what Client ID is used you will need to find the cookie that stores it. For this, you can use the Chrome browser. Press the F12 key, go to the Application tab, click on Cookies, select the applicable domain from the drop-down list and find the cookie named _ga :
Be sure to look for the value of the _ga cookie, every time you navigate between domains to check if it has remained the same. If the publication is embedded, check both the website domain as the publication domain in the dropdown list.
TIP: Avoid having multiple variables in Google Tag Manager that contain Google Analytics Settings. This may cause Google's javascript to initiate multiple times, resetting the client ID every time it does, and therefor disrupt cross domain tracking.
Need help?
If you are unfamiliar with how Google Tag Manager works or how to navigate the settings of Google Analytics, our Services team can guide your though this. Contact your Success Manager for more information.