BETA NOTICE: If you're interested in using this beta feature and you're on the Enterprise plan, please reach out to your success manager, who will activate this for you.
In this article you can find simple instructions to setup Universal Analytics tracking using Google Tag Manager. If you haven't connected Google Tag Manager to Publitas yet, check out Setting up Google Tag Manager.
- Step 1: Import Variables, Triggers and Tags into Google Tag Manager
- Step 2: Connect your Google Analytics Property
- Step 3: Connect a cookie banner or anonymize IP addresses (optional)
- Step 4: Configure the custom dimension in Google Analytics
- Step 5: Publish the changes
- Step 6: Start reporting
- How to process future updates
Step 1: Import Variables, Triggers and Tags into Google Tag Manager
- Download the settings attached to this article
- Go to the Admin section of Google Tag Manager
- Select Import Container
- Select the file to import
- Select a workspace
- Select to Merge the selected workspace with content of imported container
- Select Rename conflicting tags, triggers, and variables
- Click Confirm
Wish to update to the latest version?
If you have already installed Universal Analytics before and wish to update your configurations with the latest updates and additions, please read How to process future updates.
Step 2: Connect your Google Analytics Property
There are different ways to connect the publications to Google Analytics. You can create a new property to track your online publications only, you can use the same property that is also tracking your website, or you can re-use the property that you had connected to Publitas before (using the built-in Google Analytics connection).
Connecting a new property in Google Analytics
- Go to the Variables section of Google Tag Manager
- Locate and edit the CS - UA Property variable
- Update the Value with your Tracking ID
- Click Save
Using the website property to also track the online publications
If you wish to track the publications using the same property that is already tracking your website you can still use the Google Analytics Setting as described above and apply the tracking ID that tracks your website. Do make sure to review the settings and align them with your existing setup.
For example, custom dimensions 1 through 4 are configured by default. If you have already assigned custom dimensions yourself, make sure to assign the dimensions to index numbers that are still available to use.
If you wish to use your own Google Analytics Settings make sure to copy over all relevant settings and update all Tags to refer to the correct Google Analytics Setting variable.
Using a property that is or was connected to Publitas already
In case you wish to use the Google Analytics property which you've already connected to Publitas, follow the steps stated earlier. Afterwards, remove the tracking ID from Publitas to avoid that each pageview and each event gets tracked twice.
Your historic data will remain available, but be aware that the Google Tag Manager based setup uses different event names and you might need to adapt your custom reports and dashboards accordingly.
Disconnecting Google Analytics from Publitas in order to connect Google Analytics via Google Tag Manager:
Step 3: Connect a cookie banner or anonymize IP addresses (optional)
The preset configuration is configured to track your users anytime a publication is viewed and identify unique users based on their IP address. You can chose to ask users for consent before firing any of the tags (e.g. through Cookiebot). You can also have Google Analytics anonymize the IP address to avoid personal data from being stored, in which case it is no longer possible to identify unique and returning users.
To anonymize the IP addresses, locate the UA - Google Analytics Setting variable, edit the Fields to Set and change the value of the anonymizeIp field from false into true.
Configuring Google Analytics to anonymize IP addresses:
Step 4: Configure the custom dimension in Google Analytics
To help create useful reports and dashboards the pageview configuration also sends over the publication name, page number, product name (Gold+) and group name (Enterprise only) to Google Analytics as custom dimensions. These can be used to, for example, filter the data for a specific publication or list the page numbers in your reports.
Use custom dimension in your reports:
- Go to the Admin section of Google Analytics
- Select the correct Google Analytics property (middle column)
- Choose the option Custom Definitions > Custom Dimensions
- Add the following Custom Dimensions in order:
- Publitas - Publication (Scope: Hit)
- Publitas - Page (Scope: Hit)
- Publitas - Product (Scope: Hit)
- Publitas - Group (Scope: Hit)
Adding custom dimensions:
IMPORTANT: If you applied different index numbers to the custom dimension in step 2, make sure that the new custom dimension are connected to the corresponding index numbers in Google Analytics as well.
Step 5: Publish the changes
Once everything is set, you can use the Preview option in Google Tag Manager to validate that all events, pageviews and custom dimensions are firing correctly. If you are happy with the results, click on Submit in Google Tag Manager to publish the tracking configurations and start tracking your publications.
Step 6: Start reporting
Once the setup is completed your publications will be tracked by Google Analytics. It can take up to 24 hours before the results are available in Google Analytics's standard reports. However, you can use the Realtime > Overview report to check whether the connection is working. Simply preview one of the publications found in the connected group and see if your session pops up in the report.
Use the Realtime report to test the connection:
How to process future updates
Over time, more data will be added to the data layer to support tracking new features and even more interactions. We recommend not to change the names applied to the variables, trigger and tags.
You can always find the latest settings attached to this article. By completing step 1 and step 4 again. you can import and processing the latest changes to your tracking setup.
By choosing to Rename conflicting tags, triggers, and variables at step 1.7 you will be able to review each change before applying them to your own setup. If a variable, tag, or trigger in the new container has the same name but the contents are different, you can rename the new one, compare it with the old one and consider whether you want to adopt the latest changes or not. New variables, triggers and tags will be added to your container either way.
If you haven't customized any of the settings since the last time you imported them, you can also choose to Overwrite conflicting tags, triggers, and variables. If a variable, tag, or trigger in the new container has the same name but the contents are different, this will overwrite the old one with the new one. New variables, triggers and tags will be added to your container either way.