BETA NOTICE: Please note that, during Beta testing, the feature is subject to change. If you wish to be informed when updates are released, contact your Success Manager to join the Beta testers. We appreciate your feedback to help develop and stabilize the feature.
In this article:
∘ Enhanced Event Measurement and custom events
∘ Connecting Google Tag Manager to Publitas
∘ Tracking embedded publications
∘ Cross Domain Tracking
∘ Creating a dedicated property for publications
- Install the preset container settings in Google Tag Manager
∘ Importing the preset
∘ Connecting new tags to the GA4 configuration
- Add custom dimensions to Google Analytics
- Test the connection
This article described how to use Google Tag Manager to connect Google Analytics 4 (GA4) to your online publications. But first, there are a few important things to know about making the connection as effective as possible.
Enhanced Event Measurement and custom events
Publitas leverages Enhanced Event Measurement to track pageviews and user flow. Custom pageview events are also recorded, which contain publication-specific details that can be used for advanced reporting. Other custom events are recorded to help track the performance of your online publications and build richer audiences.
GA4 Data Stream with Enhanced measurement enabled:
Connecting Google Tag Manager to Publitas
To enable installing tags onto your publications, first connect Google Tag Manager to Publitas. If you aim to track the publication in a dedicated property, it is recommended to create a dedicated container in Google Tag Manager. This way you don't have to worry about any existing tags firing on the publications as well.
Tracking embedded publications
As of this moment, GA4 still relies on cookies to track data. For embedded publications to be able to set and update cookies, the embedded domain needs to be the same as the domain of the website embedding it. Make sure to connect a custom domain to your publications that matches your website's domain.
For example, connect catalog.mydomain.com to the publications if your website is www.mydomain.com.
Once a custom domain is connected to your publication, the embed code is also updated to use the new domain. Make sure to replace any previous embed codes with the new ones.
Cross Domain Tracking
Do you wish to learn more about how publications influence shopping behavior and do you want to allocate sales to the original source of traffic? Then go for tracking your website and online publications in a cross domain tracking setup. Combining publication and website data allows you to build catalog-specific audiences and leverage GA4's predictive insights to learn more about catalog readers' shopping behavior.
Consider the following preparations:
In Google Analytics
- Locate the property in the Admin section and select Data streams
- Click on the data stream for web and go to More Tagging Settings, found at the bottom
- Select Configure your domains and add a condition where the domain exactly matches view.publitas.com or your custom publication domain
In Google Tag Manager
- Create a new trigger, selecting Page View as the trigger type
- Make sure the trigger fires on Some Page Views and apply the condition Page Hostname - equals - view.publitas.com (or your custom publication domain)
- Apply the new trigger as an exception to all existing tags that (will) fire on the publications as well, now that the container is also active there
TIP: Look for tags with the All Pages trigger
Creating a dedicated property for publications
If you wish to track publications in a dedicated property, first follow these steps:
(If you chose cross domain tracking, go directly to Install the preset container settings in Google Tag Manager)
In Google Analytics
- Go to the Admin section, found in the bottom left corner
- Select the correct account in the first column (if applicable), then select Create property at the top of the second column
- Enter a name for the new property, then select the applicable time zone and currency
- Click on Next and on Create (entering the details of your business is optional)
- Select Web and enter view.publitas.com or your custom domain as the Website URL
- Enter a Stream name (e.g. use the publication domain)
- Make sure the Enhanced Measurement is enabled, then copy the Measurement ID
- Go to Data Settings in the admin section, and change Data Retention to 14 months
In Google Tag Manager
- Add a new "Google Analytics: GA4 Configuration" tag
- Paste the Measurement ID and keep the default settings
- Select "All Pages" for the tag's trigger
- Give the new tag a name (e.g. "GA4 - Publitas Configuration") before saving the changes
GA4 Configuration tag:
Install the preset container settings in Google Tag Manager
Recording custom events requires custom data. Publitas uses the data layer to feed Google Tag Manager the necessary data. Below are the steps to import the variables, triggers and tags required to install Publitas' preset tracking configuration.
Importing the preset
- Download the container file attached to this article
- After selecting the container in Google Tag Manager, go to the Admin section
- Select Import Container and choose the downloaded file from your computer
- Click on Existing workspace and select the desired workspace
- Merge the selected workspace with content of imported container, select Rename conflicting tags, triggers, and variables and click Confirm
Connecting new tags to the GA4 configuration
- Go to the Tags section and connect GA4 - Publitas Virtual Pageview tracking and GA4 - Publitas Event tracking to the GA4 configuration tag you prepared earlier
- Complete the setup by deleting the PLACEHOLDER GA4 CONFIG TAG
Add custom dimensions to Google Analytics
Out of the box, all custom events are recorded by GA4. The event parameters, sent along with each custom event, are only be recorded when they are added as custom dimensions.
After selecting the property in Google Analytics, go to Configure > Custom Definitions. Then, create the following set of custom dimensions:
Dimension name (customizable)
|Publitas Event Action||pbl_action||Event|
|Publitas Event Value||pbl_value||Event|
|Publitas Group Name||pbl_group||Event|
|Publitas Page Number||pbl_page||Event|
|Publitas Product ID||pbl_product_id||Event|
|Publitas Product Title||pbl_product_title||Event|
|Publitas Publication Name||pbl_publication||Event|
Test the connection
Once the setup is completed your publications will be tracked by Google Analytics. To verify that data is coming in correctly:
- In Google Tag Manager, load any publication that should be tracked by Google Analytics in preview mode
- In Google Analytics, go to Configure > DebugView and look for the events coming in when you browse through and interact with the publication
DebugView in Google Analytics: