Track User Actions With GTAG

Admin access or Domain access to property (property group) with feature access to vendor list management.

Depending on which Google products your organization utilizes, Google tags (GTAGs) will enable you to track user actions for advanced analytics, conversion measurement, remarketing, etc... In this article we will cover the following steps to implement GTAGS on your property and track user actions:

Use case: In some cases, you may want to configure the behavior of your tags based on the consent granted by your end-users (e.g. turning off analytics by not firing a tag when your users do not give you permission to use their data for analytics). This enables your tags to get the best quality data without using mechanisms that do not align with your users' consent.

Vendor Availability

Tracking end-user actions using GTAGs is available for the following vendors on your GDPR TCF v2 Vendor List:

  • Google Tag Manager

  • Google Ads

  • Floodlight

  • Google Analytics

  • Conversion Linker

Retrieve GTAG from Google Account

Navigate to your Google account for a desired Google product and retrieve your GTAG. For example, the GTAG for Google Analytics can be found by navigating to Admin > Tracking Info > Tracking Code.

Copy the GTAG to your clipboard.

Add GTAG to Property and Set Default GTAG Values

Navigate to your property and add the GTAG onto the page. The GTAG is comprised on two parts:

  • A script that loads the GTAG library

  • Default GTAG values code snippet

With the GTAG added to the property, you will need to edit the default GTAG so that it conforms to the following:

//edit default GTAG values
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('set', 'developer_id.PUBLISHER_DEVELOPER_ID', true);
gtag('consent', 'default', {
'ad_storage': 'denied',
'analytics': 'denied',
});
gtag('js', new Date());
gtag('config', 'UA-INSERT-ID-HERE');

GTAG Developer Id

• The developer_id is only needed on properties that call the GTAG API to set the consent state, properties that utilize TCF v2 do not need to include the developer_id since Sourcepoint receives the CMP_id through the TC String. • If a developer_id is required, this code should be placed after dataLayer initialization and before consent update calls. • The developer_id should be set on every page since the configuration is not persistent across pages.

Add GTAG Code Snippet to Vendor List

Admin access or Domain access to property (property group) with feature access to vendor list management.

In this section, we will cover how to add the GTAG code snippet to a GDPR TCF v2 Vendor List.

Alternatively, navigate along the following pathways to add a vendor tag (vendor pixel) to a vendor on a GDPR non-TCF or CCPA Vendor List:

  • GDPR > Non IAB > Edit

  • CCPA > Vendor List > Edit

Navigate to your Sourcepoint account and click GDPR from the top navigation bar. Select TCF v2 from the dropdown menu.

Navigate to a Vendor List on the subsequent list and click Edit.

Ensure that Google is added as a vendor in the vendor list.

Click the appropriate vendor from the list.

To track user consent with GTAGs, add the following GTAG code snippet to Consent Actions (ensure the Google purposes in the snippet are set to granted):

window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('set', 'developer_id.PUBLISHER_DEVELOPER_ID', true);
gtag('consent', 'update', {
'ad_storage': 'granted',
'analytics_storage': 'granted',
});
gtag('js', new Date());
gtag('config', 'UA-INSERT-ID-HERE');

Reject Actions

To track reject actions with GTAGs, add the following GTAG code snippet to Reject Actions (ensure the Google purposes in the snippet are set to denied):

window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('set', 'developer_id.PUBLISHER_DEVELOPER_ID', true);
gtag('consent', 'update', {
'ad_storage': 'denied',
'analytics_storage': 'denied',
});
gtag('js', new Date());
gtag('config', 'UA-INSERT-ID-HERE');

Test GTAG Configuration

To test your GTAG configuration for a property, check your datalayer of the browser to confirm that the consent toggle is set to On or Off as you give and reject consent for purposes.