Set up first-party mode in Google Tag Manager with Cloudflare (beta)

Experiment icon for Gradual feature rollout Gradual feature rollout: This feature is not yet available for all Google Tag Manager users.

If you use Cloudflare as your content delivery network (CDN), you can set up first-party mode 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 first-party mode?

First-party mode 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, first-party mode 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 first-party mode.

How to set up first-party mode

  1. In your Google Tag Manager container, go to Admin and select First-party mode.First-party mode setup in Google Tag Manager first step
  2. In the "First-party mode" screen, click Continue.First-party mode setup in Google Tag Manager second step
  3. Confirm your measurement path. If you need to customize your measurement path, choose a path that's not already in use on your website.
  4. Click Sign into Cloudflare to log in to your Cloudflare account.
  5. After successfully logging in, all websites with first-party mode enabled will be listed.
  6. Click Complete setup.

Results

After you successfully set up first-party mode in Google Tag Manager using Cloudflare, an "Active" status will display next to each website domain where first-party mode is running.

If you want to enable first-party mode for each domain, 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 first-party mode from the Cloudflare interface instead of the Google Tag Manager interface.

If your Cloudflare account is undetected or incompatible, you can set up first-party mode manually.


Validate the first-party mode set up from Tag Assistant

You can confirm if your first-party mode 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 first-party mode

  1. In the "First-party mode" screen, click Configure.
  2. Click Pause to deactivate first-party mode in Cloudflare.
  3. Click Delete to detach Cloudflare from your Google Tag Manager container and remove the first-party mode configuration.
Note: Deleting the first-party mode configuration in your Google Tag Manager right away doesn’t disable first-party mode in Cloudflare. Click Pause to disable the feature before deleting. After first-party mode is deleted, you can set it up again with a new Cloudflare account.

Was this helpful?

How can we improve it?
Search
Clear search
Close search
Main menu
9248118072554474668
true
Search Help Center
true
true
true
true
true
102259
false
false
false
false