Cloudflare Web Analytics & SPAs

I have followed the instructions for including the JS code for client-side analytics on my dev site already. As expected, this will not load since I used my production subdomain for the URL. However, prior to deploying to production, I am unsure if this will fully work for my SPA where it does not do a page load on each request, only the first. Typically, analytics scripts like Google require a function call to be triggered on route changes, but cannot find anything in the FAQs/docs about this, and briefly running through the script doesn’t show anything obvious.

Since I cannot test this yet, I just want to confirm this will only track the first pages users navigate to or if there is a way to track all route changes. Thanks!

1 Like

I had the exact same issue. We need some way of triggering on javascript based location changes!

Yep, us too. We need a way to trigger “pageview” event from side, since we have SPA

We now support SPA. Please check more detail from our blog post: Enhancing privacy-focused Web Analytics to better meet your metrics needs

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.