本文档适用于希望以第一方模式部署 Google 代码的用户。我们建议您使用第一方模式,以实现最持久的代码配置。
概览
借助第一方模式,您可以使用托管在您网站网域上的自有第一方基础架构部署 Google 代码。此基础架构位于您的网站和 Google 服务之间。本文档中的设置有助于您更好地衡量网站。您可以使用现有的内容传送网络 (CDN)、负载平衡器或 Web 服务器进行设置。
在标准 Google 代码设置中,您的网页会从 Google 网域请求 Google 代码。代码触发后,会直接向 Google 产品发送衡量请求。在第一方模式下,您的网站会从您的第一方网域加载 Google 代码。代码触发后,会向您的第一方网域发送衡量请求,这些请求会转发到相关的 Google 产品。
[null,null,["最后更新时间 (UTC):2025-02-04。"],[[["This guide provides instructions for deploying the Google tag in first-party mode, offering a more durable and potentially better-performing tag configuration."],["First-party mode involves hosting the Google tag on your own domain, mediating data flow between your website and Google services."],["Your existing CDN or load balancer can be used to forward requests, and the guide assumes you already have a Google tag or Tag Manager container setup."],["Two setup options are available: manual setup or automated setup using Cloudflare."],["Testing involves verifying that event hits are correctly routed through your domain using Tag Assistant."]]],[]]