Google tag gateway arrives on Cloudflare
Most sites that run advertising or analytics rely on Google tags—a single snippet that can push events to destinations like Google Analytics and Google Ads. Traditionally, that payload is served directly from Google's domain, which can drag on performance and distort measurement. Google's answer, server-side tagging, required running a separate server with all the cost and upkeep that entails.
Cloudflare is now launching as Google's integration partner for the Google tag gateway for advertisers, offering many of the benefits of server-side tagging without the additional infrastructure. Any domain proxied through Cloudflare can serve Google tags directly from that domain, and early testers saw an average 11% uplift in data signals. The feature is available to all customers on any Cloudflare plan at no extra charge.
A one-click setup for first-party tags
Previously, serving first-party tags from your own domain demanded a complex configuration: a CNAME record for a new subdomain, an Origin Rule to forward requests, and a Transform Rule to pass geolocation data. This integration collapses that into a single action by leaning on Cloudflare's role as a reverse proxy.
Site owners can enable the feature in either the Google tag console or the Cloudflare dashboard. In the Google tag console's Admin settings, you'll find an option to connect your Cloudflare account and configure your measurement ID directly in Google, which then pushes the config to Cloudflare. If you already have a tag snippet on your page, no changes to that snippet are required.
Alternatively, with your tag ID and admin access to your Cloudflare account, you can enable the feature and edit the measurement ID and path directly from the Cloudflare dashboard.
How the first-party proxy works
Once enabled, requests to Google's measurement servers from your website are intercepted and re-routed through your own domain. Instead of the browser requesting the tag script from www.googletagmanager.com, the request goes through a path like www.example.com/metrics, making it appear as a first-party request.
Cloudflare sits in the middle of these transactions. When a browser requests https://example.com/gtag/js?id=G-XXXX, Cloudflare intercepts the request, rewrites the path to the original Google endpoint, preserves all query-string parameters, and normalizes the Origin and Referer headers to match Google's expectations. It fetches the script in the background from Google's servers and serves it to the end user's browser from your domain. All subsequent measurement payloads route through the same first-party proxy to the appropriate Google collection endpoints.
Cookie attribution changes
This setup also changes how cookies are stored. Typically, a cookie is a small text file that a website asks the browser to store, allowing the site to recognize a user's browser across visits. When the tag script is delivered from your own domain, the browser also sets any cookies under your website's domain. This means the entire tag lifecycle—delivery, execution, and cookie storage—stays within your first-party infrastructure.
Documentation and setup instructions are available on Cloudflare's developer site. You can also enable it by logging into the Cloudflare dashboard, navigating to the Engagement tab, and selecting Google tag gateway.



