Web Analytics
Cloudflare offers a privacy-first, free Web Analytics service that you can easily integrate with your Nextra site.
Why Cloudflare Web Analytics?
- Privacy: Does not use cookies or track personal data.
- Performance: Extremely lightweight and runs on the edge.
- Free: Included with your Cloudflare account.
How to Enable
- Go to your Cloudflare Dashboard.
- Navigate to Web Analytics.
- Click Add a site.
- Enter your domain (e.g.,
my-nextra3.pages.dev). - You will get a JS snippet, but if you are using Cloudflare Pages, you don’t even need the snippet!
Automatic Setup for Pages
- Go to your Pages Project setting.
- Select Settings > Web Analytics.
- Click Enable Web Analytics.
That’s it! Cloudflare will automatically inject the necessary lightweight script into your pages at the edge. No code changes required.