Cloudflare, the firm famous for its anti-DDoS service, has announced the availability of three new features on its relatively new Web Analytics solution. The company said that Web Analytics now supports adding multiple websites to an account, support for Single Page Applications (SPA) has been added, and Core Web Vitals can now be viewed by users. These three features were among the most requested features by the Cloudflare community.
When Web Analytics was launched back in December, each account was able to measure data for just one website. With today’s update, each account will now be able to measure up to 10 websites. You can add a new website via the Cloudflare Dashboard by selecting ‘Add site’ in the Quick Actions menu.
With this new feature, you can view analytics on a per-website basis or you can select ‘View Web Analytics for all sites’ on the Web Analytics overview page to see data from all your websites in one place. If you want to further refine this data you can apply filters using site tags.
Another new feature, support for Single Page Applications, saw Cloudflare adjust how it reports site metrics. A Single Page Application dynamically rewrites the current page but Cloudflare’s product only collected data each time a page was loaded. It has now adjusted this so that it collects data every time there are changes to the SPA. One limitation in Cloudflare’s Web Analytics is that it still doesn’t support hash-based routers (using a # in the URL bar to designate different parts of a web page) but it could land in a future update to SPAs.
To add a SPA to your Web Analytics, you must select ‘Enable measuring single-page application’ when you’re adding your website to Web Analytics. This will generate a JavaScript snippet that enables the SPA feature which you will copy into your website. You’ll be able to differentiate SPA JavaScript because it will contain "spa": true
in the data attribute of the script
tag.
The final addition to Web Analytics is Core Web Vitals. This feature allows you to see Core Web Vitals metrics on the same dashboard as Visits and Page Views so you can see how good your website’s performance is and see where things could be improved.
Going forward, Cloudflare plans to more closely integrate this product with the rest of its products to give users better information about performance, security, and traffic. It will also add new features including alerts and real-time updates in subsequent versions.