试用 Google Analytics 的 MCP 服务器。从
GitHub 安装,并参阅
公告了解详情。
适用于网站的 Google Analytics
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本页介绍了 Google Analytics 网站版,以及开始使用该产品所需完成的操作。
Google Analytics 会衡量事件,帮助您了解自己的效果。例如,您可以使用 Google Analytics 来衡量网站流量、获取有关受众群体的数据洞见,以及了解他们与您网站的互动情况。
设置账号
下面简要介绍了设置 Google Analytics 账号以收集数据的步骤:
- 如果您还没有 Google Analytics 账号,请创建一个。
- 创建账号后,创建新媒体资源。
媒体资源就像是用于存放所收集数据的容器。
- 创建新媒体资源后,添加一个网络数据流,用于将您网站中的数据发送到该媒体资源。
为您的网站添加代码
拥有包含网站数据流的 Google Analytics 账号后,您就可以为网站添加代码并开始收集数据了。
我们建议您使用 Google 跟踪代码管理器。借助跟踪代码管理器,您可以更改代码配置并自动将其推送到您的网站,而无需每次都更改代码。
如需了解其他代码植入选项,请参阅 Google Analytics 代码植入。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-04。
[null,null,["最后更新时间 (UTC):2025-08-04。"],[],[],null,["# Google Analytics for websites\n\nThis page explains Google Analytics for websites, and what you need to do to get\nstarted.\n\nGoogle Analytics measures events to help you learn about your performance. For\nexample, you can use Google Analytics to measure web traffic, insights about\nyour audience, and how they interact with your website.\n| **Tip:** Before you begin, read about the [tagging options for\n| developers](/analytics/devguides/collection/ga4/tag-options).\n\nSet up your account\n-------------------\n\nHere's an overview of the steps to set up your Google Analytics account for data\ncollection:\n\n1. If you don't already have one, [create a Google Analytics\n account](//support.google.com/analytics/answer/9304153#account).\n2. After creating an account, [create a new\n property](//support.google.com/analytics/answer/9304153#property&zippy=%2Cweb). Properties are like containers that hold the data you collect.\n3. Once you've created a new property, [add a web data stream](//support.google.com/analytics/answer/9304153#stream&zippy=%2Cweb) that sends the data from your website to the property.\n\nTag your website\n----------------\n\nOnce you have a Google Analytics account with a web data stream, you're ready to\ntag your site and start collecting data.\n\nWe recommend that you [use Google Tag\nManager](//support.google.com/tagmanager/answer/14842164). With\nTag Manager, you can make changes to your tagging configuration and push them to\nyour site automatically, without needing to change your code every time.\n\nFor information on other tagging options, see [tagging\nfor Google Analytics](/analytics/devguides/collection/ga4/tag-options)."]]