If you use Cloudflare as your content delivery network (CDN), you can set up Google tag gateway for advertisers in the Google tag by integrating with your Cloudflare account. The integration with the Google tag 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 a Google tag 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 have the Google tag (for example, G-123, AW-456) running on your website.
- Sign in to your Cloudflare account and grant permissions to Google to set up Google tag gateway for advertisers.
- 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.
Set up Google tag gateway for advertisers
Step 1 of 3: Open the Google tag settings
Google Ads instructions
To access your Google tag settings from your Google Ads account:
- In your Google Ads account, click the Tools icon
.
- Click Data manager.
- Under “Google tag”, click Manage, then go to Admin.
Google Analytics instructions
- In your Google Analytics account, go to the
Admin screen.
- In
Data streams, click a stream to see details.
- Click Configure tag settings, then go to Admin.
Campaign Manager 360 instructions
- Open your Campaign Manager 360 advertiser.
- In the left menu, select Data manager under “Floodlight”.
- On the “Data manager” page, select Manage under the “Google tag” section.
- In the “Google tag” settings panel, go to Admin.
Google Tag Manager instructions
- In your Google Tag Manager account, click the Google tags tab to see Google tags you've previously set up.
- Note: To see Google tag IDs in Google Tag Manager, you need to manage a Google Ads, Analytics or Google tag in a container.
- Click the tag name to edit the Google tag settings.
Step 2 of 3: Choose your CDN platform
- In Admin, 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 3 of 3: 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, 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.
- 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 through manual configuration or using Cloudflare, an “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 3 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 manually.
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 interface.
If your Cloudflare account is undetected or incompatible, you can set up Google tag gateway for advertisers manually.
When to re-tag your website
- If you use consent mode, you must turn off automated script set up. You should also disable this feature if you prefer to manually tag your site to maintain control over your code and its placement.
- The tag installation options below are available on the CDN’s website. It’s recommended that if you’re setting up a tag for the first time to enable “Set up tag”.
When you set up Google tag gateway for advertisers, the need to manually re-tag your website depends on whether you use the automated or guided setup. Regardless of the method you use, the end goal is for your website's scripts to point to your new measurement path.
Automated setup
The automated setup method configures your scripts automatically. You don’t need to manually re-tag your website’s code. When automated set up is active, the platform inserts the new scripts into your HTML when there are no tags on your pages, which usually happens if you’re setting up tags on your website for the first time.
If you check your page using View Page Source, the script source will display correctly, even if your original server files still point to googletagmanager.com.
Guided setup
If you use the guided or self-service setup method, you must manually re-tag your site. You need to replace every instance of the existing Google tag script source with your new measurement path on all relevant pages of your website.
If this step is skipped, the browser will continue to request scripts directly from Google, bypassing Google tag gateway for advertisers entirely.
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 and remove the Google tag gateway for advertisers configuration.