Custom domain with Cloudflare Pages: web analytics integration

Hello!

First, I want to thank you for the great product you are building!

I just setup up my blog on Cloudflare Pages (https://vandevoorde.me) and I wanted to use Web Analytics to get some stats on the my website. To do so, I enabled the support of Web Analytics in my Cloudflare Page settings.

It created an entry for dev-xxx.pages.dev in the Web Analytics portal. As my website is built with Gatsby (SPA), I had to add the on the client-side to get proper analytics.

The problem now is that the request is being blocked by CORS since my website is https://vandevoorde.me and not dev-xxx.pages.dev. The current solution I found was to create a new analytics project for vandevoorde.me but it would be much easier if web analytics could support multiple domains or the CORS is properly configured to allow both dev-xxx.pages.dev and vandevoorde.me.

I hope this is clear :slight_smile:

Thanks a lot,
Charles Vandevoorde