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
- In your Google Tag Manager container, go to Admin and select Google tag gateway.
- In the "Google tag gateway" screen, select Continue.
- Enter your website URL in the "Scan your site" field and select Scan.
- Confirm Cloudflare is selected in the scan results.
- Select Continue.
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.
- 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.
- Select Sign into Cloudflare to log in to your Cloudflare account.
- Select Your website domains will be activated.
- 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.
- 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:
- 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
- On the "Set up and complete" screen, select the More ways to set up drop-down.
- Select Guided.
- Follow the self-service instructions to serve your tag in Google tag gateway for advertisers.
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.
- In the "Set up and complete" screen of the Guided option, select Open extension.
- Tag Assistant will prompt you to enter your website URL if you haven’t provided one yet. Enter your website URL and select Next.
- Sign in to your Cloudflare account when prompted.
- Select your domain in the "Websites" screen.
- In the Tag Assistant panel, select Start to create a new snippet.
- From the Tag Assistant panel, copy and paste the snippet name into the "Create Snippet" field and the code into the "snippet.js" file.
- Select Next in the Tag Assistant panel.
- In the Cloudflare panel, select the Snippet rule button, then Edit expression.
- Copy and paste the expression provided in the Tag Assistant panel into the "When incoming requests match" field, then select Done.
- Select Next in the Tag Assistant panel and review your settings.
- Select Deploy in the Cloudflare panel.
- Select Next in the Tag Assistant panel to run health checks.
- 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:
- Ensure that your Google Tag Manager container has at least one tag that fires.
- Open Tag Assistant and enter your website URL to create the connection.
- Navigate through your website to trigger tags.
- In the Summary > Output > Hits Sent tab, verify that the hits are routed to your measurement path.
Deactivate Google tag gateway for advertisers
- In the "Google tag gateway" screen, click Configure.
- Click Delete to detach Cloudflare from your Google Tag Manager container and remove the Google tag gateway for advertisers configuration.