本文档面向希望为广告客户部署 Google 代码网关的用户。我们建议广告客户使用 Google 代码网关,以实现最持久的跟踪代码配置。
概览
借助面向广告客户的 Google 代码网关,您可以使用自己的第一方基础架构(托管在您网站的网域中)部署 Google 代码。此基础架构位于您的网站与 Google 服务之间。本文档中的设置将有助于您更好地衡量网站效果。您可以使用现有的内容分发网络 (CDN)、负载平衡器或 Web 服务器进行设置。
在标准 Google 代码设置中,网页会向 Google 网域请求 Google 代码。代码触发时,会直接向 Google 产品发送衡量请求。使用面向广告客户的 Google 代码网关后,您的网站会从第一方网域加载 Google 代码。当代码触发时,系统会使用您的第一方网域向 Google 发送一些衡量请求。
[null,null,["最后更新时间 (UTC):2025-08-01。"],[],[],null,["# Set up Google tag gateway for advertisers\n\n\u003e This document is for users who want to deploy the Google tag gateway for\n\u003e advertisers. We recommend Google tag gateway for advertisers for the most\n\u003e durable tag configuration.\n\nOverview\n--------\n\nGoogle tag gateway for advertisers lets you deploy a Google tag using your own\nfirst-party infrastructure, hosted on your website's domain. This infrastructure\nsits between your website and Google's services. The setup in this documentation\nwill help you better measure your website. You can set it up using your existing\ncontent delivery network (CDN), load balancer, or web server.\n\nIn standard Google tag setups, your web page requests a Google tag from a Google\ndomain. When the tag fires, it sends measurement requests directly to the Google\nproduct. With Google tag gateway for advertisers, your website loads the Google\ntag from your first-party domain. When the tag fires, some measurement requests\nwill be sent to Google using your first-party domain.\n\nThis diagram represents the information flow in Google tag gateway for\nadvertisers:\n\nBefore you begin\n----------------\n\nThis guide assumes that your website is already configured with:\n\n- A [Google tag](https://developers.google.com/tag-platform/gtagjs) or [Tag\n Manager container](https://support.google.com/tagmanager/answer/6102821).\n- A content delivery network (CDN) or load balancer that can forward requests to external endpoints.\n\nTo get started, pick your setup type.\n\nManual setup Automated setup with Cloudflare\n\nPick pick a setup type to see instructions.\n\nTest the measurement setup\n--------------------------\n\nTo test the measurement setup, configure your container to have at least one\ntag that fires.\n\n1. [Go to Tag Assistant](https://tagassistant.google.com) and preview your container.\n2. Navigate through your website to trigger events.\n3. In the **Summary** \\\u003e **Output** \\\u003e **Hits Sent** tab, verify that the hits\n are routed to `/`\u003cvar scope=\"metrics\" translate=\"no\"\u003emetrics\u003c/var\u003e."]]