[GA4] Setting up Google Analytics tracking in Publitas

Available_in Bronze Silver Gold ENT
 

In this article:

Google Analytics integration menu:
03

Introduction

This article describes how to activate the Google Analytics 4 integration to start tracking your online publications. Following these instructions will have the online publications tracked in the same Data stream that is tracking your website. This cross-domain configuration is recommended by Google as it helps preserve user journeys. It also supports building catalog-specific audiences to understand how online publications drive conversion and leverage GA4's predictive insights.

  ⚠️ This setup works best if Enhanced Event Measurement is enabled in the Data stream.

Step 1: Connect a custom domain to your publications

For Google Analytics to track online publications, embedded on your site, it needs the domain of both the website and publication to match. 

Example:
When a publication, hosted on view.publitas.com, is embedded on a website hosted www.mydomain.com, Google Analytics will not record any data. If the embedded publication uses catalog.mydomain.com in its URL, Google Analytics will be able to track the publication.

This is why it is important to make sure that your online publications are published using a subdomain of your site's domain. 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.

  Click here to learn more about connecting a custom domain to your publications.

 

Step 2: Configure the publication domain in the Data Stream

  1. In Google Analytics, locate the website's property in the Admin section and select Data streams
  2. Click on the data stream for web and first copy the Measurement ID
  3. Then, go to Configure tag settings near the bottom
  4. Select Configure your domains and add a condition where the domain exactly matches your custom publication domain
    04

 

Step 3: Connect the Measurement ID to Publitas

To connect the Publitas to Google Analytics, open the Group Settings menu in Publitas and add the Measurement ID that was copied in the previous step. Make sure to store the changes by clicking on "Save Settings".

Adding a Measurement ID to connect Google Analytics:
06

 

Step 4: Add custom dimensions to Google Analytics

IMPORTANT: Make sure to disable automatic translation of this page
before completing this step.

Out of the box, all custom events are recorded by Google Analytics. Each event contains a set of event parameters to support advanced filtering of data in reports and dashboards. To record the event parameters as well, you'll need to add them as custom dimensions in Google Analytics.

In Google Analytics, go to Admin > Custom Definitions to create the following set of custom dimensions:

Dimension name

Event parameter

Scope

Publitas Collection Name pbl_collection Event
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

07

  Click here to find all events and parameters recorded for online publications

Step 5: Test the connection

Once the setup is completed, your publications will be tracked by Google Analytics. 

To verify the connection, select the connected property in Google Analytics. The home page will appear, which will also show you the users that were active in the last 30 minutes. The connection with Google Analytics is successful if this widget shows at least one active user within a minute after you open one of the publications in your browser.

Make sure to have a publication open somewhere while looking for active users:
08

  Check out all events and parameters recorded for online publications

Step 6: Ask users for consent (optional)

When asking users to consent to be tracked, Google Analytics will only start tracking once consent has been given. If no consent is provided, no data will be stored.
To optimize the consent request, you can change the banner text displayed when a publication is opened.

Enabling the option to ask for consent first:
09

 

Preview of the consent banner:
10-1