I created landing by Pages service and add custom domain for it. Now I see console error on my site:
Access to XMLHttpRequest at 'cloudflareinsights.com/cdn-cgi/rum' from origin 'https://bastionsiege.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Failed to load resource: net::ERR_FAILED cloudflareinsights.com/cdn-cgi/rum:1
Same error is on default domain bastion-siege-site.pages.dev.
I tried to disable web analytics in settings, but nothing happens.
How I can resolve with issue?
If you’ve correctly turned off Web Analytics, then the beacon script shouldn’t be automatically inserted, so double-check that first. Or just uncheck the “disable automatic setup” option.
If you’re certain that automatic analytics is off, next question is, is there any chance you actually copied the beacon code into your HTML, either intentionally or unintentionally? For example, if you saved a copy of your page through a web browser / wget / etc, then that copy would have the beacon code saved in it, and if you put that copy back on your server then it’ll still have the beacon code in it until manually removed.
If you still think Cloudflare is adding the beacon code automatically, one workaround is to add “no-transform” to the cache-control header that your origin server sends. This will tell Cloudflare not to make any modifications to the HTML. I use this trick to selectively remove certain pages from analytics.
Thank you for answer.
It is Web Analytics setting for my site.
I tried to download my site by curl and I see Beacon in code.
About headers – I can’t change it because it is Pages service. I just upload my HTML landing.