Google Consent Mode
Our integration with Google Consent Mode is enabled by default. We provide a mapping of our tracking purposes (Functional
, Analytics
and Advertising
, SaleOfInfo
) into Google Consent Mode purposes, and our integration will automatically update Google Consent Mode whenever consent changes.
In addition to our documentation, we also recommend reviewing Google's Consent Mode Quickstart documentation.
There are a few different ways to load our Consent Manager, but the following are the most straightforward options:
- (Recommended) Manually load
airgap.js
alongsidegtag.js
- Load
airgap.js
via GTM Template
Copy the airgap.js
code snippet from the Developer Settings > Installation page and paste it in the <head>
tag section of your site, making sure to place it before any tracker scripts. The only extra step you'll need to do if you're manually loading both gtag.js and airgap.js is to make sure to include the developer ID gtag('set', 'developer_id.dODQ2Mj', true)
. Your HTML should look something like this:
<script data-cfasync="false" src="https://transcend-cdn.com/cm/3ab8ffa2-bc84-490c-9929-e099b6561bbf/airgap.js" ></script> <script async src="https://www.googletagmanager.com/gtag/js?id=G-MW89GEZ3BW" ></script> <script> window.dataLayer = window.dataLayer || []; function gtag() { dataLayer.push(arguments); } gtag("js", new Date()); gtag("config", "<YOUR_GTM_ID>"); gtag('set', 'developer_id.dODQ2Mj', true); </script>
If you can't easily modify your site code, you can also load airgap.js
via a GTM Template. Don't forget to also include the Transcend Google Developer ID in your gtag template: gtag('set', 'developer_id.dODQ2Mj', true)
.
To load airgap.js via GTM, you should create a new GTM template. This can be done in a few simple steps:
-
In the Info tab, enter
Transcend Consent
for the Name andLoads the Transcend Consent script to collect & enforce user consent.
for the Description. -
Select the Fields tab, click Add Field > Text Input. Change the name to
BUNDLE_ID
. -
Select the Code tab, and copy the following code snippet. All this does is load the airgap.js script. Once airgap.js is loaded, it will automatically communicate with GCM and set the default consent state, so you do not need to do that here. Default purposes can already be configured via your Regional Experiences page, and
airgap.js
will take care of communicating these defaults to GCM. You do not need to write any additional code or set any additional configuration inside GTM. Should you wish to set default consent state prior to airgap.js loading, because there may be other trackers or tags loaded at the same time/using the same trigger as airgap.js, please refer to this guide.
const injectScript = require('injectScript'); if (data.BUNDLE_ID) { const URL = 'https://transcend-cdn.com/cm/' + data.BUNDLE_ID + '/airgap.js'; injectScript(URL); data.gtmOnSuccess(); } else { log('Cannot load Transcend Consent -- missing BUNDLE_ID.'); data.gtmOnFailure(); }
- Click on Permissions, you should see an entry for
Inject Scripts
. Paste the following into the text input:
https://transcend-cdn.com/cm/*/airgap.js
-
Save the template!
-
Trigger the tag on the
Consent Initialization - All Pages
trigger, and make sure to specify your bundle ID, which you can find in the Developer Settings page.
Google Consent Mode can be configured as Basic
or Advanced
. For a detailed description of both, please refer to the official Google documentation.
In Basic mode, Google tags are blocked until user consent is given. When consent is denied or not yet given, no data is transferred to Google at all -- not even the consent status. Google tags are completely blocked from firing. In Advanced mode, Google tags load when a user opens the website or app. The tags load the Consent Mode API in order to send default consent states and any subsequent updated consent states. When consent is denied or not yet given, the Google tags will send cookieless pings. Once user grants consent to data collection, Google tag will send the full measurement data.
To implement Basic Google Consent Mode, simply tag all data flows associated with Google services with a non-Essential tracking purpose (e.g. Analytics
for Google Analytics or Advertising
for Google Advertising).
To implement Advanced Google Consent Mode, simply tag all data flows associated with Google services with the Essential
purpose.
Once you have finished tagging all the data flows in your Triage tab, don't forget to click Review Changes & Publish...
so that those changes can take effect on your site!
Our default consent mapping with Google Consent Mode is as follows:
Analytics
→analytics_storage
Advertising
→ {ad_storage
,ad_user_data
,ad_personalization
}Functional
→ {functionality_storage
,personalization_storage
,security_storage
}SaleOfInfo
→ads_data_redaction
(enabled when 'tracker overrides trigger purpose' is unconsented andGoogleAdsRDP
integration is enabled)
This mapping can be reconfigured for airgap.js versions 8.33.0 and later. In order to configure a specific parameter, set that parameter's associated trigger purposes (or force-enable the parameter) through the data-tracker-overrides
script attribute. The following example sets the trigger purposes for analytics_storage
to SaleOfInfo
and Analytics
:
data-tracker-overrides="[...] GoogleConsentMode:analytics_storage=SaleOfInfo,Analytics"
In order to force-enable a parameter, set its associated trigger purposes to on
. The follow example does this for analytics_storage
:
data-tracker-overrides="[...] GoogleConsentMode:analytics_storage=on"
In order to disable Google Consent Mode, you can simply leave it out of the list of data-tracker-overrides
, or specify "off"
as the value to disable all third party integrations:
data-tracker-overrides="off"
If you use both Google Consent Mode and TCF, please see our TCF setup guide. Our TCF implementation integrates with GCM by default. If you wish to disable the TCF integration with GCM, please contact our support team. For more integration on how the TCF integration maps TCF Purposes to Google Consent Mode purposes, please review this documentation.
Your Transcend Consent instance will have some default user experiences already configured for different regions. These can be found at the Regional Experiences page. Please review these with your business partners (e.g. marketing, legal teams) to make sure that it is appropriate for your business and legal needs.
To confirm that consent mode is set up correctly, please refer to this official guide provided by Google. You will need to install the Tag Assistant plugin.
If you have any questions about this implementation guide, please don't hesitate to contact our Transcend Support team!