Set up Google tag gateway for advertisers in Google Tag Manager with Cloudflare

If you use Cloudflare as your content delivery network (CDN), you can set up Google tag gateway for advertisers in Google Tag Manager by integrating with your Cloudflare account. The integration with Google Tag Manager enables you to gain greater control over your data, improving the accuracy of your Google Analytics reporting and driving conversions uplift.

What is Google tag gateway for advertisers?

Google tag gateway for advertisers allows you to deploy Google scripts using your own domain, enhancing data privacy and improving signal measurement recovery. Unlike standard setups where tags are requested from a Google domain, Google tag gateway for advertisers loads the tag from your domain and sends measurement events to your domain, where they are forwarded to Google.

Before you begin

  • You must have a Google Tag Manager container installed on your website.
  • Sign in to your Cloudflare account and grant permissions to Google to set up Google tag gateway for advertisers.
  • Your Cloudflare dashboard user must have one of the following account roles: Super Administrator, Administrator, or Zaraz Admin. If you are using domain scoped roles, your domain role must be Domain Administrator.
  • Enabling this feature affects Google tag firing behavior. If your current tag behavior is impacted by user consent actions, adopt Consent Mode, and review your consent settings to ensure your preferences are respected. Learn more About consent mode.

How to set up Google tag gateway for advertisers

Step 1 of 2: Choose your CDN platform

  1. In your Google Tag Manager container, go to Admin and select Google tag gateway.Google tag gateway setup in Google Tag Manager first step
  2. In the "Google tag gateway" screen, select Continue.
  3. Enter your website URL in the "Scan your site" field and select Scan.
  4. Confirm Cloudflare is selected in the scan results.
  5. Select Continue.
Note: The "Scan your site" field may be pre-populated with a domain known to host the tag. Only detected CDN platforms are displayed in the scan results. To view and choose other CDN platforms, select Show all platforms.

Step 2 of 2: Complete your setup

Use either of the following options to complete the setup of Google tag gateway for advertisers:

Automated option

The Automated option allows you to automatically complete the setup of Google tag gateway for advertisers through an in-UI integration with your CDN. This option is selected by default.

  1. On the "Set up and complete" screen, confirm your measurement path.
    • Note: If you need to customize your measurement path, choose a path that's not already in use on your website.
  2. Select Sign into Cloudflare to log in to your Cloudflare account.
  3. Select Your website domains will be activated.
  4. In the "Choose website domains" panel, choose the domains you want to activate and select Done.
    • Note: Closing the "Choose website domains" panel without selecting Done will reset the changes that you’ve made.
  5. Select Complete setup.

After completing the setup, you'll be redirected to the "Google tag gateway" screen. You'll notice that the status will be "Active", and the domains will be listed. The domains can have different statuses:

Google tag gateway setup in Google Tag Manager second step

  • First-party: The Google tag gateway is active.
  • Not started: The Google tag gateway hasn't been activated yet.
  • Paused: The Google tag gateway is paused.
  • Pending: The Google tag gateway is enabled, but no diagnostic information has been received yet.

To close the window, select Done.

Guided option

The Guided option allows you to manually complete the setup of Google tag gateway for advertisers by following a set of self-service instructions in the interface, or by using Tag Assistant.

Access the self-service instructions

  1. On the "Set up and complete" screen, select the More ways to set up drop-down.
  2. Select Guided.
  3. Follow the self-service instructions to serve your tag in Google tag gateway for advertisers.
Note: The self-service instructions for the Guided option vary depending on the CDN you select.

Use Tag Assistant

If you have a Cloudflare Pro plan or higher, you can set up Cloudflare Snippets through Tag Assistant to deploy Google tag gateway for advertisers.

  1. In the "Set up and complete" screen of the Guided option, select Open extension.
  2. Tag Assistant will prompt you to enter your website URL if you haven’t provided one yet. Enter your website URL and select Next.
  3. Sign in to your Cloudflare account when prompted.
  4. Select your domain in the "Websites" screen.
  5. In the Tag Assistant panel, select Start to create a new snippet.
  6. From the Tag Assistant panel, copy and paste the snippet name into the "Create Snippet" field and the code into the "snippet.js" file.
  7. Select Next in the Tag Assistant panel.
  8. In the Cloudflare panel, select the Snippet rule button, then Edit expression.
  9. Copy and paste the expression provided in the Tag Assistant panel into the "When incoming requests match" field, then select Done.
  10. Select Next in the Tag Assistant panel and review your settings.
  11. Select Deploy in the Cloudflare panel.
  12. Select Next in the Tag Assistant panel to run health checks.
  13. Follow the instructions to re-tag your website and verify if Google tag gateway for advertisers is working correctly.

Results

After you successfully set up Google tag gateway for advertisers in Google Tag Manager through self service configuration or using Cloudflare, the “Active” status will be displayed. This indication will appear next to each website domain where Google tag gateway for advertisers is running.

You can manage the domains after you’ve enabled Google tag gateway for advertisers. In the Google tag gateway configuration screen, select the Manage domains button. All of your domains will be grouped in these 4 sections:

  • Tagged domains: This section shows the domains that already have the current tag.
  • Untagged domains: This section shows the domains that aren’t tagged. If chosen, Google tag gateway for advertisers will add the missing tag automatically.
  • Other active domains: This section shows the domains that are already using Google tag gateway for advertisers with a different tag, activated through Cloudflare, or activated using self service.

Alternatively, you can click Configure in the upper right corner, then click Edit in Cloudflare.

If there was a problem during setup, you’ll be presented with the option to try again. If you continue to receive an error message, you should set up Google tag gateway for advertisers from the Cloudflare interface instead of the Google Tag Manager interface.

If your Cloudflare account is undetected or incompatible, you can set up Google tag gateway for advertisers using self service.


Validate the Google tag gateway for advertisers set up from Tag Assistant

You can confirm if your Google tag gateway for advertisers setup is working correctly by using Tag Assistant.

Verify where the script is loaded from by following these steps:

  1. Ensure that your Google Tag Manager container has at least one tag that fires.
  2. Open Tag Assistant and enter your website URL to create the connection.
  3. Navigate through your website to trigger tags.
  4. In the Summary > Output > Hits Sent tab, verify that the hits are routed to your measurement path.

Deactivate Google tag gateway for advertisers

  1. In the "Google tag gateway" screen, click Configure.
  2. Click Delete to detach Cloudflare from your Google Tag Manager container and remove the Google tag gateway for advertisers configuration.
Note: Deleting the Google tag gateway for advertisers configuration in your Google Tag Manager container will also disable the feature for all active domains. After Google tag gateway for advertisers is deleted, you can set it up again with a new Cloudflare account.
false
Achieve your advertising goals today!

Attend our Performance Max Masterclass, a livestream workshop session bringing together industry and Google ads PMax experts.

Register now

Search
Clear search
Close search
Google apps
Main menu
8110303282142760039
true
Search Help Center
true
true
true
true
true
true
73067
false
false
true
true
false
false