
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/">
    <channel>
        <title><![CDATA[ The Cloudflare Blog ]]></title>
        <description><![CDATA[ Get the latest news on how products at Cloudflare are built, technologies used, and join the teams helping to build a better Internet. ]]></description>
        <link>https://blog.cloudflare.com</link>
        <atom:link href="https://blog.cloudflare.com/" rel="self" type="application/rss+xml"/>
        <language>en-us</language>
        <image>
            <url>https://blog.cloudflare.com/favicon.png</url>
            <title>The Cloudflare Blog</title>
            <link>https://blog.cloudflare.com</link>
        </image>
        <lastBuildDate>Wed, 08 Apr 2026 18:58:09 GMT</lastBuildDate>
        <item>
            <title><![CDATA[Enhancing privacy-focused Web Analytics to better meet your metrics needs]]></title>
            <link>https://blog.cloudflare.com/enhancing-privacy-focused-web-analytics-to-better-meet-your-metrics-needs/</link>
            <pubDate>Mon, 15 Mar 2021 12:00:00 GMT</pubDate>
            <description><![CDATA[ Today, we’re excited to announce the release of three of the most requested features: adding multiple websites to an account, supporting Single-page Applications (SPA) as well as showing Core Web Vitals in Web Analytics. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Last December we opened up our brand new privacy-first Web Analytics platform to everyone. Today, we’re excited to announce the release of three of the most requested features: adding multiple websites to an account, supporting Single-page Applications (SPA) as well as showing <a href="https://www.cloudflare.com/learning/performance/what-are-core-web-vitals/">Core Web Vitals</a> in Web Analytics.</p>
    <div>
      <h3>Bringing privacy-first analytics to everyone</h3>
      <a href="#bringing-privacy-first-analytics-to-everyone">
        
      </a>
    </div>
    <p>Since we launched two months ago, we’ve received a lot of feedback from our users. We are really happy that we are able to provide our privacy-first analytics to so many of you.</p><p>Popular analytics vendors have business models driven by ad revenue. Using them implies a bargain: they track visitor behavior and create buyer profiles to retarget your visitors with ads; in exchange, you get free analytics.</p><p>Our mission is to help build a better Internet, and part of that is to deliver essential web analytics to everyone with a website without compromising user <a href="https://www.cloudflare.com/learning/privacy/what-is-data-privacy/">privacy</a>. We’ve never been interested in tracking users or selling advertising. We don’t want to know what you do on the Internet — it’s not our business.</p>
    <div>
      <h3>You now can measure multiple sites</h3>
      <a href="#you-now-can-measure-multiple-sites">
        
      </a>
    </div>
    <p>When we launched Web Analytics, each account was only able to measure one website. We are happy to announce that all users can now add up to 10 websites.</p><p>Add one or more new sites via the Cloudflare Dashboard by selecting "Add site" in Quick Actions.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/JwHFT8TPvpsRmGSvoXawm/5a1c7606e8cd52883001360f431e3987/image4-10.png" />
            
            </figure><p>For measuring multiple subdomains (a.example.com and b.example.com) there are two options:</p><ol><li><p>Add the root domain (example.com) to Web Analytics and add the same JavaScript snippet on all subdomains (a.example.com and b.example.com)</p></li><li><p>Add the subdomains separately using multiple sites. Here you have to add separate snippets.</p></li></ol><p>We use the hostname to validate the request, so remember that you can only use the JavaScript snippet if both the configured and actual hostnames match.</p>
    <div>
      <h3>You can see the analytics for all your websites sites in one place</h3>
      <a href="#you-can-see-the-analytics-for-all-your-websites-sites-in-one-place">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1gOpBfg0eTme94OnMVlB4B/6ea6c5eb33bd9e2c20b2918ad57f674a/jwLOrKWVvHHkUeNKeJNdtVc416SWL2cHxKB7kNjUxsSfU8Y76VYRycQctec4CPf-WnTzRyP1XA-WVWTdNkVgXqspeT7pFf3dNvUjmOrF-ukWV-0bMv0TmR4ZMppw.png" />
            
            </figure><p>When we talked to customers about the multiple site feature, we got the feedback that it is very important to add all sites to Web Analytics and be able to track them. But they also said that it would be even more powerful to have the option to see analytics for all your sites combined in one place.</p><p>We listened. If you select "View Web Analytics for all sites’ on the Web Analytics overview page, you can now see all your sites listed and apply filters to them using site tags.</p>
    <div>
      <h3>What is different for Single Page Applications (SPA)?</h3>
      <a href="#what-is-different-for-single-page-applications-spa">
        
      </a>
    </div>
    <p>With frameworks such as Angular, React, or Vue.js being very popular, one of the most requested features for Web Analytics was supporting single-page applications (<a href="https://en.wikipedia.org/wiki/Single-page_application">SPA</a>).</p><p>SPAs work differently from a standard web application or website because they don't load a new page every time there's user interaction. Instead, they dynamically rewrite the current web page with new data retrieved from the web server.</p><p>Since we've previously collected metrics only when the page load event is triggered, we had to change the transmission and interpretation of the signals from our JavaScript snippet to include sending metrics whenever there are any route changes made by the application or the website.</p><p>We are happy to announce that we successfully implemented SPA support and enabled it for all customers.</p>
    <div>
      <h3>How we are supporting SPAs</h3>
      <a href="#how-we-are-supporting-spas">
        
      </a>
    </div>
    <p>You might have noticed that some websites keep the # in the URL whenever you navigate their webpages. You would see URLs like the following:</p>
            <pre><code>https://cloudflare.com/#blog
https://cloudflare.com/#marketing</code></pre>
            <p>The portion separated by the # is called a fragment, and based on the fragment changes, SPAs dynamically pull the resources to rewrite the webpage. That is how it was done before the HTML 5 History API was introduced and widely used. These days most SPA libraries/frameworks use HTML 5 History API to keep your UI in sync with the URL instead of using # (although, some still support #-based routers). In most cases you won’t easily notice a SPA by looking at the URL path.</p><p>To support analytics for SPAs, we implemented sending additional payloads to the beacon endpoint, which collects the data for analytics, whenever we detect any changes to the state of the <a href="https://developer.mozilla.org/en-US/docs/Web/API/History/state">History API</a>. The JavaScript snippet overrides the <a href="https://developer.mozilla.org/en-US/docs/Web/API/History/pushState"><b>pushState</b></a> method and listens to the <a href="https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onpopstate"><b>onpopstate</b></a> event. By tracking the History API's state, you'll now see the route changes in SPAs within the Web Analytics dashboard.</p><p>Some older SPA libraries/frameworks still support hash-based routers. If your application or website is using a hash-based router, unfortunately it is not yet supported in Web Analytics. However, this is our initial launch to support SPAs, so stay tuned for any improvements and updates.</p>
    <div>
      <h3>How can I add my Single Page Application to Web Analytics?</h3>
      <a href="#how-can-i-add-my-single-page-application-to-web-analytics">
        
      </a>
    </div>
    <p>SPA support is automatically enabled for all domains in Web Analytics.</p>
    <div>
      <h3>Core Web Vitals are now available for every Web Analytics customer</h3>
      <a href="#core-web-vitals-are-now-available-for-every-web-analytics-customer">
        
      </a>
    </div>
    <p>Core Web Vitals is an initiative by Google to provide unified guidance for quality signals that are essential to delivering a great user experience on the web.</p><p>In September 2020, we introduced <a href="/start-measuring-web-vitals-with-browser-insights/">Web Vitals</a> for customers using Browser Insights, and many customers love getting those unique insights into their website performance. But we were also aware that Browser Insights wasn't available to all our Web Analytics customers simply because they're not able to onboard to the rest of Cloudflare for Infrastructure. Specifically, they're not able to change their DNS servers.</p><p>So today, we're introducing Core Web Vitals to Web Analytics as well.</p><p>You can see the Core Web Vitals metrics in the same dashboard as Visits and Page Views and check how healthy your website performance is.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4yTFAINcPAo0t1S9OwIiKp/6b513be9a8cb27e075703c1d5f5fc862/image1-14.png" />
            
            </figure>
    <div>
      <h3>What’s next</h3>
      <a href="#whats-next">
        
      </a>
    </div>
    <p>This is just the start for our privacy-first Web Analytics.</p><p>We’re excited to integrate more closely with the rest of Cloudflare and give customers even more detailed stats about performance and security (not just traffic). We’re also hoping to make our analytics even more powerful as a standalone product by building support for alerts, real-time updates, and more.</p><p>Please let us know if you have any questions or feedback, and happy measuring!</p> ]]></content:encoded>
            <category><![CDATA[Privacy]]></category>
            <category><![CDATA[Analytics]]></category>
            <guid isPermaLink="false">2hF1Inuj3l05kHwlywWeYY</guid>
            <dc:creator>Marc Lamik</dc:creator>
            <dc:creator>Young Park</dc:creator>
        </item>
        <item>
            <title><![CDATA[Inside the Web Browser’s Performance API]]></title>
            <link>https://blog.cloudflare.com/browser-performance-api/</link>
            <pubDate>Tue, 24 Sep 2019 13:01:00 GMT</pubDate>
            <description><![CDATA[ Building a beautiful, feature-rich website is easier than ever before. Not long ago, you’d have to fire up a text editor and hand-craft a lot of HTML, CSS, and JavaScript. Today, you can use WYSIWYG tools and third-party libraries that make development much simpler. ]]></description>
            <content:encoded><![CDATA[ <p>Building a beautiful, feature-rich website is easier than ever before. Not long ago, you’d have to fire up a text editor and hand-craft a lot of HTML, CSS, and JavaScript. Today, you can use WYSIWYG tools and third-party libraries that make development much simpler. The flip side of this is that it can be hard to see everything that’s going into your website — and the performance can suffer.</p><p>The good news is that modern web browsers expose lots of performance data that can help you understand how your web page performs. With the launch of Browser Insights today, we can analyze the performance from the perspective of the web browser and what the end user actually experiences. In this post, we’ll dive into how we think about performance and utilize the timing APIs in the web browser.</p>
    <div>
      <h3>How web browsers measure performance</h3>
      <a href="#how-web-browsers-measure-performance">
        
      </a>
    </div>
    <p>In the old days, the only way for a developer to profile performance was to intercept requests and measure the time from the beginning of the page load until the end of the load event.</p><p>Today, we can use Web APIs that are supported by modern browsers. This is part of the web standard called the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Performance">Performance API</a>. The Performance API consists of a collection of individual APIs that include:</p><ul><li><p>Navigation Timing (for timing information related to the page and navigation)</p></li><li><p>Resource Timing (for timing data regarding the loading of an application's resources)</p></li><li><p>Paint Timing (that provides timing information about paint operation during the page construction)</p></li></ul><p>In this blog post, we will primarily focus on the Navigation Timing API.</p>
    <div>
      <h3>Inside the Performance API</h3>
      <a href="#inside-the-performance-api">
        
      </a>
    </div>
    <p>To see what’s collected with the Performance API, you can open the Developer Tools in Chrome browser and type ‘performance’ in the console tab (or type in <code>performance.timing</code> to get direct access to the PerformanceTiming attribute).</p><p>Try expanding the Performance object by clicking on the arrow before the label and again expand the ‘timing’. This is called PerformanceTiming, which includes all the timings that relate to the current page load as UNIX epoch timestamp (milliseconds). The timing attributes shown are not in the order of the load. So for better understanding, let’s look at the illustration provided by the W3C.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1SxJcGlceESK5UT2nX0U5V/0ed2588c98bdf4aa3c87db723243e380/pasted-image-0--4-.png" />
            
            </figure><p>Image from <a href="https://www.w3.org/TR/navigation-timing/">https://www.w3.org/TR/navigation-timing/</a></p><p>As we can see from the diagram shown, each element (represented as a box above) in the order from left-to-right, represents the navigation flow of the page load. Each element has an attribute from the starting point to the end (and some have multiple attributes!) so that we can measure the elapsed time for each element. For example, to get the Request Time, you could type in the command like shown below in the console which appears to be 60 milliseconds.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/78quzSc6wQq5sPuMzvaIS1/8bab59c4ec25aecd37e5e4291cf26c30/pasted-image-0--5-.png" />
            
            </figure>
    <div>
      <h3>How Cloudflare uses performance data</h3>
      <a href="#how-cloudflare-uses-performance-data">
        
      </a>
    </div>
    <p>Once your website is proxied through Cloudflare and Browser Insights is enabled, we write and inject a JavaScript beacon into the web page. Our beacon collects metrics from the Performance API to send to our edge, where it can be used to understand where your website is slowing down or having any network problems. The reported data is shown in the Cloudflare dashboard on the Speed Page showing as averages of each timing metric:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2pm9xxGJkm9EfsuszWBOzv/79ca3b20f20398a17fa59676c54f9185/pasted-image-0--6-.png" />
            
            </figure><p>The metrics we surface are:</p><ul><li><p><b>DNS (domainLookupEnd - domainLookupStart)</b>: How long the DNS query takes. This could appear as zero if the connection is reused or the content was stored in the local cache (memory or disk).</p></li><li><p><b>TCP (connectEnd - connectStart)</b>: How long it takes to establish a TCP connection to the server. If HTTPS, this process includes TLS negotiation time.</p></li><li><p><b>Request (responseStart - requestStart)</b>: The time elapsed between making an HTTP request and receiving the first byte of the response.</p></li><li><p><b>Response (responseEnd - responseStart)</b>: The time elapsed between the first byte and the last byte of the response received. You can think of this as a resource download time.</p></li><li><p><b>Processing (domComplete - domLoading)</b>: How long it took to render the page. If this number is big, you can optimize your document architecture, resource size, or configure settings under the Speed page such as Auto Minify the source code. This document process can be drilled down more with domInteractive, domContentLoadedEventStart, domContentLoadedEventEnd, and domComplete. We plan to provide more detailed analytics on this later on.</p></li><li><p><b>Load Event (loadEventEnd - loadEventStart)</b>: When the browser finishes loading its document and resources, it triggers a `load` event. This duration may be helpful to you if you have additional functions or any logic for the load event.</p></li><li><p><b>Total Time</b>: Sum of each timing metrics shown on the graph.</p></li></ul><p>If you are seeing any spikes or unusual form of a line in the stacked line chart, you could start investigating on each element to see what is causing the problem.</p><p>For more about how to use Browser Insights, see our <a href="/introducing-browser-insights">announcement blog post</a>.</p>
    <div>
      <h3>What’s next</h3>
      <a href="#whats-next">
        
      </a>
    </div>
    <p>In this blog post, we’ve focused on the Navigation Timing API, because it’s at the heart of our first version of Browser Insights. In the near future, we plan to incorporate metrics from some of the other APIs. For example, we can break down some of the longer timings by looking at individual resource loads, and pointing out what’s taking longer. In addition to that, we plan to track JavaScript errors, provide a way to measure A/B performance, set up monitoring/alerting based on the metrics, and so on. So stay tuned!</p> ]]></content:encoded>
            <category><![CDATA[Birthday Week]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Deep Dive]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <category><![CDATA[API]]></category>
            <guid isPermaLink="false">4OwCDLBLnNraTpCi8fH464</guid>
            <dc:creator>Young Park</dc:creator>
        </item>
    </channel>
</rss>