启用 Web Analytics
Cloudflare Web Analytics provides free, privacy-first analytics for your website without changing your DNS or using Cloudflare’s proxy. Cloudflare Web Analytics helps you understand the performance of your web pages as experienced by your site visitors.
All you need to enable Cloudflare Web Analytics is a Cloudflare account and a JavaScript snippet on your page to start getting information on page views and visitors. The JavaScript snippet (also known as a beacon) collects metrics using the Performance API, which is available in all major web browsers.
在 Pages 项目上启用
Cloudflare 页面提供一键式Web Analytics设置:
1.登录 Cloudflare 仪表板。 2.从 “账户主页”,选择 “Workers & Pages"。 3.在概览中,选择你的页面项目。 4.进入 Manage> Web Analytics> 并选择 Enable Web Analytic。
Cloudflare 将在下一次部署时自动将 JavaScript 代码段添加到你的页面网站。
查看指标
查看与页面项目相关的指标:
- 登录 Cloudflare 仪表板。
- 从账户主页,选择 分析和日志> 网络分析。
- 选择与页面项目相关的分析。
有关如何使用网络分析的详细信息,请参阅 网络分析文档。
疑难解答
For Cloudflare to automatically add the JavaScript snippet, your pages need to have valid HTML.
For example, Cloudflare would not be able to enable Web Analytics on a page like this:
For Web Analytics to correctly insert the JavaScript snippet, you would need valid HTML output, such as: