Google Tag Gateway (GTG)

Google Tag Gateway (GTG) is a feature in Google Tag Manager that changes how Google tags (e.g. gtm.js and gtag.js) are loaded on your website. Once successfully configured, Google tags will be routed through your organization's content delivery network (CDN) provider via a subdomain that you configure (e.g. tags.yourdomain.com).

These tags will be served from your own domain as first-party scripts rather than from googletagmanager.com so that they are less likely to be blocked by browsers and extensions that restrict third-party domains. In this article, we will cover:


Prerequisites

Before continuing with the steps included in this article, please ensure that your website meets the following criteria:

  • Google Tag Manager container
  • Google Tag Gateway compatible CDN or load balancer

Enable Google Tag Gateway (GTG)

  Note: Additional information on enabling Google Tag Gateway is available here.

Google Tag Gateway is enabled directly from your organization's Google Tag Manager account for each respective container.

Navigate to Google Tag Manager and select a container from your organization's list. 

Screenshot_2026-09-14_at_9_13_07 AM.jpg

Click the Admin tab for the selected container.

From the Admin page of the container, navigate to the right-hand card and select Google tag gateway.

Review the introduction and follow the provided steps to check and configure a platform (e.g. content delivery network or load balancer) that your website utilizes and is compatible with Google Tag Gateway.

Once a compatible platform is configured, Google tag gateway will be set to Active.

  Note: Your organization can check if Google tag manager is active on its website by opening the browser's developer tools and navigating to the Network tab. Search for the gtm.js request and ensure that they are served from a subdomain of your own domain instead of googletagmanager.com.


Google Consent Mode v2 signal verification with GTG

The Sourcepoint Consent Management Platform (CMP) checks whether your organization's Google Consent Mode v2 signals are correctly set and respond to end-user selections on its pages.

When Google Consent Mode v2 and Google Tag Gateway are both configured on the same website Sourcepoint will check the following:

Check Description
Default Google consent types

Check if the following Google Consent Mode v2 consent types are present in the dataLayer:

  • ad_storage
  • analytics_storage
  • ad_user_data
  • ad_personalization
Google consent type status change Check if the consent status for Google Consent Mode v2 consent types reflect the selections made by the end-user on purposes in the consent notice
Google Consent Mode v2 mode Check whether the Google Consent Mode v2 integration is leveraging Basic or Advanced mode
Consent initialization order

Check that end-user consent is set before tags are fired. 

  Note: Google Tag Gateway can cause tags to fire prematurely before end-user consent is set regardless of whether Google Consent Mode v2 is integrated into the consent notice or not. 

While this issue is not specific to Google Consent Mode v2, the Sourcepoint compliance scanner can only warn against late consent while using Google Tag Gateway and Google Consent Mode v2 together to compare signal timing.


Resolve late consent warning

A late consent warning from the Sourcepoint on a website where Google Tag Gateway and Google Consent Mode v2 is enabled indicates that Google tags are executing before end-user consent has been set. In this section, we will cover how to diagnose and resolve the Sourcepoint warning regarding a late consent.

Validation

Sourcepoint has developed a debugging function that your organization can utilize in your property's source code or through your browser console. 

window._sp_.gcm.detectLateConsent()

When run, the function will scan your Google Tag Gateway and Google Consent Mode v2 implementation and return one of the following responses:

Response Description
No late consent detected No action is needed. Consent is correctly initialized before Google tags fire.
No integration detected - implementation check needed No dataLayer or GTM integration was found. Check that your Google tag setup is loading correctly.
Late consent detected - fix needed: Google tags are firing before consent is initialized. Review your setup and visit the Resolution section below for more information

Resolution

In order to remediate a late consent warning your organization will need to ensure correct consent signal timing with Google Tag Manager. There are two methods to remediate this issue depending on your CDN provider and setup:

  Note: If your organization utilizes Google Consent Mode v2 (Basic), it is recommend to enable DTCs (Data Transmission Controls) alongside either method below. DTCs limit what behavioral and configuration data Google receives when end-user consent is not yet established.

Deactivate Cloudflare "Setup the tag"

If your organization leverages Cloudflare as your Google Tag Gateway CDN provider, deactivating the Setup the tag feature deactivates CDN-level automatic script injection. When deactivated, script will load only via your on-page <script> tags so that the order your organization defines in your HTML will be respected.

This solution is a low-effort fix for Cloudflare customers who already have Sourcepoint loading before their Google Tag Manager script in the website's <head> tags.

  1. Navigate to Cloudflare's Google Tag Gateway configuration and deactivate the Setup the tag (or equivalent automatic injection) setting
  2. Confirm that Didomi script tag is placed before the Google Tag Manager container script in the website's <head> tag.
  3. Verify the load order resolves the Sourcepoint warning
Manual Google Tag Gateway configuration

This remediation method configures Google Tag Gateway manually without utilizing your organization's CDN provider's automated tag injection. In order to perform this configuration, you will set up the subdomain routing yourself and update your gtag snippet to load from your first-party endpoint. (e.g. <script async src="/metrics/">).

This solution is a high effort fix for a publisher who wants maximum control over load order and is comfortable with custom CDN configuration.

  1. Set up CDN routing rules manually for your tag.yourdomain.com subdomain
  2. Update gtag or gtm snippet to reference the first-party endpoint
  3. Load Sourcepoint before the Google Tag Manager script, or use an async loader that initializes Sourcepoint first
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.