Get started
- Log in to the Cloudflare dashboard ↗, and select your account.
- Select the Analytics & Logs drop-down and choose Web Analytics.
- Select Add a site.
- In Set up hostname, write your website’s hostname.
- Select the message box that appears to choose the hostname you have input and select Done.
- Copy the JS snippet from Manage site. This is also where you can later edit the hostname you have just added.
- (Optional) Select View Analytics sites to go back on the Web Analytics interface. If you prefer to continue setting up Web Analytics website, continue reading.
- Add the JS snippet to any of your website’s HTML pages before the ending body tag.
Web analytics is now set up on your website, but it may take a few minutes for Web Analytics data to appear.
Repeat steps 3-7 for all the websites you want to track with Web Analytics by selecting Add a site from Web Analytics. In Web Analytics Sites, select Manage site inside each website’s card to adjust Web Analytics for your site at any time.
For more information on how many sites you can track, refer to Limits.
- Log in to the Cloudflare dashboard ↗, and select your account.
- Select the Analytics & Logs drop-down and choose Web Analytics.
- Select Add a site.
- Select a hostname from the drop-down menu > Done.
Your website is now using Web Analytics through the automatic setup, which is enabled by default.
To set up Web Analytics manually:
- After step 4 (above), expand Advanced options.
- Select Disable automatic setup.
- Copy the JS snippet.
- Add the JS snippet to any of your website’s HTML pages before the ending body tag.
Repeat these steps for all of the websites you want to track with Web Analytics. Web Analytics is enabled by default for sites proxied through Cloudflare that previously used Browser Insights. Adjust Web Analytics for your site at any time by selecting Manage site from Web Analytics.
For more information on how many sites you can track, refer to Limits.
For more information on how to configure which sites or pages you track with Web Analytics, refer to Rules.
Cloudflare Pages offers a one-click setup for Web Analytics:
- Log in to Cloudflare dashboard ↗.
- From Account Home, select Workers & Pages.
- In Overview, select your Pages project.
- Go to Metrics and select Enable under Web Analytics.
Cloudflare will automatically add the JavaScript snippet to your Pages site on the next deployment.