
<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>Sat, 04 Apr 2026 03:59:43 GMT</lastBuildDate>
        <item>
            <title><![CDATA[What’s new in Cloudflare: Account Owned Tokens and Zaraz Automated Actions]]></title>
            <link>https://blog.cloudflare.com/account-owned-tokens-automated-actions-zaraz/</link>
            <pubDate>Thu, 14 Nov 2024 14:00:00 GMT</pubDate>
            <description><![CDATA[ Cloudflare customers can now create Account Owned Tokens , allowing more flexibility around access control for their Cloudflare services. Additionally, Zaraz Automation Actions streamlines event tracking and third-party tool integration.  ]]></description>
            <content:encoded><![CDATA[ <p>In October 2024, we started publishing roundup blog posts to share the latest features and updates from our teams. Today, we are announcing general availability for Account Owned Tokens, which allow organizations to improve access control for their Cloudflare services. Additionally, we are launching Zaraz Automated Actions, which is a new feature designed to streamline event tracking and tool integration when setting up third-party tools. By automating common actions like pageviews, custom events, and e-commerce tracking, it removes the need for manual configurations.</p>
    <div>
      <h2>Improving access control for Cloudflare services with Account Owned Tokens</h2>
      <a href="#improving-access-control-for-cloudflare-services-with-account-owned-tokens">
        
      </a>
    </div>
    <p>Cloudflare is critical infrastructure for the Internet, and we understand that many of the organizations that build on Cloudflare rely on apps and integrations outside the platform to make their lives easier. In order to allow access to Cloudflare resources, these apps and integrations interact with Cloudflare via our API, enabled by access tokens and API keys. Today, the API Access Tokens and API keys on the Cloudflare platform are owned by individual users, which can lead to some difficulty representing services, and adds an additional dependency on managing users alongside token permissions.</p>
    <div>
      <h3>What’s new about Account Owned Tokens</h3>
      <a href="#whats-new-about-account-owned-tokens">
        
      </a>
    </div>
    <p>First, a little explanation because the terms can be a little confusing. On Cloudflare, we have both Users and Accounts, and they mean different things, but sometimes look similar. Users are people, and they sign in with an email address. Accounts are not people, they’re the top-level bucket we use to organize all the resources you use on Cloudflare. Accounts can have many users, and that’s how we enable collaboration. If you use Cloudflare for your personal projects, both your User and Account might have your email address as the name, but if you use Cloudflare as a company, the difference is more apparent because your user is “<a><u>joe.smith@example.com</u></a>” and the account might be “Example Company”. </p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5tcNkxDjYz9jAXnfV0bPON/920a9dade7145de2adee21afa43d786e/image13.jpg" />
          </figure><p>Account Owned Tokens are not confined by the permissions of the creating user (e.g. a user can never make a token that can edit a field that they otherwise couldn’t edit themselves) and are scoped to the account they are owned by. This means that instead of creating a token belonging to the user “<a><u>joe.smith@example.com</u></a>”, you can now create a token belonging to the account “Example Company”.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/ibh4sT2wgVLVTgqgv2rtO/eb972a5b1c5fa0f70471631430a8ff91/image8.jpg" />
          </figure><p>The ability to make these tokens, owned by the account instead of the user, allows for more flexibility to represent what the access should be used for.</p><p>Prior to Account Owned Tokens, customers would have to have a user (<a><u>joe.smith@example.com</u></a>) create a token to pull a list of Cloudflare zones for their account and ensure their security settings are set correctly as part of a compliance workflow, for example. All of the actions this compliance workflow does are now attributed to joe.smith, and if joe.smith leaves the company and his permissions are revoked, the compliance workflow fails.</p><p>With this new release, an Account Owned Token could be created, named “compliance workflow”, with permissions to do this operation independently of <a><u>joe.smith@example.com</u></a>. All actions this token does are attributable to “compliance workflow”. This token is visible and manageable by all the superadmins on your Cloudflare account. If joe.smith leaves the company, the access remains independent of that user, and all super administrators on the account moving forward can still see, edit, roll, and delete the token as needed.</p><p>Any long-running services or programs can be represented by these types of tokens, be made visible (and manageable) by all super administrators in your Cloudflare account, and truly represent the service, instead of the users managing the service. Audit logs moving forward will log that a given token was used, and user access can be kept to a minimum.</p>
    <div>
      <h3>Getting started</h3>
      <a href="#getting-started">
        
      </a>
    </div>
    <p>Account Owned Tokens can be found on the new “API Tokens” tab under the “Manage Account” section of your Cloudflare dashboard, and any Super Administrators on your account have the capability to create, edit, roll, and delete these tokens. The API is the same, but at a new <code>/account/&lt;accountId&gt;/tokens</code> endpoint.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/uZFVUp1RRP1NgZli9RAYN/5e2b90bea51b7b45bb25478120fd9024/Screenshot_2024-11-13_at_20.14.43.png" />
          </figure>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1kiUi4lsJESJqr9HhgCS92/b4b0a3e955742346a5c945601fff4885/image3.png" />
          </figure>
    <div>
      <h3>Why/where should I use Account Owned Tokens?</h3>
      <a href="#why-where-should-i-use-account-owned-tokens">
        
      </a>
    </div>
    <p>There are a few places we would recommend replacing your User Owned Tokens with Account Owned Tokens:</p><p>1. <b>Long-running services that are managed by multiple people:</b> When multiple users all need to manage the same service, Account Owned Tokens can remove the bottleneck of requiring a single person to be responsible for all the edits, rotations, and deletions of the tokens. In addition, this guards against any user lifecycle events affecting the service. If the employee that owns the token for your service leaves the company, the service’s token will no longer be based on their permissions.</p><p>2.<b> Cloudflare accounts running any services that need attestable access records beyond user membership:</b> By restricting all of your users from being able to access the API, and consolidating all usable tokens to a single list at the account level, you can ensure that a complete list of all API access can be found in a single place on the dashboard, under “Account API Tokens”.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2qtssh6bef5Ne6kugqUUnc/af11e3db733f4f38188988ac42034c26/image9.png" />
          </figure><p>3. <b>Anywhere you’ve created “Service Users”:</b> “Service Users”, or any identity that is meant to allow multiple people to access Cloudflare, are an active threat surface. They are generally highly privileged, and require additional controls (vaulting, password rotation, monitoring) to ensure non-repudiation and appropriate use. If these operations solely require API access, consolidating that access into an Account Owned Token is safe.</p>
    <div>
      <h3>Why/where should I use User Owned Tokens?</h3>
      <a href="#why-where-should-i-use-user-owned-tokens">
        
      </a>
    </div>
    <p>There are a few scenarios/situations where you should continue to use User Owned Tokens:</p><ol><li><p><b>Where programmatic access is done by a single person at an external interface:</b> If a single user has an external interface using their own access privileges at Cloudflare, it still makes sense to use a personal token, so that information access can be traced back to them. (e.g. using a personal token in a data visualization tool that pulls logs from Cloudflare)</p></li><li><p><a href="https://developers.cloudflare.com/api/operations/user-user-details"><b><u>User level operations</u></b></a><b>:</b> Any operations that operate on your own user (e.g. email changes, password changes, user preferences) still require a user level token.</p></li><li><p><b>Where you want to control resources over multiple accounts with the same credential:</b> As of November 2024, Account Owned Tokens are scoped to a single account. In 2025, we want to ensure that we can create cross-account credentials, anywhere that multiple accounts have to be called in the same set of operations should still rely on API Tokens owned by a user.</p></li><li><p><b>Where we currently do not support a given endpoint:</b> We are currently in the process of working through a <a href="https://developers.cloudflare.com/fundamentals/api/get-started/account-owned-tokens/"><u>list of our services</u></a> to ensure that they all support Account Owned Tokens. When interacting with any of these services that are not supported programmatically, please continue to use User Owned Tokens.</p></li><li><p><b>Where you need to do token management programmatically:</b> If you are in an organization that needs to create and delete large numbers of tokens programmatically, please continue to use User Owned Tokens. In late 2024, watch for the “Create Additional Tokens” template on the Account Owned Tokens Page. This template and associated created token will allow for the management of additional tokens.</p></li></ol>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4BGL99WFnh4oOgTFhRY5N3/26bca9fa8851729d4128c2836db62c3c/image6.png" />
          </figure>
    <div>
      <h3>What does this mean for my existing tokens and programmatic access moving forward?</h3>
      <a href="#what-does-this-mean-for-my-existing-tokens-and-programmatic-access-moving-forward">
        
      </a>
    </div>
    <p>We do not plan to decommission User Owned Tokens, as they still have a place in our overall access model and are handy for ensuring user-centric workflows can be implemented.</p><p>As of November 2024, we’re still working to ensure that ALL of our endpoints work with Account Owned Tokens, and we expect to deliver additional token management improvements continuously, with an expected end date of Q3 2025 to cover all endpoints.</p><p>A list of services that support, and do not support, Account Owned Tokens can be found in our <a href="https://developers.cloudflare.com/fundamentals/api/get-started/account-owned-tokens/"><u>documentation.</u></a></p>
    <div>
      <h3>What’s next?</h3>
      <a href="#whats-next">
        
      </a>
    </div>
    <p>If Account Owned Tokens could provide value to your or your organization, documentation is available <a href="https://developers.cloudflare.com/fundamentals/api/get-started/account-owned-tokens/"><u>here</u></a>, and you can give them a try today from the “API Tokens” menu in your dashboard.</p>
    <div>
      <h2>Zaraz Automated Actions makes adding tools to your website a breeze</h2>
      <a href="#zaraz-automated-actions-makes-adding-tools-to-your-website-a-breeze">
        
      </a>
    </div>
    
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5DkxlchIDUZbQ15x0H0usK/eb656617c1c83805bda98c7dfe896bda/image2.png" />
          </figure><p><a href="https://www.cloudflare.com/en-gb/application-services/products/zaraz/"><u>Cloudflare Zaraz</u></a> is a tool designed to manage and optimize third-party tools like analytics, marketing tags, or social media scripts on websites. By loading these third-party services through Cloudflare’s network, Zaraz improves website performance, security, and privacy. It ensures that these external scripts don't slow down page loading times or expose sensitive user data, as it handles them efficiently through Cloudflare's global network, reducing latency and improving the user experience.</p><p>Automated Actions are a new product feature that allow users to easily setup page views, custom events, and e-commerce tracking without going through the tedious process of manually setting up triggers and actions.</p>
    <div>
      <h3>Why we built Automated Actions</h3>
      <a href="#why-we-built-automated-actions">
        
      </a>
    </div>
    <p>An action in Zaraz is a way to tell a third party tool that a user interaction or event has occurred when certain conditions, defined by <a href="https://developers.cloudflare.com/zaraz/custom-actions/create-trigger/"><u>triggers</u></a>, are met. You create actions from within the tools page, associating them with specific tools and triggers.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6a0xBA0uG55z4mhVkN0aYl/10101523491c68e4f2eec022737d15d4/image12.png" />
          </figure><p>Setting up a tool in Zaraz has always involved a few steps: <a href="https://developers.cloudflare.com/zaraz/custom-actions/create-trigger/"><u>configuring a trigger</u></a>, <a href="https://developers.cloudflare.com/zaraz/custom-actions/create-action/"><u>linking it to a tool action</u></a> and finally calling <a href="https://developers.cloudflare.com/zaraz/web-api/track/"><code><u>zaraz.track()</u></code></a>. This process allowed advanced configurations with complex rules, and while it was powerful, it occasionally left users confused — why isn’t calling <code>zaraz.track()</code> enough? We heard your feedback, and we’re excited to introduce <b>Zaraz Automated Actions</b>, a feature designed to make Zaraz easier to use by reducing the amount of work needed to configure a tool.</p><p>With Zaraz Automated Actions, you can now automate sending data to your third-party tools without the need to create a manual configuration. Inspired by the simplicity of <a href="https://developers.cloudflare.com/zaraz/web-api/ecommerce/"><code><u>zaraz.ecommerce()</u></code></a>, we’ve extended this ease to all Zaraz events, removing the need for manual trigger and action setup. For example, calling <code>zaraz.track(‘myEvent’)</code> will send your event to the tool without the need to configure any triggers or actions.</p>
    <div>
      <h3>Getting started with Automated Actions</h3>
      <a href="#getting-started-with-automated-actions">
        
      </a>
    </div>
    <p>When adding a new tool in Zaraz, you’ll now see an additional step where you can choose one of three Automated Actions: <b>pageviews</b>, <b>all other events</b>, or <b>ecommerce</b>. These options allow you to specify what kind of events you want to automate for that tool.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1LRtb8XpSukCAgmK7uIA5Y/ab11ae9b58f474d08893b496a0eea764/image7.png" />
          </figure><ul><li><p><b>Pageviews</b>: Automatically sends data to the tool whenever someone visits a page on your site, without any manual configuration.</p></li><li><p><b>All other events</b>: Sends all custom events triggered using zaraz.track() to the selected tool, making it easy to automate tracking of user interactions.</p></li><li><p><b>Ecommerce</b>: Automatically sends all e-commerce events triggered via zaraz.ecommerce() to the tool, streamlining your sales and transaction tracking.</p></li></ul><p>These Automated Actions are also available for all your existing tools, which can be toggled on or off from the tool detail page in your Zaraz dashboard. This flexibility allows you to fine-tune which actions are automated based on your needs.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/xy1tIfYTfOo7p2IUeCS5d/42b26d6cfc4c05d8adc67edfc38ac34c/image10.png" />
          </figure>
    <div>
      <h3>Custom actions for tools without Automated Action support</h3>
      <a href="#custom-actions-for-tools-without-automated-action-support">
        
      </a>
    </div>
    <p>Some tools do not support automated actions because the tool itself does not support page view, custom, or e-commerce events. For such tools you can still create your own custom actions, just like before. Custom actions allow you to configure specific events to send data to your tools based on unique triggers. The process remains the same, and you can follow the detailed steps outlined in our<a href="https://developers.cloudflare.com/zaraz/get-started/create-actions/"> <u>Create Actions guide</u></a>. Remember to set up your trigger first, or choose an existing one, before configuring the action.</p>
    <div>
      <h4>Automatically enrich your payload</h4>
      <a href="#automatically-enrich-your-payload">
        
      </a>
    </div>
    <p>When creating a custom action, it is now easier to send Event Properties using the <b>Include Event Properties field.</b> When this is toggled on, you can automatically send client-specific data with each action, such as user behavior or interaction details. For example, to send an <code>userID</code> property when sending a <code>click</code> event you can do something like this: <code>zaraz.track(‘click’, { userID: “foo” })</code>.</p><p>Additionally, you can enable the <b>Include System Properties</b> option to send system-level information, such as browser, operating system, and more. In your action settings click on “Add Field”, pick the “Include System Properties”, click on confirm and then toggle the field on. </p><p>For a full list of system properties, visit our<a href="https://developers.cloudflare.com/zaraz/reference/context/"> <u>System Properties reference guide</u></a>. These options give you greater flexibility and control over the data you send with custom actions.</p><p>These two fields replace the now deprecated “Enrich Payload” dropdown field.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/73nCsNmeG58p6n0ylxMV8E/5cb87b516aaceb38319f9175dc7ccbf3/image5.png" />
          </figure><p>Zaraz Automated Actions marks a significant step forward in simplifying how you manage events across your tools. By automating common actions like page views, e-commerce events, and custom tracking, you can save time and reduce the complexity of manual configurations. Whether you’re leveraging Automated Actions for speed or creating custom actions for more tailored use cases, Zaraz offers the flexibility to fit your workflow. </p><p>We’re excited to see how you use this feature. Please don’t hesitate to reach out to us on Cloudflare <a href="https://discord.gg/2TRr6nSxdd"><u>Zaraz’s Discord Channel</u></a> — we’re always there fixing issues, listening to feedback, and announcing exciting product updates.</p>
    <div>
      <h2>Never miss an update</h2>
      <a href="#never-miss-an-update">
        
      </a>
    </div>
    <p>We’ll continue to share roundup blog posts as we continue to build and innovate. Be sure to follow along on the <a href="https://blog.cloudflare.com/"><u>Cloudflare Blog</u></a> for the latest news and updates.</p> ]]></content:encoded>
            <category><![CDATA[Identity]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Zaraz]]></category>
            <category><![CDATA[Analytics]]></category>
            <category><![CDATA[Managed Components]]></category>
            <guid isPermaLink="false">5BHU4q5GpzBQ1OLQoUvkKN</guid>
            <dc:creator>Joseph So</dc:creator>
            <dc:creator>Omar Mohammad</dc:creator>
            <dc:creator>Yo'av Moshe</dc:creator>
        </item>
        <item>
            <title><![CDATA[Cloudflare Zaraz adds support for server-side rendering of X and Instagram embeds]]></title>
            <link>https://blog.cloudflare.com/zaraz-supports-server-side-rendering-of-embeds/</link>
            <pubDate>Wed, 10 Jul 2024 13:00:55 GMT</pubDate>
            <description><![CDATA[ We are thrilled to announce Cloudflare Zaraz support for server-side rendering of embeds from X and Instagram. This allows for secure, privacy-preserving, and performant embedding without third-party JavaScript or cookies, enhancing security, privacy, and performance on your website ]]></description>
            <content:encoded><![CDATA[ <p></p><p>We are thrilled to announce <a href="https://developers.cloudflare.com/zaraz/">Cloudflare Zaraz</a> support of server-side rendering of embeds, featuring two Managed Components: X and Instagram. You can now use Cloudflare Zaraz to effortlessly embed posts from X or Instagram on your website in a performant, privacy-preserving, and secure way. Many traditional tag managers or customer data platforms rely heavily on third-party JavaScript and cookies to embed content, leading to concerns about privacy and performance. In contrast, we designed our solution to work without loading any third-party JavaScript or cookies, and furthermore to completely eliminate communication between the browser and third-party servers.</p><p>Starting today, you can use Cloudflare Zaraz not only for server-side data reporting to conventional marketing and analytics tools but also for server-side content rendering on your website. We are excited to pave the way with tools that enhance security, protect user privacy, and improve performance. Take a look at it:</p>
    <div>
      <h2>Embed social media content without sacrificing security and speed</h2>
      <a href="#embed-social-media-content-without-sacrificing-security-and-speed">
        
      </a>
    </div>
    <p>Since social media platforms emerged, we have become more and more familiar with seeing posts being embedded on websites, from showcasing user testimonials on product pages to featuring posts from reporters and politicians in news articles or blogs. Traditionally, this process has involved integrating HTML and JavaScript code provided by the social media platform. While this method was quite convenient and simple to implement, it also introduces significant drawbacks in terms of security, privacy, and performance.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2qxUuLVQHw3C0rXGaaAb9m/f33ca6f4c9c61b3a296d8908ba6f1f01/image5-6.png" />
            
            </figure><p><i>Instagram’s interface to copy HTML embed code</i></p><p>One of the primary concerns with using the embed scripts from these platforms is privacy. Today, there’s simply no way to embed social media content on your website without letting social media platforms collect data on your users. Very often this is done via <a href="https://www.cloudflare.com/learning/privacy/what-are-cookies/">cookies</a>, but it is not the only way in which social media platforms collect information on your end users. More often than not, traditional embed scripts <a href="https://www.insideprivacy.com/international/european-union/cjeu-rules-that-facebook-and-website-operators-are-joint-controllers-if-the-website-embeds-facebooks-like-button/">capture sensitive information</a> from the browser and include it in the requests sent to their endpoints, and often even to other third-party endpoints. Even if they don’t explicitly collect private information, the very request made from the browser to fetch the remote JavaScript resource can potentially expose sensitive user information, such as the IP address or User Agent. This practice has already led to GDPR compliance issues in Europe with other tools, as seen in the case with <a href="/cloudflare-fonts-enhancing-website-privacy-speed/">Google Fonts</a>, and poses a similar future risk with any other third-party tool, including embeds.</p><p>Security is another big risk embed scripts pose. By embedding these external scripts, websites essentially place their trust in the security of these third-party platforms. A single vulnerability in any of their dependency libraries could <a href="/detecting-magecart-style-attacks-for-pageshield/">compromise user safety</a> on a massive scale.</p><p>In contrast to traditional social media platform code snippets, Zaraz's method of embedding X and Instagram posts does not load any third-party JavaScript on the client side. And not only that, by leveraging different <a href="https://managedcomponents.dev/specs/category/server-functionality">Managed Component APIs</a> (see code walkthrough below), Zaraz is fetching and caching all the content on the server side, and serving everything from your own domain. This means that there’s simply no direct communication between the end user’s browser and the third-party endpoint, which gives you much greater control over what information is shared with the external platform, if any.</p><p>Zaraz, running entirely on Cloudflare Workers, and with its ability to inject HTML before web content is served, also has performance advantages. Below, you can see the perfect 100 score that our X embed has received from Google PageSpeed Insights, and our ability to reach 0ms Total Blocking Time with only one request and a minimal transfer size of 12.1 KiB. To showcase the new feature, we’ve put together two identical HTML pages that are loading <a href="https://twitter.com/eastdakota/status/1754336034228171055">this tweet</a>. One is embedding the tweet using Zaraz, the other embeds the code snippet provided by X. We then ran the Google PageSpeed Insights tests on the pages, loaded from the exact same environment.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/pyQqFF6zKQSQ96Oprg5y6/195e1b9286b10dafdfb53cb28ce98259/image3-16.png" />
            
            </figure><p>In comparison, the traditional way of embedding social media posts introduces a significant performance hit. Below are the results of the traditional embed code we tested: a 27-point decrease in the performance score, multiple requests with transfer size of 475 KiB, and 1,010 ms of Total Blocking Time (more than a second just to render this tweet!).</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1dJCmspfbNoxmc2dm9PiAl/76ea68db1b2a30e28aad1f3b0a3a9e9a/image2-16.png" />
            
            </figure>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3gXElZQ1BvYq8KbEn6BIfQ/e2b3c059e972e6fe2d9816f902d892b5/image1-24.png" />
            
            </figure><p>By processing content server-side, we completely eliminate the need for cookies or third-party scripts on the client's browser, we prevent direct communication between the browser and the third-party server, and we provide a significantly faster user experience. So how does it work? Let’s dive into the code.</p>
    <div>
      <h2>Using and building embeds</h2>
      <a href="#using-and-building-embeds">
        
      </a>
    </div>
    <p>The <a href="https://github.com/managed-components/twitter/">X</a> and <a href="https://github.com/managed-components/instagram/">Instagram</a> Managed Components we’ve built are open source and available on GitHub. We took a different approach with each tool to showcase different methods for fetching content and generating the embed’s HTML and CSS. The X embed is requesting JSON from X’s endpoint, and is distributing the information received inside a templated HTML post we’ve written. The HTML template mimics the looks of the original post. The Instagram embed is requesting the actual post’s HTML generated by Instagram, manipulating it so that it doesn’t include any scripts, and routing all the images and CSS through your own domain. We outline and showcase the different processes below.</p>
    <div>
      <h3>How to embed posts using Cloudflare Zaraz</h3>
      <a href="#how-to-embed-posts-using-cloudflare-zaraz">
        
      </a>
    </div>
    <p>Loading an embed with Cloudflare Zaraz is simple: instead of loading the Embed JavaScript provided by X or Instagram, you simply add a placeholder element to your HTML.</p><p>For X:</p>
            <pre><code>&lt;twitter-post tweet-id="1754336034228171055"&gt;&lt;/twitter-post&gt;</code></pre>
            <p>* Make sure to replace the tweet-id with the number shown in the embedded tweet’s URL.</p><p>For Instagram:</p>
            <pre><code>&lt;instagram-post
  post-url="https://www.instagram.com/p/Ct_qa1ZtmiW/"
  captions="true"&gt;
&lt;/instagram-post&gt;</code></pre>
            <p>* Make sure to replace the post-url with the URL of the desired post. When `captions` is set to true, the embed will include the post’s captions.</p><p>Once you've added the HTML to your page, activate the corresponding tools in your Cloudflare Zaraz dashboard. Click “Add new tools” to add X and Instagram. This is how your screen should look when you finish setting up your tools:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/67s1MNMVw1VXwlgoAkGOg4/76db31158e0a332180846c87d830b3da/image6-4.png" />
            
            </figure><p>Cloudflare Zaraz will then detect placeholder elements in your HTML and replace them with the embedded social media content.</p>
    <div>
      <h3>Walkthrough of the X post embed</h3>
      <a href="#walkthrough-of-the-x-post-embed">
        
      </a>
    </div>
    <p>The X Managed Component is registering the following embed:</p>
            <pre><code>manager.registerEmbed("post", async ({ parameters, client }) =&gt; {
  // embed's logic goes here
});</code></pre>
            <p>Zaraz detects the placeholder element , and picks up all the parameters included as HTML attributes of that element and sends them inside an object, together with the client, as the first argument of the <a href="https://managedcomponents.dev/specs/embed-and-widgets/embeds"><code>manager.registerEmbed()</code></a> function. The <code>manager.registerEmbed()</code> <code>callback</code> will return HTML. To generate the HTML, we use generic HTML and CSS templates we’ve written to construct the post. Those templates contain placeholder variables to be filled with the relevant tweet data later on.</p><p>We use <a href="http://mustache.github.io/">Mustache</a>, a library for rendering templates, to replace the placeholder variables spread across the HTML template. Wherever Mustache detects <code>{{text}}</code>, <code>{{name}}</code>, <code>{{username}}</code>, and the like in the HTML, it will replace their content with the relevant values we pass to it, like so:</p>
            <pre><code>//using Mustache to search for and replace placeholder variables in the post template with the tweet's content 
    const output = mustache.render(post, {
      text,
      name: user.name,
      username: user.screen_name,
      picture: 'data:image/jpeg;base64,' + profileImage,
      datetime,
      likes: numberFormatter(favorite_count, 1),
      replies: numberFormatter(conversation_count, 1),
      heartIcon,
      commentIcon,
      linkIcon,
      tweetId,
      xIcon,
      tooltipIcon,
      retweetUrl,
    })</code></pre>
            <p>Most of the values of the variables we pass to Mustache, which contain the specific post data, are being fetched from one of X’s endpoints. This is done with a server-side fetch request. The response, containing a JSON file with all the post’s data, is then populated into the corresponding variables as shown above.</p><p>Zaraz is also caching the JSON for better performance. This is done with the Managed Components <a href="https://managedcomponents.dev/specs/cache/useCache"><code>manager.useCache()</code></a> method, which takes 3 arguments: name, function and expiry. Here, the function argument is using <a href="https://managedcomponents.dev/specs/server-functionality/fetch"><code>manager.fetch()</code></a> to send a fetch request from the server.</p>
            <pre><code>(...)

// grabs the tweet-id from the parameters argument
    const tweetId = parameters['tweet-id'] 

(...)

const tweetResponse = await manager.useCache(
      'tweet_' + tweetId,
      async () =&gt; {
        const res = await manager.fetch(       `https://cdn.syndication.twimg.com/tweet-result?id=${tweetId}&amp;token=${randomToken}`,
          {
            headers: {
              Accept: 'application/json',
              'User-Agent': client?.userAgent || prefixedUA,
            },
          }
        )
        if (!res) {
          throw new Error('Failed to fetch tweet data.')
        }
        return await res.text()
      },
      600 // cache the Tweet for 10 minutes
    )</code></pre>
            <p>It is important to mention that all images populated in the post template, like the profile picture, are fetched server-side and cached using <a href="https://managedcomponents.dev/specs/storage/set"><code>manager.set()</code></a>:</p>
            <pre><code>// first, we check if profile image is already cached
let profileImage = await manager.get('profileImage_' + user.screen_name)

// if not, we fetch the image server-side and cache it using `manager.set()`

    if (!profileImage) {
      const res = await manager.fetch(user.profile_image_url_https, {
        headers: {
          Accept: 'image/jpeg,image/png,image/*,*/*;q=0.8',
          'User-Agent': client?.userAgent || prefixedUA,
        },
        method: 'GET',
      })
      if (res) {
        const imageBuffer = await res.arrayBuffer()

        profileImage = base64Encode(imageBuffer)
        await manager.set('profileImage_' + user.screen_name, profileImage)
      }
    }</code></pre>
            <p>Once the post’s HTML is ready, with all the relevant content fetched and rendered, the Managed Component returns the HTML content to Zaraz. Zaraz will then use it to replace the  <code>&lt;twitter-post&gt;</code> placeholder element. Because this all happens on Cloudflare, the response to the end-user's browser will already contain the embed code.</p>
    <div>
      <h3>Walkthrough of the Instagram post embed</h3>
      <a href="#walkthrough-of-the-instagram-post-embed">
        
      </a>
    </div>
    <p>The Instagram post embed is built around Instagram's own generated HTML. In contrast to the X example, which uses JSON data to populate an HTML template, this approach involves tweaking Instagram's HTML to meet our privacy and safety requirements.</p><p>We want the Instagram embed to work without requiring direct communication between the browser and any of Instagram’s endpoints. This is done by fetching CSS content server-side, caching it, and finally serving it together with the output HTML, avoiding any network request from the browser to fetch CSS content. We also set up a route server on the customer’s own domain, from which the Managed Components serve all images. Setting up a route endpoint with Managed Components is fairly straightforward:</p>
            <pre><code>manager.route('/image/', async request =&gt; {
// logic to fetch and cache all images
});</code></pre>
            <p>After setting up routes, we fetch the HTML content of the specific Instagram post, server-side, using the <code>manager.fetch()</code> method. We then manipulate the HTML to fit it to the specific website and cache it using <code>manager.useCache()</code>. Amongst other things, changes to the HTML include setting image <code>src</code> and <code>srcset</code> attributes to serve images from your own routes, to avoid requesting images from Instagram’s endpoint (and by so doing, potentially revealing sensitive user information). As mentioned above, we also remove all scripts and stylesheet links, as we prefetch and cache all CSS content from stylesheet links server-side, in order to serve CSS and spare the browser a few additional network requests, improving privacy and performance.</p><p>The HTML manipulation is done using the <a href="https://cheerio.js.org/">Cheerio</a> library. This is how, for example, we adjust the `src` attribute of images to redirect through our route:</p>
            <pre><code>$('img[src*="scontent.cdninstagram.com"]').each((i, el) =&gt; {
        const img = $(el)
        const src = img.attr('src')!
        const newSrc = src.replace(
          /^https:\/\/scontent.cdninstagram.com\/(.*)$/,
          (_match, path) =&gt;
            `${hostName(client)}${imgRoute}?q=` + encodeURIComponent(path)
        )
        img.attr('src', newSrc) </code></pre>
            <p>This implementation effectively prevents any direct communication from the browser to Instagram servers, safeguarding sensitive user information such as IP addresses.</p>
    <div>
      <h2>What is currently supported and what’s next for embeds</h2>
      <a href="#what-is-currently-supported-and-whats-next-for-embeds">
        
      </a>
    </div>
    <p>Currently, our X embed supports text tweets and the Instagram embed supports image posts. We are working to broaden our support to other media types. Beyond these improvements, we aim to extend the application of our embeds across an even broader range of tools. We invite our users and partners to collaborate with us on the <a href="https://managedcomponents.dev/">Managed Component</a> open source project, in adding support for more tools that can be rendered entirely server-side. We believe that this is the way to create a safer and faster web for everyone, and we hope that what we are launching today will inspire the community to build even better solutions together with us!</p><p>Start using embeds now by adding X and Instagram in your <a href="https://dash.cloudflare.com/?to=/:account/:zone/zaraz">Zaraz dashboard</a>.</p> ]]></content:encoded>
            <category><![CDATA[Zaraz]]></category>
            <guid isPermaLink="false">7qKR1EQFjatQuFfSCAmPL8</guid>
            <dc:creator>Yair Dovrat</dc:creator>
        </item>
        <item>
            <title><![CDATA[New Consent and Bot Management features for Cloudflare Zaraz]]></title>
            <link>https://blog.cloudflare.com/new-consent-and-bot-management-features-for-cloudflare-zaraz/</link>
            <pubDate>Wed, 15 May 2024 13:00:50 GMT</pubDate>
            <description><![CDATA[ Zaraz Consent Management now supports Google Consent Mode v2 and is compliant with the IAB Europe Transparency and Consent Framework. Zaraz also added Bot Management support for keeping your analytics data clean ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Managing consent online can be challenging. After you’ve figured out the necessary regulations, you usually need to configure some Consent Management Platform (CMP) to load all third-party tools and scripts on your website in a way that respects these demands. <a href="https://www.cloudflare.com/application-services/products/zaraz/">Cloudflare Zaraz</a> manages the loading of all of these third-party tools, so it was only natural that in April 2023 we announced the <a href="/consent-manager">Cloudflare Zaraz CMP</a>: the simplest way to manage consent in a way that seamlessly integrates with your third-party tools manager.</p><p>As more and more third-party tool vendors are required to handle consent properly, our CMP has evolved to integrate with these new technologies and standardization efforts. Today, we’re happy to announce that the Cloudflare Zaraz CMP is now compatible with the Interactive Advertising Bureau Transparency and Consent Framework (IAB TCF) requirements, and fully supports Google’s Consent Mode v2 signals. Separately, we’ve taken efforts to improve the way Cloudflare Zaraz handles traffic coming from online bots.</p>
    <div>
      <h2>IAB TCF Compatibility</h2>
      <a href="#iab-tcf-compatibility">
        
      </a>
    </div>
    <p>Earlier this year, Google announced that websites that would like to use AdSense and other advertising solutions in the European Economic Area (EEA), the UK, and Switzerland, will be <a href="https://support.google.com/admanager/answer/13554116?hl=en">required to use a CMP that is approved by IAB Europe</a>, an association for digital marketing and advertising. Their <a href="https://iabeurope.eu/transparency-consent-framework/">Transparency and Consent Framework</a> sets guidelines for how CMPs should operate. Since March 2024, the Cloudflare Zaraz CMP is compliant with these guidelines, and Zaraz users in Europe can use Google’s advertising products without any restrictions.</p><p>Since the IAB TCF requirements can make the consent modal a little complex for users, we have made this compliance mode an opt-in feature. See the <a href="https://developers.cloudflare.com/zaraz/consent-management/iab-tcf-compliance/">official documentation</a> for information on how to enable it.</p>
    <div>
      <h2>Google Consent Mode v2</h2>
      <a href="#google-consent-mode-v2">
        
      </a>
    </div>
    <p>Another <a href="https://support.google.com/google-ads/answer/14505993?hl=en">new requirement from Google</a> was the need to send “Consent Signals”. These signals are part of what is also known as “Consent Mode”, and later, <a href="https://developers.google.com/tag-platform/security/concepts/consent-mode">Consent Mode v2</a>. Together with each event sent to Google Analytics and Google Ads, they tell the Google servers about the consent status of the current visitor – did they agree to have their data used for personalized advertising? Did they accept <a href="https://www.cloudflare.com/learning/privacy/what-are-cookies/">cookies</a>? These and other questions are answered by Consent Mode v2, telling the Google servers how to treat the data it receives.</p><p>Consent Mode v2 usually requires setting two values for each consent category – a default value and an updated one. The default value represents the consent status (granted or denied) a certain category (e.g. using cookies) has before the user has submitted their personal preferences. Usually, and especially within the EU, the default value would be `denied`. Once the user submits their preferences, Consent Mode v2 sends an additional “updated” value that represents the choice the user made.</p><p>Implementing Consent Mode v2 is quick and easy with Cloudflare Zaraz, although the specific implementation depends on your CMP. Examples, including integration with the Cloudflare Zaraz CMP, are available in our <a href="https://developers.cloudflare.com/zaraz/advanced/google-consent-mode/">official documentation</a>.</p><p>We believe that better standardization around online consent benefits everyone, and we are glad to be working on tools that respect users' privacy and improve online user experience.</p>
    <div>
      <h2>Bot Management</h2>
      <a href="#bot-management">
        
      </a>
    </div>
    <p>We also recently integrated better Bot Management support within Cloudflare Zaraz. You often want crawlers to be able to access your website, but you don’t want them to trigger your analytics and conversion pixels. Using the Bot Management feature in the <a href="https://developers.cloudflare.com/zaraz/reference/settings/#bot-score-threshold">Cloudflare Zaraz Settings page</a> allows you to fine tune which requests will make it to Cloudflare Zaraz and which ones will be skipped. Since <a href="/zaraz-announces-new-pricing/">Zaraz pricing</a> is based on the total number of Zaraz Events, this can also be useful if you want more control over your Cloudflare Zaraz costs, ensuring you will not be paying for events triggered by bots. Like all other Cloudflare Zaraz features, these new features are also available to users on all plans, including the <a href="https://www.cloudflare.com/plans/free/">free plan</a>. For us, it is part of making sure that everyone can benefit from a faster, safer, and more private way to manage third parties online. If you haven’t started using Cloudflare Zaraz already, now is a great time. Go to <a href="https://dash.cloudflare.com/?to=/:account/:zone/zaraz/consent">the Cloudflare dashboard</a> and set it up in just a few clicks.</p> ]]></content:encoded>
            <category><![CDATA[Zaraz]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Privacy]]></category>
            <category><![CDATA[Bots]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <category><![CDATA[Developers]]></category>
            <guid isPermaLink="false">6H88aYtewMC4Snq51FUaxK</guid>
            <dc:creator>Yo'av Moshe</dc:creator>
        </item>
        <item>
            <title><![CDATA[Zaraz launches new pricing]]></title>
            <link>https://blog.cloudflare.com/zaraz-announces-new-pricing/</link>
            <pubDate>Thu, 29 Feb 2024 15:09:33 GMT</pubDate>
            <description><![CDATA[ The new Cloudflare Zaraz pricing makes Zaraz the most affordable way to load third-party tools on your website, starting with 1 million free events per month and all features unlocked ]]></description>
            <content:encoded><![CDATA[ <p>In July, 2023, we announced that <a href="/cloudflare-zaraz-steps-up-general-availability-and-new-pricing/">Zaraz was transitioning out of beta and becoming available to all Cloudflare users</a>. <a href="https://www.cloudflare.com/application-services/products/zaraz/">Zaraz</a> helps users manage and optimize the ever-growing number of third-party tools on their websites — analytics, marketing pixels, chatbots, and more — without compromising on speed, privacy, or security. Soon after the announcement went online, we received feedback from users who were concerned about the new pricing system. We discovered that in some scenarios the proposed pricing could cause high charges, which was not the intention, and so we promised to look into it. Since then, we have iterated over different pricing options, talked with customers of different sizes, and finally reached a new pricing system that we believe is affordable, predictable, and simple. The new pricing for Zaraz will take effect on April 15, 2024, and is described below.</p>
    <div>
      <h3>Introducing Zaraz Events</h3>
      <a href="#introducing-zaraz-events">
        
      </a>
    </div>
    <p>One of the biggest changes we made was changing the metric we used for pricing Zaraz. One Zaraz Event is an event you’re sending to Zaraz, whether that’s a pageview, a <code>zaraz.track</code> event, or similar. You can easily see the total number of Zaraz Events you’re currently using under the Monitoring section in the Cloudflare Zaraz Dashboard. Every Cloudflare account can use 1,000,000 Zaraz Events completely for free, every month.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3TnbdwfwBU9pAaAOcrwUUI/0c84f7a4cf6bce19a771d3b7fd61a98b/image1-15.png" />
            
            </figure><p>The Zaraz Monitoring page shows exactly how many Zaraz Events your website is using</p><p>We believe that Zaraz Events are a better representation of the usage of Zaraz. As the web progresses and as Single-Page-Applications are becoming more and more popular, the definition of a “pageview”, which was used for the old pricing system, is becoming more and more vague. Zaraz Events are agnostic to different tech stacks, and work the same when using the Zaraz HTTP API. It’s a simpler metric that should better reflect the way Zaraz is used.</p>
    <div>
      <h3>Predictable costs for high volume websites</h3>
      <a href="#predictable-costs-for-high-volume-websites">
        
      </a>
    </div>
    <p>With the new Zaraz pricing model, every Cloudflare account gets 1,000,000 Zaraz Events per month for free. If your account needs more than that, every additional 1,000,000 Zaraz Events are only $5 USD, with volume discounting available for Enterprise accounts. Compared with other third-party managers and tag management software, this new pricing model makes Zaraz an affordable and user-friendly solution for server-side loading of tools and tags.</p>
    <div>
      <h3>Available for all</h3>
      <a href="#available-for-all">
        
      </a>
    </div>
    <p>We also decided that all Zaraz features should be available for everyone. We want users to make the most of Zaraz, no matter how big or small their website is. This means that advanced features like making custom HTTP requests, using the Consent Management API, loading custom Managed Components, configuring custom endpoints, using the Preview &amp; Publish Workflow, and even using the Zaraz Ecommerce features are now available on all plans, from Free to Enterprise.</p>
    <div>
      <h3>Try it out</h3>
      <a href="#try-it-out">
        
      </a>
    </div>
    <p>We’re announcing this new affordable price for Zaraz while retaining all the features that make it the perfect solution for managing third-party tools on your website. Zaraz is a one-click installation that requires no server, and it's lightning fast thanks to Cloudflare's network, which is within 50 milliseconds of approximately 95% of the Internet-connected population. Zaraz is extremely extensible using the Open Source format of Managed Components, allowing you to change tools and create your own, and it’s transparent about what information is shared with tools on your website, allowing you to control and improve the privacy of your website visitors.</p><p>Zaraz recently completed the migration of all tools to Managed Components. This makes tools on your website more like apps on your phone, allowing you to granularly decide what permissions to grant tools. For example, it allows you to prevent a tool from making client-side network requests or storing cookies. With the Zaraz Context Enricher you can create custom data manipulation processes in a Cloudflare Worker, and do things like attach extra information to payloads from your internal CRM, or automatically remove and mask personally-identifiable information (PII) like email addresses before it reaches your providers.</p><p>We would like to thank all the users that provided us with their feedback. We acknowledge that the previous pricing might have caused some to think twice about choosing Zaraz, and we hope that this will encourage them to reconsider. Cloudflare Zaraz is a tool that is meant first and foremost to serve the people building websites on the Internet, and we thank everyone for sharing their feedback to help us get to a better product in the end.</p><p>The new pricing for Zaraz will take effect starting April 15, 2024.</p> ]]></content:encoded>
            <category><![CDATA[Zaraz]]></category>
            <category><![CDATA[Privacy]]></category>
            <category><![CDATA[Managed Components]]></category>
            <category><![CDATA[Product News]]></category>
            <guid isPermaLink="false">2tTjxC5bpTPFdwvlGduHpK</guid>
            <dc:creator>Yo'av Moshe</dc:creator>
        </item>
        <item>
            <title><![CDATA[Enhancing Zaraz support: introducing certified developers]]></title>
            <link>https://blog.cloudflare.com/enhancing-zaraz-support-introducing-certified-developers/</link>
            <pubDate>Tue, 13 Feb 2024 14:00:07 GMT</pubDate>
            <description><![CDATA[ The Cloudflare Zaraz ecosystem is expanding! Read more to learn how you can now connect with Certified Zaraz Developers to help you with migrating to Zaraz, maintaining your configuration and more ]]></description>
            <content:encoded><![CDATA[ 
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4R1HSN6dWapKVhHQwECIEZ/76ae9e75c0f201ccbf7c92bfe010325d/image1-11.png" />
            
            </figure><p>Setting up Cloudflare Zaraz on your website is a great way to load third-party tools and scripts, like analytics or conversion pixels, while keeping things secure and performant. The process can be a breeze if all you need is just to add a few tools to your website, but If your setup is complex and requires using click listeners, advanced triggers and variables, or, if you’re migrating a substantial container from Google Tag Manager, it can be quite an undertaking. We want to make sure customers going through this process receive all the support they need.</p><p>Historically, we've provided hands-on support and maintenance for Zaraz customers, helping them navigate the intricacies of this powerful tool. However, as Zaraz's popularity continues to surge, providing one-on-one support has become increasingly impractical.</p><p>Companies usually rely on agencies to manage their tags and marketing campaigns. These agencies often have specialized knowledge, can handle diverse client needs efficiently, scale resources as required, and may offer cost advantages compared to maintaining an in-house team. That's why we're thrilled to announce the launch of the first round of certified Zaraz developers, aligning with the way other Tag Management software works. Our certified developers have undergone an intensive training program and passed an examination to prove their in-depth knowledge of Cloudflare Zaraz, including all the ins-and-outs of the tool.</p><p>These certified developers are now available to assist you with everything related to Zaraz, whether it's migration, configuration, or ongoing support. They are well-equipped to ensure that you get the most out of your Zaraz experience, and they have a direct line of communication with the Cloudflare Zaraz team when a need arises.</p><p>Our list of certified developers includes:</p><ul><li><p>Rowan Walker, <a href="https://ginetta.net">Ginetta</a>, Switzerland, <a>rowan@ginetta.net</a></p></li><li><p><a href="http://mammothgrowth.com">Mammoth Growth</a>, USA / EMEA, <a>emea@mammothgrowth.com</a></p></li><li><p>Mackenly Jones, USA, <a href="https://tricitiesmediagroup.com/">Tricities Media Group</a>, <a>hello@tricitiesmediagroup.com</a></p></li><li><p>Beto Garcia, Brazil, <a>beto@zaraz.dev</a></p></li><li><p>Meiki Tanious, USA, <a href="https://scalewhale.com/">Scalewhale</a>, <a>meiki@scalewhale.com</a></p></li><li><p>Hugo Romano, Portugal, <a href="https://adaptive.link">adaptive.link</a>, <a>hugoromano@gmail.com</a></p></li><li><p>Saumya Majumder, India, <a href="https://www.bigscoots.com">BigScoots</a>, <a>saumya0305@gmail.com</a></p></li><li><p>Jan Johannes, Germany / Estonia, <a href="https://www.linkedin.com/in/janjohannes/">LinkedIn Profile</a>, <a>zaraz@ntr.io</a></p></li><li><p>Kristian Primdal, Denmark, <a href="https://rocketbeetle.com">Rocket Beetle</a>, <a>Hi@rocketbeetle.com</a></p></li><li><p>Jen Garcia, USA, <a href="https://haverstack.com">Haverstack</a>, <a>jen@haverstack.com</a></p></li></ul><p>We're also pleased to mention that the majority of the course materials used for training are available online for free. You can explore these resources in our YouTube playlist for the <a href="https://www.youtube.com/playlist?list=PLI6HzeeCy4S_ENMitD7vB2686ipxahtSr">Zaraz Developer Certification Program</a> and empower yourself with the knowledge you need to make the most of Zaraz. The videos total more than 4 hours of deep dive into many areas of how to use Zaraz in the best way.</p><p>In conclusion, our new certified developers play a significant role in extending the ecosystem for Zaraz. We started this process by empowering developers to write their own integrations by <a href="/zaraz-open-source-managed-components-and-webcm/">open-sourcing the Managed Components technology</a>, and we’re now pushing to make Zaraz an even better choice for enterprises and big websites. We encourage you to leverage the Certified Developers expertise to streamline your Zaraz experience, and to explore the wealth of free educational materials at your disposal.</p> ]]></content:encoded>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[Zaraz]]></category>
            <category><![CDATA[Support]]></category>
            <guid isPermaLink="false">4PbyfwPyax5vuTxQWCPIDV</guid>
            <dc:creator>Yo'av Moshe</dc:creator>
        </item>
        <item>
            <title><![CDATA[Cloudflare Zaraz steps up: general availability and new pricing]]></title>
            <link>https://blog.cloudflare.com/cloudflare-zaraz-steps-up-general-availability-and-new-pricing/</link>
            <pubDate>Wed, 19 Jul 2023 16:00:55 GMT</pubDate>
            <description><![CDATA[ Cloudflare Zaraz has transitioned out of beta and is now generally available to all customers. It is included under the free, paid, and enterprise plans of the Cloudflare Developer Platform. Visit our docs to learn more on our different plans ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Cloudflare Zaraz has transitioned out of beta and is now generally available to all customers. It is included under the free, paid, and enterprise plans of the Cloudflare Developer Platform. Visit our docs to learn more on our different <a href="https://developers.cloudflare.com/zaraz/pricing/">plans</a>.</p><p><b>Update, 2023-11-10:</b> <i>Based on customer feedback, we are reevaluating pricing for Zaraz so as to best serve a broad range of use cases. Customers can continue to use Zaraz without charge until further notice. A subset of Zaraz features require a paid ($5/mo) Workers subscription, as they always have.</i></p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/rPskTSxgsxgp3bYGktS6r/2e7a687a00a81d23a85cabd515967f3b/image2-1.png" />
            
            </figure>
    <div>
      <h2>Zaraz is part of the Cloudflare Developer Platform</h2>
      <a href="#zaraz-is-part-of-the-cloudflare-developer-platform">
        
      </a>
    </div>
    <p>Cloudflare Zaraz is a solution that developers and marketers use to load third-party tools like Google Analytics 4, Facebook CAPI, TikTok, and others. With Zaraz, Cloudflare customers can easily transition to server-side data collection with just a few clicks, without the need to set up and maintain their own cloud environment or make additional changes to their website for installation. Server-side data collection, as facilitated by Zaraz, simplifies analytics reporting from the server rather than loading numerous JavaScript files on the user's browser. It's a rapidly growing trend due to browser limitations on using third-party solutions and cookies. The result is significantly faster websites, plus enhanced security and privacy on the web.</p><p>We've had Zaraz in beta mode for a year and a half now. Throughout this time, we've dedicated our efforts to meeting as many customers as we could, gathering feedback, and getting a deep understanding of our users' needs before addressing them. We've been shipping features at a high rate and have now reached a stage where our product is robust, flexible, and competitive. It also offers unique features not found elsewhere, thanks to being built on Cloudflare’s global network, such as Zaraz’s <a href="/dynamic-data-collection-with-zaraz-worker-variables/">Worker Variables</a>. We have cultivated a strong and vibrant discord community, and we have certified <a href="https://www.credly.com/org/cloudflare/badge/cloudflare-zaraz-certified-developer">Zaraz developers</a> ready to help anyone with implementation and configuration.</p><p>With more than 25,000 websites running Zaraz today - from personal sites to those of some of the world's biggest companies - we feel confident it's time to go out of beta, and introduce our new pricing system. We believe this pricing is not only generous to our customers, but also competitive and sustainable. We view this as the next logical step in our ongoing commitment to our customers, for whom we're building the future.</p><p>If you're building a web application, there's a good chance you've spent at least some time implementing third-party tools for analytics, marketing performance, conversion optimization, A/B testing, customer experience and more. Indeed, according to the <a href="https://almanac.httparchive.org/en/2022/third-parties">Web Almanac</a> report, 94% percent of mobile pages used at least one third-party solution in 2022, and third-party requests accounted for 45% of all requests made by websites. It's clear that third-party solutions are everywhere. They have become an integral part of how the web has evolved. Third-party tools are here to stay, and they require effective developer solutions. We are building Zaraz to help developers manage the third-party layer of their website properly.</p><p>Starting today, Cloudflare Zaraz is available to everyone for free under their Cloudflare dashboard, and the paid version of Zaraz is included in the Workers Paid plan. The <a href="https://www.cloudflare.com/plans/free/">Free plan</a> is designed to meet the needs of most developers who want to use Zaraz for personal use cases. For a price starting at $5/month, customers of the Workers Paid plan can enjoy the extensive list of features that makes Zaraz powerful, deploy Zaraz on their professional projects, and utilize the pay-as-you-go system. This is in addition to everything else included in the Workers Paid plan. The <a href="https://www.cloudflare.com/plans/enterprise/">Enterprise plan</a>, on the other hand, addresses the needs of larger businesses looking to leverage our platform to its fullest potential.</p>
    <div>
      <h2>How is Zaraz priced</h2>
      <a href="#how-is-zaraz-priced">
        
      </a>
    </div>
    <p>Zaraz pricing is based on two components: Zaraz Loads and the set of features. A Zaraz Load is counted each time a web page loads the Zaraz script within it, and/or the Pageview trigger is being activated. For Single Page Applications, each URL navigation is counted as a new Zaraz Load. Under the Zaraz <a href="https://dash.cloudflare.com/?to=/:account/:zone/zaraz/monitoring">Monitoring</a> dashboard, you can find a report showing how many Zaraz Loads your website has generated during a specific time period. Zaraz Loads and features are factored into our billing as follows:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1aNg6RuMx8qDdZMzBJu6de/8165ad69bd24662c273fa1e2a4731e0b/image-4.png" />
            
            </figure>
    <div>
      <h3>Free plan</h3>
      <a href="#free-plan">
        
      </a>
    </div>
    <p>The Free Plan has a limit of 100,000 Zaraz Loads per month per account. This should allow almost everyone wanting to use Zaraz for personal use cases, like personal websites or side projects, to do so for free. After 100,000 Zaraz Loads, Zaraz will simply stop functioning.</p><p>Following the same logic, the free plan includes everything you need in order to use Zaraz for personal use cases. That includes <a href="https://developers.cloudflare.com/zaraz/reference/settings/#auto-inject-script">Auto-injection</a>, <a href="https://developers.cloudflare.com/zaraz/web-api/debug-mode/">Zaraz Debugger</a>, <a href="https://developers.cloudflare.com/zaraz/web-api/track/">Zaraz Track</a> and <a href="https://developers.cloudflare.com/zaraz/web-api/set/">Zaraz Set</a> from our <a href="https://developers.cloudflare.com/zaraz/web-api/">Web API</a>, <a href="https://developers.cloudflare.com/zaraz/consent-management/">Consent Management Platform (CMP)</a>, <a href="https://developers.cloudflare.com/zaraz/advanced/datalayer-compatibility/">Data Layer compatibility mode</a>, and many more.</p><p>If your websites generate more than 100,000 Zaraz loads combined, you will need to upgrade to the Workers Paid plan to avoid service interruption. If you desire some of the more advanced features, you can upgrade to Workers Paid and get access for only $5/month.</p>
    <div>
      <h3>Paid plan</h3>
      <a href="#paid-plan">
        
      </a>
    </div>
    <p>The Workers Paid Plan includes the first 200,000 Zaraz Loads per month per account, free of charge.</p><p>If you exceed the free Zaraz Loads allocations, you'll be charged $0.50 for every additional 1,000 Zaraz Loads, but the service will continue to function. (You can set <a href="https://dash.cloudflare.com/?to=/:account/notifications">notifications</a> to get notified when you exceed a certain threshold of Zaraz Loads, to keep track of your usage.)</p><p>Workers Paid customers can enjoy most of Zaraz robust and existing features, amongst other things, this includes: <a href="https://developers.cloudflare.com/zaraz/web-api/ecommerce/">Zaraz E-commerce</a> from our <a href="https://developers.cloudflare.com/zaraz/web-api/">Web API</a>, <a href="https://developers.cloudflare.com/zaraz/reference/settings/#endpoints">Custom Endpoints</a>, <a href="https://developers.cloudflare.com/zaraz/advanced/worker-variables/">Workers Variables</a>, <a href="https://developers.cloudflare.com/zaraz/history/preview-mode/">Preview/Publish Workflow</a>, <a href="https://developers.cloudflare.com/zaraz/reference/settings/#privacy">Privacy Features</a>, and more.</p><p>If your websites generate Zaraz Loads in the millions, you might want to consider the Workers Enterprise plan. Beyond the free 200,000 Zaraz Loads per month for your account, it offers additional volume discounts based on your Zaraz Loads usage as well as Cloudflare’s professional services.</p>
    <div>
      <h3>Enterprise plan</h3>
      <a href="#enterprise-plan">
        
      </a>
    </div>
    <p>The Workers Enterprise Plan includes the first 200,000 Zaraz Loads per month per account free of charge. Based on your usage volume, Cloudflare’s sales representatives can offer compelling discounts. Get in touch with us <a href="https://www.cloudflare.com/zaraz-ent-sign-up/">here</a>. Workers Enterprise customers enjoy all paid enterprise features.</p>
    <div>
      <h2>I already use Zaraz, what should I do?</h2>
      <a href="#i-already-use-zaraz-what-should-i-do">
        
      </a>
    </div>
    <p>If you were using Zaraz under the free beta, you have a period of two months to adjust and decide how you want to go about this change. <b>Nothing will change until September 20, 2023.  Update, 2023-11-10:</b> <i>This pricing has not gone into effect. Please see the note at the top of this post.</i></p><p>In the meantime we advise you to:</p><ol><li><p>Get more clarity of your Zaraz Loads usage. Visit <a href="https://dash.cloudflare.com/?to=/:account/:zone/zaraz/monitoring">Monitoring</a> to check how many Zaraz Loads you had in the previous couple of months. If you are worried about generating more than 100,000 Zaraz Loads per month, you might want to consider upgrading to Workers Paid via the <a href="https://dash.cloudflare.com/?to=/:account/:zone/zaraz/plans">plans</a> page, to avoid service interruption. If you generate a big amount of Zaraz Loads, you’d probably want to reach out to your sales representative and get volume discounts. You can leave your details <a href="https://www.cloudflare.com/zaraz-ent-sign-up/">here</a>, and we’ll get back to you.</p></li><li><p>Check if you are using one of the paid features as listed in the <a href="https://dash.cloudflare.com/?to=/:account/:zone/zaraz/plans">plans</a> page. If you are, then you would need to purchase a Workers Paid subscription, starting at $5/month via the <a href="https://dash.cloudflare.com/?to=/:account/:zone/zaraz/plans">plans</a> page. On September 20, these features will cease to work unless you upgrade.</p></li></ol><p><i>* Please note, as of now, free plan users won't have access to any paid features. However, if you're already using a paid feature without a Workers Paid subscription, you can continue to use it risk-free until September 20. After this date, you'll need to upgrade to keep using any paid features.</i></p>
    <div>
      <h2>We are here for you</h2>
      <a href="#we-are-here-for-you">
        
      </a>
    </div>
    <p>As we make this important transition, we want to extend our sincere gratitude to all our beta users who have provided invaluable feedback and have helped us shape Zaraz into what it is today. We are excited to see Zaraz move beyond its beta stage and look forward to continuing to serve your needs and helping you build better, faster, and more secure web experiences. We know this change comes with adjustments, and we are committed to making the transition as smooth as possible. In the next couple of days, you can expect an email from us, with clear next steps and a way to get advice in case of need. You can always get in touch directly with the Cloudflare Zaraz team on <a href="https://discord.com/invite/2TRr6nSxdd">Discord</a>, or the <a href="https://community.cloudflare.com/c/developers/zaraz/">community</a> forum.</p><p>Thank you for joining us on this journey and for your ongoing support and trust in Cloudflare Zaraz. Let's continue to build the future of the web together!</p> ]]></content:encoded>
            <category><![CDATA[Zaraz]]></category>
            <category><![CDATA[General Availability]]></category>
            <category><![CDATA[Cloudflare Workers]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <guid isPermaLink="false">6FYeJVA2EuSJ4YglfJ9DSF</guid>
            <dc:creator>Yair Dovrat</dc:creator>
        </item>
        <item>
            <title><![CDATA[Cloudflare Zaraz supports JSONata]]></title>
            <link>https://blog.cloudflare.com/zaraz-adds-jsonata-support/</link>
            <pubDate>Tue, 27 Jun 2023 13:00:56 GMT</pubDate>
            <description><![CDATA[ Discover the seamless integration of Cloudflare Zaraz and JSONata, enabling precise data customization for enhanced workflows. Effortlessly optimize data transmission to providers and APIs with ease. Unlock the power of fine-tuned data today ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Cloudflare users leverage Zaraz for loading their third-party JavaScript tools. Tools like analytics, conversion pixels, widgets and alike, <a href="/cloudflare-acquires-zaraz-to-enable-cloud-loading-of-third-party-tools/">load faster and safer when loaded through Zaraz</a>.</p><p>When configuring a tool in Zaraz, users can specify the payload to be included when sending information to it. This allows for the transmission of more detailed data. For example, when sending the "Button Clicked" event to Google Analytics, users can include additional information such as the ID of the button element and the content of the <code>user_id</code> cookie at the time of the button press. In Zaraz, users have the flexibility to add as many fields as desired when configuring the action.</p><p>Typically, information reaches Zaraz through the execution of <code>zaraz.track("event name", { properties })</code> within the website's code. The <code>properties</code> object can contain relevant details that will be sent to third-party tools, such as the button ID in the previous example. However, there are cases where users may need to process and manipulate the information before sending it to their third-party tools.</p><p>To address this requirement, we recently introduced <a href="/dynamic-data-collection-with-zaraz-worker-variables/">Worker Variables</a>, which enables users to send information to a Cloudflare Worker, perform manipulations on it, and return a modified value. This feature offers immense power and flexibility. For instance, users can communicate with their backend server to retrieve data and leverage JavaScript to perform necessary calculations. With Worker Variables, users have access to a fully-featured Worker, opening up endless possibilities.</p><p>However, feedback from our users highlighted the need for a middle-ground solution. Sometimes, the data manipulation required is minor, and employing a Cloudflare Worker might feel like overkill. It is in response to this feedback that we decided to integrate with <a href="https://jsonata.org/">JSONata</a>.</p>
    <div>
      <h3>What is JSONata?</h3>
      <a href="#what-is-jsonata">
        
      </a>
    </div>
    <p>JSONata calls itself a JSON query and transformation language. While some developers may already be familiar with jq, the command-line JSON processor, JSONata offers similar features with a syntax that we believe is more intuitive and easier to understand. Since JSONata is a JavaScript library, it was very easy to integrate into Cloudflare Zaraz.</p><p>Let’s say we have JSON document like the following:</p>
            <pre><code>{
  "name": "Jane Smith",
  "address": {
    "street": "123 High St",
    "city": "London"
  },
  "pets": [
    { "type": "hamster", "name": "Rex" },
    { "type": "parrot", "name": "Milo" },
    { "type": "parrot", "name": "Alfie" }
  ]
}</code></pre>
            <p>With JSONata, with JSONata, one can run interesting queries on the document:</p>
            <pre><code>$count(pets) // 3

address.city // London

pets[type="parrot"].name // ["Alfie", "Milo"]</code></pre>
            <p>The JSONata documentation includes many examples for what you do with it, and there’s even <a href="https://try.jsonata.org/">a playground</a> where you can try your JSONata queries live.</p>
    <div>
      <h3>Using JSONata with Zaraz</h3>
      <a href="#using-jsonata-with-zaraz">
        
      </a>
    </div>
    <p>JSONata has been tightly integrated with Cloudflare Zaraz, allowing you to leverage its capabilities in the fields of all Actions, Triggers, and Variables. Before diving into writing your JSONata expressions, it's essential to understand the JSON document you'll be working with.</p><p>Similar to Worker Variables or the HTTP Request tool, JSONata has access to the Zaraz Context. This object contains information from your <code>zaraz.track()</code> and <code>zaraz.ecommerce()</code> calls, as well as automatically gathered data by Zaraz, such as the current page URL, cookies, page title, user-agent string, and more. You can find the complete reference for this object in <a href="https://developers.cloudflare.com/zaraz/reference/context/">the Zaraz documentation</a>.</p><p>Using your JSONata query is straightforward once you are familiar with it. To incorporate the query into your field content, simply enclose it within double curly brackets. The expression will be passed to JSONata along with the Zaraz Context object, and the resulting value will be used for the field.</p><p>Let's explore two examples from our documentation. Often, there's a need to convert a string to lowercase, such as when comparing it to another value in a regular expression. Suppose the original string is derived from a cookie named <code>loggedIn</code>, that specifies if the current user is logged in. In that case, we can use JSONata to transform the value to lowercase using the expression $lowercase(system.cookies.loggedIn). If we want to use this expression within a trigger, we navigate to the Zaraz dashboard and choose our trigger, locate the relevant match rule, and enter {{ $lowercase(system.cookies.loggedIn) }} as the value. Now, the cookie value will be compared in its lowercase format.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7FgInwKRsFuMNM0YpjuVbn/a950020e078337522054865116403418/image2-39.png" />
            
            </figure><p>You can also run simple calculations. Assuming you are using <code>zaraz.track()</code> to send the cart content like this:</p>
            <pre><code>zaraz.track("Cart Viewed",
  {  products:
	[
	{
  	sku: '2671033',
  	name: 'V-neck T-shirt',
  	price: 14.99,
  	quantity: 3
	},{
  	sku: '2671034',
  	name: 'T-shirt',
  	price: 10.99,
  	quantity: 2
	},
	],
  }
);</code></pre>
            <p>If the field in which you want to include the total sum of all products, you will enter {{ $sum(client.products.(price * quantity)) }}. This will multiply the price of each product by its quantity, and then sum up the total.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6nbdz3jTkzgSojEw0MhXqU/694840931e008023c4508c0ac5088458/image3-31.png" />
            
            </figure>
    <div>
      <h3>Start using JSONata today</h3>
      <a href="#start-using-jsonata-today">
        
      </a>
    </div>
    <p>JSONata support is available to all Zaraz users at no cost, and it is enabled automatically for all websites. Start using JSONata today to send finely tuned data to your providers or APIs with minimal code and zero maintenance for your data infrastructure. If you need any help - join <a href="https://discord.gg/2TRr6nSxdd">our Discord channel</a>!</p> ]]></content:encoded>
            <category><![CDATA[Zaraz]]></category>
            <guid isPermaLink="false">11BUBHj8lD7Rox2DYHBmft</guid>
            <dc:creator>Yo'av Moshe</dc:creator>
        </item>
        <item>
            <title><![CDATA[Dynamic data collection with Zaraz Worker Variables]]></title>
            <link>https://blog.cloudflare.com/dynamic-data-collection-with-zaraz-worker-variables/</link>
            <pubDate>Fri, 02 Jun 2023 13:00:37 GMT</pubDate>
            <description><![CDATA[ A guided tour of Cloudflare Zaraz new exciting premium feature, available for Workers paid account: Worker Variables, that allows to pipe a Worker’s response to third-party tools ]]></description>
            <content:encoded><![CDATA[ <p></p>
    <div>
      <h2>Bringing dynamic data to the server</h2>
      <a href="#bringing-dynamic-data-to-the-server">
        
      </a>
    </div>
    <p>Since its inception, Cloudflare Zaraz, the server-side third-party manager built for speed, privacy and security, has strived to offer a way for marketers and developers alike to get the data they need to understand their user journeys, without compromising on page performance. Cloudflare Zaraz makes it easy to transition from traditional client-side data collection based on marketing pixels in users’ browsers, to a server-side paradigm that shares events with vendors from our global network.</p><p>When implementing data collection on websites or mobile applications, analysts and digital marketers usually first define the set of interactions and attributes they want to measure, formalizing those requirements along technical specifications in a central document (“tagging plan”). Developers will later implement the required code to make those attributes available for the third party manager to pick it up. For instance, an analyst may want to analyze page views based on an internal name instead of the page title or page pathname. They would therefore define an example “page name” attribute that would need to be made available in the context of the page, by the developer. From there, the analyst would configure the tag management system to pick the attribute’s value before dispatching it to the analytics tool.</p><p>Yet, while the above flow works fine in theory, the reality is that analytics data comes from multiple sources, in multiple formats, that do not always fit the initially formulated requirements.</p><p>The industry accepted solution, such as Google Tag Manager’s “Custom JavaScript variables” or Adobe’s “Custom Code Data Elements”, was to offer a way for users to dynamically invoke custom JavaScript functions on the client, allowing them to perform cleaning (like removing <a href="https://www.cloudflare.com/learning/privacy/what-is-pii/">PII</a> data from the payload before sending it to Google Analytics), transformations (extracting specific product attributes out of a product array) or enrichment (making an API call to grab the current user’s CRM id to stitch user sessions in your analytics tool) to the data before dispatch by the third-party manager.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3sfkvI2lFiklly7ACVKBUt/d9c0df858770bfcccdfe170f575f0449/image5.png" />
            
            </figure><p><i>Example of Google Tag Manager custom javascript variable that aggregates individual items prices from a javascript array of product information.</i> </p><p>Having the ability to run custom JavaScript is a powerful feature that offers a lot of flexibility and yet, was a missing part of Cloudflare Zaraz. While some workarounds existed, it did not really fit with Cloudflare Zaraz’s objective of high-performance. We needed a way for our users to provide custom code to be executed fast, server-side. Quite fast, it was clear that Cloudflare Workers, the globally distributed serverless V8-based JavaScript runtime was the solution.</p>
    <div>
      <h2>Worker Variables to the rescue</h2>
      <a href="#worker-variables-to-the-rescue">
        
      </a>
    </div>
    <p>Cloudflare Zaraz Worker Variables is powered by Cloudflare Workers, our platform for running custom code on our global network, but let’s take a step back and work through how Cloudflare Zaraz is implemented.</p><p>When making a request to a website proxied by Cloudflare, a few things will run before making it to your origin. This includes the <a href="https://www.cloudflare.com/learning/security/what-is-a-firewall/">firewall</a>, <a href="https://www.cloudflare.com/learning/ddos/ddos-mitigation/">DDoS mitigation</a>, <a href="https://www.cloudflare.com/learning/cdn/what-is-caching/">caching</a>, and also something called First-Party Workers.</p><p>These First-Party Workers are Cloudflare Workers with special permissions. Cloudflare Zaraz is one of them. Our Worker is built in a way that allows variables to be replaced by their contents. Those variables can be used in places where you would be reusing hardcoded text, to make it easier to make changes to all places where it would be used. For example, the name of your site, a secret key, etc:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3d0HtJuGQ48bBaR1E12Vxa/066ef2ee4a805cbc2845092747227437/download.png" />
            
            </figure><p>These variables can then be used in any of Cloudflare Zaraz’s components, by selecting them right from the dashboard as a property, or as part of a component’s settings:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/Ul5prIjaIgSxn9dgixxUq/f0aae2d7b1156c3dd33cc932b47b7ce1/download--1-.png" />
            
            </figure><p>When using a Worker Variable, instead of replacing your variable with a hardcoded string, we instead execute the custom code hosted in your own Cloudflare Worker that you have associated with the variable. The response of which is then being used as the variable’s value. Calling one worker from within the Cloudflare Zaraz Worker is done using <a href="https://developers.cloudflare.com/cloudflare-for-platforms/workers-for-platforms/get-started/dynamic-dispatch/">Dynamic Dispatch</a>.</p><p>In our Cloudflare Zaraz Worker, calling Dynamic Dispatch is very similar to how your regular, everyday worker might do it. From having a binding in our wrangler.toml:</p>
            <pre><code>...
unsafe.bindings = [
  { name = "DISPATCHER", type = "dynamic_dispatch", id_prefix = "", first_party = true },
]</code></pre>
            <p>To having our code responsible for variables actually call your worker:</p>
            <pre><code>if (variable.type === 'worker') {
  // Get the persistent ID of the Worker
  const mutableId = variable.value.mutableId
  // Get the binding for the specific Worker
  const workerBinding = context.env.DISPATCHER.get(mutableId)
  ...
  // Execute the Worker and return the response
  const workerResponse = await workerBinding.fetch(
    new Request(String(url || context.url || 'http://unknown')),
    {
      method: 'POST',
      headers: {
        'Content-type': 'application/json',
      },
      body: JSON.stringify(payload),
    }
  )
  ...
  return workerResponse
}</code></pre>
            
    <div>
      <h2>Benefits of Cloudflare Zaraz Worker Variables</h2>
      <a href="#benefits-of-cloudflare-zaraz-worker-variables">
        
      </a>
    </div>
    <p>Cloudflare Workers is a world-class solution to build complex applications. Together with Cloudflare Zaraz, we feel that makes it the ideal platform to orchestrate your data workflows:</p><p><b>Build with context:</b> Cloudflare Zaraz automatically shares the context as part of the call to the Cloudflare Zaraz Worker, allowing you to use that data as input to your functions. Cloudflare Zaraz offers a Web API which customers can use to track important events in their users' journeys. Along with the <a href="https://developers.cloudflare.com/zaraz/web-api/">Web API</a>, Zaraz offers ways for users to define custom attributes, called “Track properties” and “Variables”, that allow our customers to provide additional context to the event getting sent to a vendor. The Cloudflare Zaraz context holds every attribute that was tracked by Cloudflare Zaraz as part of the current visitor session along with other generic attributes like the visitors’ device cookies for instance.</p><p><b>Speed:</b> In comparison to manually calling a worker from client-side JavaScript, this saves the roundtrip to the Worker’s HTTP endpoint and gives you access to Cloudflare Zaraz properties, allowing you to work with client-side data right from our global network.</p><p><b>Isolated environment:</b> As the function is executed inside the worker, which lives outside of your visitor browser, it cannot access the DOM or JavaScript runtime from the browser, preventing potential bugs in your Worker’s code from affecting the experience of your user.</p><p>When combining Worker Variables with the Custom HTML tool, you also get the benefits of offloading client-side JavaScript to a worker. This improves performance for both AJAX network requests, which can then be executed directly from Cloudflare’s global network, as well as the offloading of resource intensive tasks to a Worker, such as data manipulation or computations. All whilst keeping your API secrets and other sensitive data hidden from the clients, allowing you to only send the results that are actually needed by the client.</p>
    <div>
      <h2>Examples walkthrough</h2>
      <a href="#examples-walkthrough">
        
      </a>
    </div>
    <p>Now that you are more familiar with the concept, let’s get to some practical use cases!</p><p>We will cover two examples: translating a GTM custom JavaScript variable to a Cloudflare Zaraz Worker variable, and enriching user information with data from an external API.</p><p><b>Translate a GTM Custom JavaScript variable into Cloudflare Zaraz Worker Variable:</b> Let’s take our previous example, Google Tag Manager custom javascript variable that aggregates individual items prices from a JavaScript array of product information.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6rKsqZgzkYfc73sPhsRKLU/c7c8884f986a74ed1c6ca7e6105c5504/download--2-.png" />
            
            </figure><p>The function makes use of a “GTM Data Layer Variable” (represented with double curly braces, line 2, “{{DLV - Ecommerce - Purchase - Products }}”). That kind of variable is equivalent to Track Properties in Cloudflare Zaraz land: they are a way to access the value of a custom attribute that you shared with the third party manager. When translating from GTM to Cloudflare Zaraz, one should take care of making sure that such variables have also been translated to their Cloudflare Zaraz counterpart.</p><p>Back to our example, let’s say that the GTM variable “DLV - Ecommerce - Purchase - Products” is equal to a track property “products” in Cloudflare Zaraz. Your first step is to parse the Cloudflare Zaraz context ($1), that gives you two objects: <i>client,</i> holding all track properties set in the current visitor context and <i>system</i> that gives you access to some generic properties of the visitor’s device.</p><p>You can then reference a specific track property by accessing it from the client object. ($2)</p><p>The variable code was aggregating price from product information into a comma-separated string. For this, we can keep the same code. ($3)</p><p>A major difference between javascript functions executed in the client and Workers is that the worker should “return” the value as part of a Response object. ($4)</p>
            <pre><code>export default {
  async fetch(request, env) {
    // $1 Parse the Zaraz Context object
    const { system, client } = await request.json();

    // $2 Get a reference to the products track property
    const products = client.products;

    // $3 Calculate the sum
    const prices = products.map(p =&gt; p.price).join();

    return new Response(prices);
  },
};</code></pre>
            <p><b>Enriching user information with data coming from an API:</b> For this second example, let’s imagine that we want to synchronize user activity online and offline. To do so, we need a common key to reconcile the user journeys. A CRM id looks like an appropriate candidate for that use case. We will obtain this id through the CRM solution API (the fictitious “<a href="https://example.com/api/getUserIdFromCookie">https://example.com/api/getUserIdFromCookie</a>”) Our primary key, that will be used to lookup the user CRM id, will be taken from a cookie that holds the current user session id.</p>
            <pre><code>export default {
  async fetch(request, env) {
    // Parse the Zaraz Context object
    const { system, client } = await request.json();

    // Get the value of the cookie "login-cookie"
    const cookieValue = system.cookies["login-cookie"];

    const userId = await fetch("https://example.com/api/getUserIdFromCookie", {
      method: POST,
      body: cookieValue,
    });

    return new Response(userId);
  },
};</code></pre>
            
    <div>
      <h2>Start using Worker Variables today</h2>
      <a href="#start-using-worker-variables-today">
        
      </a>
    </div>
    <p>Worker Variables are available for all accounts with a <a href="https://workers.cloudflare.com/">paid Workers subscription</a> (starting at $5 / month).</p>
    <div>
      <h3>Create a worker</h3>
      <a href="#create-a-worker">
        
      </a>
    </div>
    <p>To use a Worker Variable, you first need to create a new Cloudflare Worker. You can do this through the Cloudflare dashboard or by using Wrangler.</p><p>To create a new worker in the Cloudflare dashboard:</p><ol><li><p>Log in to the Cloudflare dashboard.</p></li><li><p>Go to Workers and select Create a Service.</p></li><li><p>Give a name to your service and choose the HTTP Handler as your starter template.</p></li><li><p>Click Create Service, and then Quick Edit.</p></li></ol><p>To create a new worker through Wrangler:</p><p>1. Start a new Cloudflare Worker project</p>
            <pre><code>$ npx wrangler init my-project
$ cd my-project</code></pre>
            <p>2. Run your development server</p>
            <pre><code>$ npx wrangler dev</code></pre>
            <p>3. Start coding</p>
            <pre><code>// my-project/index.js || my-project/index.ts
export default {
 async fetch(request) {
   // Parse the Zaraz Context object
   const { system, client } = await request.json();

   return new Response("Hello World!");
 },
};</code></pre>
            
    <div>
      <h3>Configure a Worker Variable</h3>
      <a href="#configure-a-worker-variable">
        
      </a>
    </div>
    <p>With your Cloudflare Worker freshly configured and published, it is straightforward to configure a Worker Variable:</p><p>1. Log in to the <a href="https://dash.cloudflare.com/">Cloudflare dashboard</a></p><p>2. Go to Zaraz &gt; Tools configuration &gt; Variables.</p><p>3. Click Create variable.</p><p>4. Give your variable a name, choose Worker as the Variable type, and select your newly created Worker.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/732xTq8t3rSFXYLhQW8MRQ/45897f978629609171f42fd75eacd85a/download--3-.png" />
            
            </figure><p>5. Save your variable.</p>
    <div>
      <h3>Use your Worker Variable</h3>
      <a href="#use-your-worker-variable">
        
      </a>
    </div>
    <p>It is now time to use your Worker Variable! You can reference your variable as part of a trigger or an action. To set it up for a specific action for instance:</p><ol><li><p>Go to Zaraz &gt; Tools configuration &gt; Tools.</p></li><li><p>Click Edit next to a tool that you have already configured.</p></li><li><p>Select an action or add a new one.</p></li><li><p>Click on the plus sign at the right of the text fields.</p></li><li><p>Select your Worker Variable from the list.</p></li></ol>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6r4r6wdhzIvUTQGTtNAxUA/548ac1a409dfc06fd92bdfbf599d716b/download--4-.png" />
            
            </figure> ]]></content:encoded>
            <category><![CDATA[Zaraz]]></category>
            <category><![CDATA[Cloudflare Workers]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <guid isPermaLink="false">7jTsXZZbaSbRNtiMDO7QS3</guid>
            <dc:creator>Tom Klein</dc:creator>
            <dc:creator>Lucas Kostka</dc:creator>
        </item>
        <item>
            <title><![CDATA[Consent management made easy and clear with Cloudflare Zaraz]]></title>
            <link>https://blog.cloudflare.com/consent-manager/</link>
            <pubDate>Tue, 18 Apr 2023 13:01:00 GMT</pubDate>
            <description><![CDATA[ Cloudflare Zaraz now can also help you with gathering and managing consent. With this new tool, you can easily collect user’s consent preferences on your website, using a consent modal, and apply your consent policy on third-party tools you load via Cloudflare Zaraz ]]></description>
            <content:encoded><![CDATA[ <p></p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2Awa4udBp1dDAtBaIt7BxA/4952caa7d70eab3a382bd4cd07059e82/image6-5.png" />
            
            </figure><p>Depending on where you live you may be asked to agree to the use of cookies when visiting a website for the first time. And if you've ever clicked something other than Approve you'll have noticed that the list of choices about which services should or should not be allowed to use cookies can be very, very long. That's because websites typically incorporate numerous third party tools for tracking, A/B testing, retargeting, etc. – and your consent is needed for each one of them.</p><p>For website owners it's really hard to keep track of which third party tools are used and whether they've asked end users about all of them. There are tools that help you load third-party scripts on your website, and there are tools that help you manage and gather consent. Making the former respect the choices made in the latter is often cumbersome, to say the least.</p><p>This changes with Cloudflare Zaraz, a solution that makes third-party tools secure and fast, and that now can also help you with gathering and managing consent. Using the Zaraz Consent Manager, you can easily collect users’ consent preferences on your website, using a consent modal, and apply your consent policy on third-party tools you load via Cloudflare Zaraz. The consent modal treats all the tools it handles as opt-in and lets users accept or reject all of those tools with one click.</p>
    <div>
      <h3>The future is private</h3>
      <a href="#the-future-is-private">
        
      </a>
    </div>
    <p>The privacy landscape around analytics cookies, retargeting cookies, and similar tracking technologies is changing rapidly. Last year in Europe, for example, the French data regulator <a href="https://www.techspot.com/news/92899-french-privacy-regulator-hits-google-facebook-fines-over.html">fined Google and Facebook</a> millions of euros for making it too difficult for users to reject all cookies. Meanwhile, in California, there have been <a href="https://oag.ca.gov/news/press-releases/attorney-general-bonta-announces-settlement-sephora-part-ongoing-enforcement">enforcement actions</a> on retargeting cookies, and new laws on retargeting come into effect in 2023 in California and a handful of other states. As a result, more and more companies are growing wary of potential liability related to data processing activities performed by third party scripts that use additional cookies on their websites.</p><p>While the legal requirements vary by jurisdiction, creating a compliance headache for companies trying to promote their goods and services, one thing is clear about the increasing spate of regulation around trackers and cookies – end users need to be given notice and have the opportunity to consent to these trackers.</p><p>In Europe, such consent needs to occur before third-party scripts are loaded and executed. Unfortunately, we’ve noticed that this doesn’t always happen. Sometimes it’s because the platform used to generate the consent banner makes it hard to set up in a way that would block those scripts until consent is given. This is a pain point on the road to compliance for many small website owners.</p><p>Some consent modals are designed in a deceptive manner, using <a href="https://en.wikipedia.org/wiki/Dark_pattern">dark patterns</a> that make the process to refuse consent much more difficult and time-consuming than giving consent. This is not only frustrating to the end users, but also something that regulators are taking enforcement actions to stop.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1AxVsdnSSPty4HZIT0dlrp/5721ead68a3203f7362157cf30c8d834/image3-4.png" />
            
            </figure><p>Cookie banner on a website. Refusing consent to cookies is made harder and time-consuming than giving consent, which can at best be frustrating to users and at worst draw enforcement actions from regulators in a number of jurisdictions.</p>
    <div>
      <h3>Making consent handling easy</h3>
      <a href="#making-consent-handling-easy">
        
      </a>
    </div>
    <p>Cloudflare Zaraz is a tool that lets you offload most of third-party scripts’ jobs to Cloudlare Workers, significantly increasing the performance and decreasing the time it takes for your site to become fully interactive. To achieve this, users configure third-party scripts in the dashboard. This means Cloudflare Zaraz already has information on what scripts to load <b>and</b> the power to not execute scripts under certain conditions. This is why the team developed a consent modal that would integrate with tools already set up in the dashboard and make it dead-simple to configure.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4LDvdRPTB1yf3IYXt29lvH/b60d35786124c27cea9606d2a77346d9/image1-10.png" />
            
            </figure>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6yvNsoB34fCanLFbJcLXOw/784d410eda6c54dd8a3ebee3240ff1d9/image4-4.png" />
            
            </figure><p>To start working with the consent functionality, you just have to provide basic information about the administrator of the website (name, street address, email address), and assign a purpose to each of the tools that you want to be handled by the consent modal. The consent modal will then automatically appear to all the users of your website. You can easily customize the CSS styles of the modal to make it match your brand identity and other style guidelines.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1IE4UaAEQLTyNxPy0IMWwy/937ac74c906b62697098b2fa5185996a/image2-7.png" />
            
            </figure><p>In line with Europe’s ePrivacy Directive and General Data Protection Regulation (GDPR), we’ve made all consent opt-in: that is, trackers or cookies that are not strictly necessary are disabled by default and will only execute after being enabled. With our modal, users can refuse consent to all purposes with one click, and can accept all purposes just as easily, or they can pick and choose to consent to only certain purposes.</p><p>The natural consequence of the opt-in nature of consent is the fact that first-time users will not immediately be tracked with tools handled by the consent modal. Using traditional consent management platforms, this could lead to loss of important pageview events. Since Cloudflare Zaraz is tightly integrated with the loading and data handling of all third-party tools on your website, it prevents this data loss automatically. Once a first-time user gives consent to a purpose tied to a third-party script, Zaraz will re-emit the pageview event just for that script.</p><p>There’s still more features coming to the consent functionality in the future, including giving the option to make some purposes opt-out, internationalization, and analytics on how people interact with the modal.</p><p><a href="https://dash.cloudflare.com/?to=/:account/:zone/zaraz/consent">Try Zaraz Consent</a> to see for yourself that consent management can be easy to set up: block scripts that don’t have the user’s consent and respect the end-users’ right to choose what happens to their data.</p> ]]></content:encoded>
            <category><![CDATA[Zaraz]]></category>
            <category><![CDATA[Privacy]]></category>
            <guid isPermaLink="false">12uLpkcGsA8ayvKnAgqD34</guid>
            <dc:creator>Kuba Orlik</dc:creator>
        </item>
        <item>
            <title><![CDATA[Cloudflare Zaraz supports Managed Components and DLP to make third-party tools private]]></title>
            <link>https://blog.cloudflare.com/zaraz-uses-managed-components-and-dlp-to-make-tools-private/</link>
            <pubDate>Thu, 22 Sep 2022 13:15:00 GMT</pubDate>
            <description><![CDATA[ Third party tools are the only thing you can’t control on your website, unless you use Managed Components with Cloudflare Zaraz ]]></description>
            <content:encoded><![CDATA[ <p></p><p>When it comes to privacy, much is in your control as a website owner. You decide what information to collect, how to transmit it, how to process it, and where to store it. If you care for the privacy of your users, you’re probably taking action to ensure that these steps are handled sensitively and carefully. If your website includes no third party tools at all - no analytics, no conversion pixels, no widgets, nothing at all - then it’s probably enough! But… If your website is one of the other <a href="https://almanac.httparchive.org/en/2021/third-parties#prevalence">94% of the Internet</a>, you have some third-party code running in it. Unfortunately, you probably can’t tell what exactly this code is doing.</p><p>Third-party tools are great. Your product team, marketing team, BI team - they’re all right when they say that these tools make a better website. Third-party tools can help you understand your users better, embed information such as maps, chat widgets, or measure and attribute conversions more accurately. The problem doesn’t lay with the tools themselves, but with the way they are implemented - third party scripts.</p><p>Third-party scripts are pieces of JavaScript that your website is loading, often from a remote web server. Those scripts are then parsed by the browser, and they can generally do everything that your website can do. They can change the page completely, they can write cookies, they can read form inputs, URLs, track visitors and more. It is mostly a restrictions-less system. They were built this way because it used to be the only way to create a third-party tool.</p><p>Over the years, companies have suffered a lot of third party scripts. Those scripts were sometimes hacked, and started hijacking information from visitors to websites that were using them. More often, third party scripts are simply collecting information that could be sensitive, exposing the website visitors in ways that the website owner never intended.</p><p>Recently we announced that we’re <a href="/zaraz-open-source-managed-components-and-webcm/">open sourcing Managed Components</a>. Managed Components are a new API to load third-party tools in a secure and privacy-aware way. It changes the way third-party tools load, because by default there are no more third-party scripts in it at all. Instead, there are components, which are controlled with a Components Manager like Cloudflare Zaraz.</p><p>In this blogpost we will discuss how to use Cloudflare Zaraz for granting and revoking permissions from components, and for controlling what information flows into components. Even more exciting, we’re also announcing the upcoming DLP features of Cloudflare Zaraz, that can report, mask and remove PII from information shared with third-parties by mistake.</p>
    <div>
      <h3>How are Managed Components better</h3>
      <a href="#how-are-managed-components-better">
        
      </a>
    </div>
    <p>Because Managed Components run isolated inside a Component Manager, they are more private by design. Unlike a script that gets unlimited access to everything on your website, a Managed Component is transparent about what kind of access it needs, and operates under a Component Manager that grants and revokes permissions.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1EuG2CBtMMzntuSxAUitM7/b5050ef0a920eb844722fb053eae97a2/image2-29.png" />
            
            </figure>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/74tVvRvb4mqpWnotyCzBJd/13a7e0361b7d3b854faae19ef3a27259/image3-21.png" />
            
            </figure><p>When you add a Managed Component to your website, the Component Manager will list all the permissions required for this component. Such permissions could be “setting cookies”, “making client-side network requests”, “installing a widget” and more. Depending on the tool, you’ll be able to remove permissions that are optional, if your website maintains a more restrictive approach to privacy.</p><p>Aside from permissions, the Component Manager also lets you choose what information is exposed to each Managed Component. Perhaps you don’t want to send IP addresses to Facebook? Or rather not send user agent strings to Mixpanel? Managed Components put you in control by telling you exactly what information is consumed by each tool, and letting you filter, mask or hide it according to your needs.</p>
    <div>
      <h3>Data Loss Prevention with Cloudflare Zaraz</h3>
      <a href="#data-loss-prevention-with-cloudflare-zaraz">
        
      </a>
    </div>
    <p>Another area we’re working on is developing DLP features that let you decide what information to forward to different Managed Components not only by the field type, e.g. “user agent header” or “IP address”, but by the actual content. DLP filters can scan all information flowing into a Managed Component and detect names, email addresses, SSN and more – regardless of which field they might be hiding under.</p><p>Our DLP Filters will be highly flexible. You can decide to only enable them for users from specific geographies, for users on specific pages, for users with a certain cookie, and you can even mix-and-match different rules. After configuring your DLP filter, you can set what Managed Components you want it to apply for – letting you filter information differently according to the receiving target.</p><p>For each DLP filter you can choose your action type. For example, you might want to not send any information in which the system detected a SSN, but to only report a warning if a first name was detected. Masking will allow you to replace an email address like <a>user@example.com</a> with <a>xxxx@xxxxxxx.xxx</a>, making sure events containing email addresses are still sent, but without exposing the address itself.</p><p>While there are many DLP tools available in the market, we believe that the integration between Cloudflare Zaraz’s DLP features and Managed Components is the safest approach, because the DLP rules are effectively fencing the information not only before it is being sent, but before the component even accesses it.</p>
    <div>
      <h3>Getting started with Managed Components and DLP</h3>
      <a href="#getting-started-with-managed-components-and-dlp">
        
      </a>
    </div>
    <p>Cloudflare Zaraz is the most advanced Component Manager, and you can start using it today. If your third-party tool of course is missing a Managed Component, you can always write a Managed Component of your own, as the technology is completely open sourced.</p><p>While we’re working on bringing advanced permissions handling, data masking and DLP Filters to all users, you can <a href="https://www.cloudflare.com/managed-components-dlp-sign-up-landing-page">sign up for the closed beta</a>, and we’ll contact you shortly.</p> ]]></content:encoded>
            <category><![CDATA[GA Week]]></category>
            <category><![CDATA[General Availability]]></category>
            <category><![CDATA[Managed Components]]></category>
            <category><![CDATA[Zaraz]]></category>
            <category><![CDATA[Privacy]]></category>
            <guid isPermaLink="false">h2Kzx1Myhhy69aC5CGlzt</guid>
            <dc:creator>Yo'av Moshe</dc:creator>
        </item>
        <item>
            <title><![CDATA[Building and using Managed Components with WebCM]]></title>
            <link>https://blog.cloudflare.com/building-using-managed-components-webcm/</link>
            <pubDate>Wed, 03 Aug 2022 13:00:00 GMT</pubDate>
            <description><![CDATA[ This is how Managed Components can be useful for you right now, if you manage a website or if you’re building third-party tools ]]></description>
            <content:encoded><![CDATA[ 
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7koVQfRWyZu6sTtWX8hQBt/2d979591dd76e7392bdfc72e0b242c59/image1-6.png" />
            
            </figure><p>Managed Components are here to shake up the way third-party tools integrate with websites. Two months ago we announced that <a href="/zaraz-open-source-managed-components-and-webcm/">we’re open sourcing parts of the most innovative technologies behind Cloudflare Zaraz</a>, making them accessible and usable to everyone online. Since then, we’ve been working hard to make sure that the code is well documented and all pieces are fun and easy to use. In this article, I want to show you how Managed Components can be useful for you right now, if you manage a website or if you’re building third-party tools. But before we dive in, let’s talk about the past.</p>
    <div>
      <h3>Third-party scripts are a threat to your website</h3>
      <a href="#third-party-scripts-are-a-threat-to-your-website">
        
      </a>
    </div>
    <p>For decades, if you wanted to add an analytics tool to your site, a chat widget, a conversion pixel or any other kind of tool – you needed to include an external script. That usually meant adding some code like this to your website:</p>
            <pre><code>&lt;script src=”https://example.com/script.js”&gt;&lt;/script&gt;</code></pre>
            <p>If you think about it – it’s a pretty terrible idea. Not only that you’re now asking the browser to connect to <i>another</i> server, fetch and execute <i>more</i> JavaScript code – you’re also completely giving up the control on your website. How much do you really trust this script? And how much do you trust that the script’s server wasn’t hacked, or will never get hacked in the future? In the previous blog post we showed <a href="/zaraz-use-workers-to-make-third-party-tools-secure-and-fast/#how-third-party-tools-work-today">how including one script usually results in more network calls</a>, hogging the browser and slowing everything down. But the worst thing about these scripts is that they are completely unrestricted: JavaScript code running in the browser can hijack users, steal their credentials or credit card information, use their devices to mine cryptocurrencies, manipulate your website, leak PII, and more. Since the code in those scripts is usually minified, it’s practically impossible for you to read it and figure out what it’s doing.</p><p>Managed Components change all that. Like apps on your phone, they’re built around a permissions system. You decide if you allow a component to connect to a remote server, if you allow it to use cookies, to run code, to inject a widget to pages and more. Unlike the world of minified external scripts, it is a framework that promotes transparency. Website owners can toggle permissions on and off, and if a Managed Component wasn’t granted a permission, it will not have access to the relevant API.</p><p>But Managed Components do more than wrapping the current system with permissions – they also provide functionality that was never available before: making server-side connections, caching information, using a key-value store, manipulating responses before they are handed to the browser and more. The core of this functionality comes from the ability to execute code outside the browser. Freeing the browser from running code that was previously executed in the browser, means that <a href="/cloudflare-acquires-zaraz-to-enable-cloud-loading-of-third-party-tools/">your website can become approximately 40% faster</a>. It also results in a smaller attack surface in case your tool’s vendor gets hacked.</p><p>All of this is possible thanks to the new <a href="https://managedcomponents.dev/">Managed Components API</a>. We designed it together with vendors, to make sure you can use them to write any tool, while keeping performance, security and privacy a top priority. At its core, a Managed Component is just a JavaScript module, and so every JavaScript developer should feel right at home when building one. Check out the <a href="/zaraz-open-source-managed-components-and-webcm/#introducing-managed-components">two examples</a> in our previous blog post to see how they actually look like, or see some <a href="https://github.com/managed-components/">Managed Components we already open sourced on GitHub</a>.</p>
    <div>
      <h3>WebCM is the open source Component Manager</h3>
      <a href="#webcm-is-the-open-source-component-manager">
        
      </a>
    </div>
    <p>When tools are loaded with a <code>&lt;script&gt;</code> tag, their code is executed by the browser. Since Managed Components don’t run in the browser, their code needs to be executed somewhere else. This is the Component Manager. We designed the APIs around Managed Components deliberately to not be tied to a specific Component Manager, and in fact, there are already two in the world: Cloudflare Zaraz, and WebCM.</p><p><a href="http://webcm.dev/">WebCM, Web-based Component Manager</a>, is our open source reference implementation of a Component Manager. If you run a website, you can use WebCM today to run Managed Components on your website, even if you’re not a Cloudflare user. If you want to create a Managed Component, you can use it like an SDK.</p><p>Over the last few months, we’ve been helping vendors to write their own Managed Components, and we will continue to do so. We open sourced WebCM to ensure that Managed Components are a technology of the Web as a whole. Everyone should be able to use WebCM to load and create Managed Components. Let’s see how to use it!</p>
    <div>
      <h3>Getting started with WebCM in 5 minutes</h3>
      <a href="#getting-started-with-webcm-in-5-minutes">
        
      </a>
    </div>
    <p>Getting started with WebCM is easier than you think. Because WebCM works like a proxy, you can use it regardless of how your website is built. In a new folder, create a simple HTML file and call it <code>index.html</code>:</p>
            <pre><code>&lt;!DOCTYPE html&gt;
&lt;html lang=”en”&gt;
  &lt;head&gt;
	&lt;meta charset="UTF-8"&gt;
	&lt;title&gt;My Website&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
    	&lt;h1&gt;WebCM test website&lt;/h1&gt;  
  &lt;/body&gt;
&lt;/html&gt;</code></pre>
            <p>Let’s serve this file by launching an HTTP serve in the same folder:</p><p>You can use Node.js:</p>
            <pre><code>npx http-server -p 8000</code></pre>
            <p>You can use Python:</p>
            <pre><code>python3 -m http.server</code></pre>
            <p>Or anything else that would serve our HTML file on <a href="http://localhost:8000/index.html">http://localhost:8000/index.html</a>.</p><p>Next, create a configuration file for WebCM. In a new directory, create a file called <code>webcm.config.ts</code>.</p>
            <pre><code>export default {
  components: [
    {
      name: 'demo',
      permissions: [
        'access_client_kv',
        'provide_server_functionality',
        'provide_widget',
        'serve_static_files',
        'client_network_requests',
      ],
    },
  ],
  target: 'http://127.0.0.1:8000',
  hostname: 'localhost',
  trackPath: '/webcm/track',
  ecommerceEventsPath: '/webcm/ecommerce',
  clientEventsPath: '/webcm/system',
  port: 8080
}</code></pre>
            <p>Let’s go over this configuration file:</p><ul><li><p><code>components</code> is an array that lists all the Managed Components you want to load. For now, we will load the demo component. Note that all we needed was to specify “demo”, and WebCM will go and get it from NPM for us. Other Managed Components <a href="https://www.npmjs.com/org/managed-components">are available on NPM</a> too, and you can install components from other sources too. For each component, we’re defining what <code>permissions</code> we are giving it. You can read more about the permissions in the <a href="https://managedcomponents.dev/specs/manifest/permissions">specifications</a>. If we try to add the component without granting it its required permissions, WebCM will alert us.</p></li><li><p><code>target</code> is where our origin HTTP server runs. In the previous step, we set it to run on port 8000.</p></li><li><p><code>port</code> is the port under which WebCM will serve our website.</p></li><li><p><code>hostname</code> is the host WebCM will bind to.</p></li><li><p><code>trackPath</code>, <code>clientEventsPath</code>, <code>ecommerceEventsPath</code> are paths that WebCM will use to send events from the browser to its backend. We can leave these paths as they are for now, and will see how they’re used later.</p></li></ul><p>! Note: Node version 17 or higher is needed for the next section</p><p>While keeping your HTTP server running, and in the same directory as <code>webcm.config.ts</code>, run <code>npx webcm</code>. Node will fetch WebCM and start it for you, and WebCM will read the configuration. First, it will fetch the required components to a <code>components</code> folder. When done, it will start another server that proxies your origin.</p><p>If you open <a href="http://localhost:8080/index.html">http://localhost:8080/index.html</a> in your browser now, you’d see the same page you saw at <a href="http://localhost:8000/index.html">http://localhost:8000/index.html</a>. While the pages might look similar, the one running on port <code>8080</code> has our demo Managed Component running. Moving your mouse and clicking around the page should result in messages being printed in your WebCM terminal, showing that the component was loaded and that it is receiving data. You will also notice that the page now displays a simple weather widget - this a <a href="https://managedcomponents.dev/specs/embed-and-widgets/widgets">Managed Component Widget</a> that got appended to your page. The weather information was fetched without the browser needing to contact any additional server, and WebCM can cache that information to make sure it is served fast. Lastly, if you go to <a href="http://localhost:8080/webcm/demo/cheese">http://localhost:8080/webcm/demo/cheese</a>, you’ll see that the component is serving a static image of a cheese. This is an example of how Managed Components can expose new endpoints on your servers, if you allow them.</p><p>The Demo Component, like its name suggests, is just a demo. We use it to showcase and test the Managed Components APIs. What if we want to add a real Managed Component to our site? Google Analytics is <a href="https://w3techs.com/technologies/details/ta-googleanalytics">used by more than half of the websites on the internet</a>, so let’s see how we edit our <code>webcm.config.ts</code> file to load it.</p>
            <pre><code>export default {
  components: [
    {
      name: 'demo',
      permissions: [
        'access_client_kv',
        'provide_server_functionality',
        'provide_widget',
        'serve_static_files',
        'client_network_requests',
      ],
    },
    {
      name: 'google-analytics',
      settings: { 'tid': 'UA-XXXXXX' },
      permissions: [
        'access_client_kv',
      ],
    },
  ],
  target: 'http://127.0.0.1:8000',
  hostname: 'localhost',
  trackPath: '/webcm/track',
  ecommerceEventsPath: '/webcm/ecommerce',
  clientEventsPath: '/webcm/system',
  port: 8080
}</code></pre>
            <p>In the above example, we just replaced our demo component with the Google Analytics Managed Component. Note that this component requires much fewer permissions to run - that’s because it is running 100% server-side. Remember to replace <code>UA-XXXXXX</code> with your real Google Universal Analytics (version 3) account identifier.</p><p>Re-running `npx webcm` will now fetch the <a href="https://www.npmjs.com/package/@managed-components/google-analytics">google-analytics Managed Component</a> and run it, with the settings you provided. If you go now to your proxied website, you won’t see anything changed. But if you go to your Google Analytics dashboard, you will start seeing page views appearing on the Real Time view. WebCM loaded the component and is sending information server-side to Google Analytics.</p><p>There are many other components you can play around with, and we’re adding more all the time. Check out <a href="https://www.npmjs.com/org/managed-components">the Managed Components organization on NPM</a> or <a href="https://github.com/managed-components">on GitHub</a> to see the full list.</p>
    <div>
      <h3>Build your own Managed Component</h3>
      <a href="#build-your-own-managed-component">
        
      </a>
    </div>
    <p>Managed Components isn’t a closed library of tools you can use. As mentioned before – we are gradually open sourcing more tools from our library on GitHub. If you think our components are doing something weird – please let us know with an issue, or even make a PR. Managed Components are for the benefit of everyone. Over the past few months, the Cloudflare Zaraz community on Discord and on the Cloudflare Community Forum was extremely helpful in actively reporting issues, and so we’re excited to give them the option to take one step closer to the internals behind Cloudflare Zaraz.</p><p>While improving existing Managed Components is great, the thing we’re most thrilled about is that you can now build your own Managed Components too. If you’re a third-party tool vendor – this is a way for you to create a version of your tool that is safe and performant, so customers can discover and adopt your tool easily. If you’re a website developer, you might want to tinker with Managed Components to see what kind of things you can easily move away from the browser, for performance gains.</p><p>Let’s see how easy it is to create a Managed Component that listens to every page view on our website. Run <code>npm init managed-component</code> in the <code>components</code> directory that WebCM created, and <a href="https://github.com/managed-components/create-managed-component">create-managed-component</a> will take you through the process of scaffolding your component files. To start with, our component will not use any special permissions, so you can select none.</p><p>Once we’re done with the wizard, we can open our <code>src/index.ts</code> file. By default, our component will add a listener to all page views:</p>
            <pre><code>import { ComponentSettings, Manager } from '@managed-components/types'

export default async function (manager: Manager, settings: ComponentSettings) {
  manager.addEventListener('pageview', event =&gt; {
    // do the things
  })
}</code></pre>
            <p>Let’s edit the comment line so that we can see whenever a page view happens. Note we also prefixed <code>settings</code> with a <code>_</code> because we’re not using it now:</p>
            <pre><code>import { ComponentSettings, Manager } from '@managed-components/types'

export default async function (manager: Manager, _settings: ComponentSettings) {
  manager.addEventListener('pageview', event =&gt; {
    console.log(`New pageview at ${event.client.url}`)
  })
}</code></pre>
            <p>With these changes, the component will print the current URL whenever a page is viewed on the website. Before trying it out, we need to build our component. In the folder of your component run <code>npm i &amp;&amp; npm run build</code>. Then, use the namespace of your component to add it to your webcm.config.ts file and restart WebCM:</p>
            <pre><code>export default {
  components: [
    {
      name: 'demo',
      permissions: [
        'access_client_kv',
        'provide_server_functionality',
        'provide_widget',
        'serve_static_files',
        'client_network_requests',
      ],
    },
    {
      name: 'google-analytics',
      settings: { 'tid': 'UA-123456' },
      permissions: [
        'access_client_kv',
      ],
    },
    {
      name: 'your-component-namespace',
      settings: {},
      permissions: [],
    },
  ],
  target: 'http://127.0.0.1:8000',
  hostname: 'localhost',
  trackPath: '/webcm/track',
  ecommerceEventsPath: '/webcm/ecommerce',
  clientEventsPath: '/webcm/system',
  port: 8080
}</code></pre>
            <p>This is a very simple component, but it shows how easy it is to build functionality that was previously only available in the browser. You can easily extend your component: use <code>fetch</code> next to the <code>console.log</code> statement and send information to your own analytics warehouse whenever a pageview happens on your site. Read about all the other Managed Components APIs to <a href="https://managedcomponents.dev/specs/category/embeds-and-widgets">create widgets</a>, <a href="https://managedcomponents.dev/specs/client-events/mousedown">listen to clicks</a>, <a href="https://managedcomponents.dev/specs/client/set">store cookies</a>, <a href="https://managedcomponents.dev/specs/cache/useCache">use cache</a>, and much more. These APIs allow you to build richer tools than it was ever possible before.</p>
    <div>
      <h3>Your tool is better as a Managed Component</h3>
      <a href="#your-tool-is-better-as-a-managed-component">
        
      </a>
    </div>
    <p>When we started working on Managed Components, many people were asking what would be the motivation of a tool vendor to build a Managed Component. During these last few months, we’ve learned that vendors are often excited about Managed Components for the same reasons we are - it provides a safe way to use their tools, and a streamlined way to integrate their tools in websites. Customers care deeply for these things, so having a Managed Component means that customers are more likely to try out your technology. Vendors will also get huge discoverability benefits, as their tools could be featured in the Cloudflare Zaraz dashboard, exposing them to tens of thousands of Zaraz-enabled websites. We are getting a lot of interest from major vendors in building a Managed Component, and we’re doing our best in actively supporting them in the process. If your company is interested in having a Managed Component, contact us.</p><p>We strongly believe that Managed Components can change the way third-party tools are used online. This is only the beginning of making them faster, secure and private. Together with users, and vendors, we will work on constantly improving the capabilities of Managed Components as a community, for the benefit of every user of the World Wide Web. To get started with building your Managed Component, head to <a href="http://managedcomponents.dev">managedcomponents.dev</a> and start building. Our team is available to help you at <a>managedcomponents@cloudflare.com</a>.</p> ]]></content:encoded>
            <category><![CDATA[Zaraz]]></category>
            <category><![CDATA[Managed Components]]></category>
            <category><![CDATA[Open Source]]></category>
            <guid isPermaLink="false">7939BvPeIO2CLZlTxYLIGv</guid>
            <dc:creator>Yo'av Moshe</dc:creator>
        </item>
        <item>
            <title><![CDATA[Cloudflare Zaraz launches new privacy features in response to French CNIL standards]]></title>
            <link>https://blog.cloudflare.com/zaraz-privacy-features-in-response-to-cnil/</link>
            <pubDate>Wed, 15 Jun 2022 16:08:34 GMT</pubDate>
            <description><![CDATA[ Last week, the French National Data Protection Authority, CNIL, published guidelines for a GDPR-compliant way of loading Google Analytics. Today, Zaraz is launching a new set of features to help our customers use Google Analytics and similar tools, while meeting those strict standards ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Last week, the French national data protection authority (the Commission Nationale de l'informatique et des Libertés or “CNIL”), <a href="https://www.cnil.fr/fr/cookies-et-autres-traceurs/regles/google-analytics-et-transferts-de-donnees-comment-mettre-son-outil-de-mesure-daudience-en-conformite">published guidelines</a> for what it considers to be a GDPR-compliant way of loading Google Analytics and similar marketing technology tools. The CNIL published these guidelines following notices that the CNIL and other data protection authorities issued to several organizations using Google Analytics stating that such use resulted in impermissible data transfers to the United States. Today, we are excited to announce a set of features and a practical step-by-step guide for using Zaraz that we believe will help organizations continue to use Google Analytics and similar tools in a way that will help protect end user privacy and avoid sending EU personal data to the United States. And the best part? It takes less than a minute.</p><p>Enter <a href="https://dash.cloudflare.com/?to=/:account/:zone/zaraz">Cloudflare Zaraz</a>.</p>
    <div>
      <h2>The new Zaraz privacy features</h2>
      <a href="#the-new-zaraz-privacy-features">
        
      </a>
    </div>
    <p>What we are releasing today is a new set of privacy features to help our customers enhance end user privacy. Starting today, on the Zaraz dashboard, you can apply the following configurations:</p><ul><li><p>Remove URL query parameters: when toggled-on, Zaraz will remove all query parameters from a URL that is reported to a third-party server. It will turn <code>[https://example.com/?q=hello](https://example.com/?q=hello)</code> to <a href="https://example.com?q=hellp"><code>https://example.com</code></a>. This will allow users to remove  query parameters, such as UTM, gclid, and the sort that can be used for fingerprinting. This setting will apply to all of your Zaraz integrations.</p></li><li><p>Hide originating IP address: using Zaraz to load tools like Google Analytics entirely server-side while hiding visitor IP addresses from Google and Facebook <a href="/keep-analytics-tracking-data-in-the-eu-cloudflare-zaraz/">has been doable</a> for quite some time now. This will prevent sending the visitor IP address to a third-party tool provider’s server. This feature is configured at a tool level, currently offered for Google Analytics Universal, Google Analytics 4, and Facebook Pixel. We will add this capability to more and more tools as we go. In addition to hiding visitors’ IP addresses from specific tools, you can use Zaraz to trim visitors’ IP addresses across all tools to avoid sending originating IP addresses to third-party tool servers. This option is available on the Zaraz setting page, and is considered less strict.</p></li><li><p>Clear user agent strings: when toggled on, Zaraz will clear sensitive information from the User Agent String. The User-Agent is a request header that includes information about the operating system, browser, extensions and more of the site visitor. Zaraz clears this string by removing pieces of information (such as versions, extensions, and more) that could lead to user tracking or fingerprinting. This setting will apply only to server-side integrations.</p></li><li><p>Removal of external referrers: when toggled-on, Zaraz will hide the URL of the referring page from third-party servers. If the referring URL is on the same domain, it will not hide it, to keep analytics accurate and avoid the session from “splitting”. This setting will apply to all of your Zaraz integrations.</p></li></ul>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5ksw0eBnqjNGz5uR26SHxC/75b6896b18eb8290c8c91e546d666188/image2-12.png" />
            
            </figure>
    <div>
      <h2>How to set up Google Analytics with the new privacy features</h2>
      <a href="#how-to-set-up-google-analytics-with-the-new-privacy-features">
        
      </a>
    </div>
    <p>We wrote this guide to help you implement our new features when using Google Analytics. We will use Google Analytics (Universal) as the example of this guide, because Google Analytics is widely used by Zaraz customers. You can follow the same principles to set up your Facebook Pixel, or other server-side integration that Zaraz offers.</p>
    <div>
      <h3>Step 1: Install Zaraz on your website</h3>
      <a href="#step-1-install-zaraz-on-your-website">
        
      </a>
    </div>
    <p>Zaraz loads automatically for every website proxied by Cloudflare (Orange Clouded), no code changes are needed. If your website is not proxied by Cloudflare, you can <a href="https://developers.cloudflare.com/zaraz/advanced/domains-not-proxied/">load Zaraz manually</a> with a JavaScript code snippet. If you are new to Cloudflare, or unsure if your website is proxied by Cloudflare, you can use this <a href="https://chrome.google.com/webstore/detail/claire/fgbpcgddpmjmamlibbaobboigaijnmkl">Chrome extension</a> to find out if your site is Orange Clouded or not.</p>
    <div>
      <h3>Step 2: Add Google Analytics via the Zaraz dashboard</h3>
      <a href="#step-2-add-google-analytics-via-the-zaraz-dashboard">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7tgdFYH4bk4w5XvQ7viT82/a1297e892148566bfd799162266d237b/image5-6.png" />
            
            </figure><p>All customers have access to the <a href="https://dash.cloudflare.com/?to=/:account/:zone/zaraz">Zaraz dashboard</a>. By default, when you add Google Analytics using the Zaraz tools library, it will load server-side. You do not need to set up any cloud environment or proxy server. Zaraz handles this for you. When you add a tool, Zaraz will start loading on your website, and a request will leave from the end user’s browser to a Cloudflare Worker that sits on your own domain. Cloudflare Workers is our edge computing platform, and this Worker will communicate directly with Google Analytics’ servers. There will be no direct communication between an end user’s browser and Google’s servers. If you wish to learn more about how Zaraz works, please read our previous posts about <a href="/keep-analytics-tracking-data-in-the-eu-cloudflare-zaraz/#:~:text=Zaraz%E2%80%99s%20solution%20leverages%20Cloudflare%E2%80%99s%20global%20network%20and%20Workers%20platform">the unique Zaraz architecture</a> and <a href="/zaraz-use-workers-to-make-third-party-tools-secure-and-fast/">how we use Workers</a>. Note that “proxying” Google Analytics, by itself, is not enough, according to the CNIL’s guidance. You will have to take more actions to make sure you set up Google Analytics properly.</p>
    <div>
      <h3>Step 3: Configure Google Analytics and hide IP addresses</h3>
      <a href="#step-3-configure-google-analytics-and-hide-ip-addresses">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4Sv2MQotvaO2KFv7Sor5MH/974394953bdab90fa69e449e8b956bde/image2-10.png" />
            
            </figure><p>All you need to do to set up Google Analytics is to enter your Tracking ID. On the tools setting screen, you would also need to toggle-on the “Hide Originating IP Address” feature. This will prevent Zaraz from sending the visitor’s IP address to Google. Zaraz will remove the IP address on the Edge, before it hits Google’s servers. If you want to make sure Zaraz will run only in the EU, review Cloudflare’s <a href="https://www.cloudflare.com/data-localization/">Data Localization Suite</a>.</p><p>According to your needs, you can of course set up more complex configurations of Google Analytics, including Ecommerce tracking, Custom Dimension, fields to set, Custom Metrics, etc. Follow <a href="https://developers.cloudflare.com/zaraz/get-started/add-tool/">this guide</a> for more instructions.</p>
    <div>
      <h3>Step 4: Toggle-on Zaraz’s new privacy features</h3>
      <a href="#step-4-toggle-on-zarazs-new-privacy-features">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4rYqHM9LhtQOetWn9hru0f/877973b08402b4bc150ea55e1ad3312c/image2-11.png" />
            
            </figure><p>Next, you will need to toggle-on all of our new privacy features mentioned above. You can do this on the Zaraz Settings page, under the Privacy section.</p>
    <div>
      <h3>Step 5: Clean your Google Analytics configuration</h3>
      <a href="#step-5-clean-your-google-analytics-configuration">
        
      </a>
    </div>
    <p>In this step, you would need to take actions to clean your specific Google Analytics setting. We gathered a list of suggestions for you to help preserve end user privacy:</p><ul><li><p>Do not include any personal identifiable information. You will want to review the CNIL’s guidance on anonymization and determine how to apply it on your end. It is likely that such anonymization will make the unique identifier pretty much useless with most analytics tools. For example, according to our findings, features like Google Analytics’ User ID View, won’t work well with such anonymization. In such cases, you may want to stop using such analytics tools to avoid discrepancies and assure accuracy.</p></li><li><p>If you wish to hide Google Analytics’ Client ID, on the Google Analytics setting page, click “add field” and choose “Client ID”. To override the Client ID, you can insert any string as the field’s constant value. Please note that this will likely limit Google’s ability to aggregate data and will likely create discrepancies in session and user counts. Still, we’ve seen customers that are using Google Analytics to count events, and to our knowledge that should still be doable with this setting.</p></li><li><p>Clean your implementation from cross-site identifiers. This could include things like your CRM tool unique identifier, or URL query parameters passing identifiers to share them between different domains (avoid “<a href="https://developers.google.com/analytics/devguides/collection/gtagjs/cross-domain">cross-domain tracking</a>” also known as “site linking”).</p></li><li><p>You would need to make sure not to include any personal data in your customized configuration and implementation. We recommend you go over the list of Custom Dimension, Event parameters/properties, Ecommerce Data, and User Properties to make sure they do not contain personal data. While this still demands some manual work, the good news is that soon we are about to announce a new set of Privacy features, Zaraz Data Loss Prevention, that will help you do that automatically, at scale. Stay tuned!</p></li></ul>
    <div>
      <h3>Step 6 - you are done! ?</h3>
      <a href="#step-6-you-are-done">
        
      </a>
    </div>
    <p>A few more things you will want to consider is that implementing this guide will result in some limitations in your ability to use Google Analytics. For example, not collecting UTM parameters and referrers will disable your ability to track traffic sources and campaigns. Not tracking User ID, will prevent you from using the User ID View, and so on. Some companies will find these limitations extreme, but like most things in life, there is a trade-off. We’re taking a step towards a more privacy-oriented web, and this is just the beginning. In the face of new regulatory constraints, new technologies will appear which will unlock new abilities and features. Zaraz is dedicated to leading the way, offering privacy-focused tools that empower website operators and protect end users.</p><p>We recommend you learn more about Cloudflare’s <a href="https://www.cloudflare.com/data-localization/">Data Localization Suite</a>, and how you can <a href="/keep-analytics-tracking-data-in-the-eu-cloudflare-zaraz/">use Zaraz to keep analytics data in the EU</a>.</p><p>To wrap up, we would really appreciate any feedback on this announcement, or new feature requests you might have. You can reach out to your Cloudflare account manager, or directly to us on our <a href="https://discord.gg/2TRr6nSxdd">Discord channel</a>. Privacy is at the heart of everything our team is building.</p><p>We always take a proactive approach towards privacy, and we believe privacy is not only about responding to different regulations, it is about building technology that helps customers do a better job protecting their users. It is about simplifying what it takes to respect and protect user privacy and personal information. It is about helping build a better Internet.</p> ]]></content:encoded>
            <category><![CDATA[Zaraz]]></category>
            <category><![CDATA[Privacy]]></category>
            <category><![CDATA[France]]></category>
            <category><![CDATA[Product News]]></category>
            <guid isPermaLink="false">29IHSQF1F1X7kIaAL03Eai</guid>
            <dc:creator>Yair Dovrat</dc:creator>
            <dc:creator>Yo'av Moshe</dc:creator>
        </item>
        <item>
            <title><![CDATA[Open source Managed Components for Cloudflare Zaraz]]></title>
            <link>https://blog.cloudflare.com/zaraz-open-source-managed-components-and-webcm/</link>
            <pubDate>Mon, 09 May 2022 13:00:00 GMT</pubDate>
            <description><![CDATA[ Fixing third-party security issues and bloat takes collaborative work. We are open sourcing Managed Components, so everyone can use fast and secure third-parties, everywhere ]]></description>
            <content:encoded><![CDATA[ <p></p><p>In early 2020, we sat down and tried thinking if there’s a way to load third-party tools on the Internet without slowing down websites, without making them less secure, and without sacrificing users’ privacy. In the evening, after scanning through thousands of websites, our answer was “well, sort of”. It seemed possible: many types of third-party tools are merely collecting information in the browser and then sending it to a remote server. We could theoretically figure out what it is that they’re collecting, and then instead just collect it once efficiently, and send it server-side to their servers, mimicking their data schema. If we do this, we can get rid of loading their JavaScript code inside websites completely. This means no more risk of malicious scripts, no more performance losses, and fewer privacy concerns.</p><p>But the answer wasn’t a definite “YES!” because we realized this is going to be very complicated. We looked into the network requests of major third-party scripts, and often it seemed cryptic. We set ourselves up for a lot of work, looking at the network requests made by tools and trying to figure out what they are doing – What is this parameter? When is this network request sent? How is this value hashed? How can we achieve the same result more securely, reliably and efficiently? Our team faced these questions on a daily basis.</p><p>When we joined Cloudflare, the scale of everything changed. Suddenly we were on thousands of websites, serving more than 10,000 requests per second. Users are writing to us every single day over our Discord channel, the community forum, and sometimes even directly on Twitter. More often than not, their messages would be along the lines of “Hi! Can you please add support for X?” Cloudflare Zaraz launched with around 30 tools in its library, but this market is vast and new tools are popping up all the time.</p>
    <div>
      <h3>Changing our trust model</h3>
      <a href="#changing-our-trust-model">
        
      </a>
    </div>
    <p>In my previous blog post on how <a href="/zaraz-use-workers-to-make-third-party-tools-secure-and-fast/">Zaraz uses Cloudflare Workers</a>, I included some examples of how tool integrations are written in Zaraz today. Usually, a “tool” in Zaraz would be a function that prepares a payload and sends it. This function could return one thing – <code>clientJS</code>, JavaScript code that the browser would later execute. We’ve done our best so that tools wouldn’t use <code>clientJS</code>, if it wasn’t really necessary, and in reality most Zaraz-built tool integrations are not using <code>clientJS</code> at all.</p><p>This worked great, as long as we were the ones coding all tool integrations. Customers trusted us that we’d write code that is performant and safe, and they trusted the results they saw when trying Zaraz. Upon joining Cloudflare, many third-party tool vendors contacted us and asked to write a Zaraz integration. We quickly realized that our system wasn’t enforcing speed and safety – vendors could literally just dump their old browser-side JavaScript into our <code>clientJS</code> variable, and say “We have a Cloudflare Zaraz integration!”, and that wasn’t our vision at all.</p><p>We want third-party tool vendors to be able to write their own performant, safe server-side integrations. We want to make it possible for them to reimagine their tools in a better way. We also want website owners to have transparency into what is happening on their website, to be able to manage and control it, and to trust that if a tool is running through Zaraz, it must be a good tool -- not because of who wrote it, but because of the technology it is constructed within. We realized that to achieve that we needed a new format for defining third-party tools.</p>
    <div>
      <h3>Introducing Managed Components</h3>
      <a href="#introducing-managed-components">
        
      </a>
    </div>
    <p>We started rethinking how third-party code should be written. Today, it’s a black box – you usually add a script to your site, and you have zero clue what it does and when. You can’t properly read or analyze the minified code. You don’t know if the way it behaves for you is the same way it behaves for everyone else. You don’t know when it might change. If you’re a website owner, you’re completely in the dark.</p><p>Tools do many different things. The simple ones just collected information and sent it somewhere. Often, they’d set some cookies. Sometimes, they’d install some event listeners on the page. And widget-based tools can literally manipulate the page DOM, providing new functionality like a social media embed or a chatbot. Our new format needed to support all of this.</p><p>Managed Components is how we imagine the future of third-party tools online. It provides vendors with an <a href="https://www.cloudflare.com/learning/security/api/what-is-an-api/">API</a> that allows them to do much more than a normal script can, including keeping code execution outside the browser. We designed this format together with vendors, for vendors, while having in mind that users’ best interest is everyone's best interest long-term.</p><p>From the get-go, we built Managed Components to use a permission-based system. We want to provide even more transparency than Zaraz does today. As the new API allows tools to set cookies, change the DOM or collect IP addresses, all those abilities require being granted a permission. Installing a third-party tool on your site is similar to installing an app on your phone – you get an explanation of what the tool can and can’t do, and you can allow or disallow features to a granular level. We previously wrote about <a href="/keep-analytics-tracking-data-in-the-eu-cloudflare-zaraz/">how you can use Zaraz to not send IP addresses to Google Analytics</a>, and now we’re doubling down in this direction. It’s your website, and it’s your decision to make.</p><p>Every Managed Component is a JavaScript module at its core. Unlike today, this JavaScript code isn’t sent to the browser. Instead, it is executed by a Components Manager. This manager implements the APIs that are then used by the component. It dispatches server-side events that originate in the browser, providing the components with access to information while keeping them sandboxed and performant. It handles caching, storage and more — all so that the Managed Components can implement their logic without worrying so much about the surrounding.</p><p>An example analytics Managed Component can look something like this:</p>
            <pre><code>export default function (manager) {
  manager.addEventListener("pageview", ({ context, client }) =&gt; {
    fetch("https://example.com/collect", {
  	method: "POST",
  	data: {
    	  url: context.page.url.href,
    	  userAgent: client.device.userAgent,
  	},
    });
  });
}</code></pre>
            <p>The above component gets notified whenever a page view occurs, and it then creates some payload with the visitor user-agent and page URL and sends that as a POST request to the vendor’s server. This is very similar to how things are done today, except this doesn’t require running any code at all in the browser.</p><p>But Managed Components aren’t just doing what was previously possible but better, they also provide dramatic new functionality. See for example how we’re exposing server-side endpoints:</p>
            <pre><code>export default function (manager) {
  const api = manager.proxy("/api", "https://api.example.com");
  const assets = manager.serve("/assets", "assets");
  const ping = manager.route("/ping", (request) =&gt; new Response(204));
}</code></pre>
            <p>These three lines are a complete shift in what’s possible for third-parties. If granted the permissions, they can proxy some content, serve and expose their own endpoints – all under the same domain as the one running the website. If a tool needs to do some processing, it can now off-load that from the browser completely without forcing the browser to communicate with a third-party server.</p>
    <div>
      <h3>Exciting new capabilities</h3>
      <a href="#exciting-new-capabilities">
        
      </a>
    </div>
    <p>Every third-party tool vendor should be able to use the Managed Components API to build a better version of their tool. The API we designed is comprehensive, and the benefits for vendors are huge:</p><ul><li><p>Same domain: Managed Components can serve assets from the same domain as the website itself. This allows a faster and more secure execution, as the browser needs to trust and communicate with only one server instead of many. This can also reduce costs for vendors as their bandwidth will be lowered.</p></li><li><p>Website-wide events system: Managed Components can hook to a pre-existing events system that is used by the website for tracking events. Not only is there no need to provide a browser-side API to your tool, it’s also easier for your users to send information to your tool because they don’t need to learn your methods.</p></li><li><p>Server logic: Managed Components can provide server-side logic on the same domain as the website. This includes proxying a different server, or adding endpoints that generate dynamic responses. The options are endless here, and this, too, can reduce the load on the vendor servers.</p></li><li><p>Server-side rendered widgets and embeds: Did you ever notice how when you’re loading an article page online, the content jumps when some YouTube or Twitter embed suddenly appears between the paragraphs? Managed Components provide an API for registering widgets and embed that render server-side. This means that when the page arrives to the browser, it already includes the widget in its code. The browser doesn’t need to communicate with another server to fetch some tweet information or styling. It’s part of the page now, so expect a better CLS score.</p></li><li><p>Reliable cross-platform events: Managed Components can subscribe to client-side events such as clicks, scroll and more, without needing to worry about browser or device support. Not only that – those same events will work outside the browser too – but we’ll get to that later.</p></li><li><p>Pre-Response Actions: Managed Components can execute server-side actions before the network response even arrives in the browser. Those actions can access the response object, reading it or altering it.</p></li><li><p>Integrated Consent Manager support: Managed Components are predictable and scoped. The Component Manager knows what they’ll need and can predict what kind of consent is needed to run them.</p></li></ul>
    <div>
      <h3>The right choice: open source</h3>
      <a href="#the-right-choice-open-source">
        
      </a>
    </div>
    <p>As we started working with vendors on creating a Managed Component for their tool, we heard a repeating concern – “What Components Managers are there? Will this only be useful for Cloudflare Zaraz customers?”. While Cloudflare Zaraz is indeed a Components Manager, and it has a generous free tier plan, we realized we need to think much bigger. We want to make Managed Components available for everyone on the Internet, because we want the Internet as a whole to be better.</p><p>Today, we’re announcing much more than just a new format.</p><p>WebCM is a reference implementation of the Managed Components API. It is a complete Components Manager that we will soon release and maintain. You will be able to use it as an SDK when building your Managed Component, and you will also be able to use it in production to load Managed Components on your website, even if you’re not a Cloudflare customer. WebCM works as a proxy – you place it before your website, and it rewrites your pages when necessary and adds a couple of endpoints. This makes WebCM 100% framework-agnostic – it doesn’t matter if your website uses Node.js, Python or Ruby behind the scenes: as long as you’re sending out HTML, it supports that.</p><p>That’s not all though! We’re also going to open source a few Managed Components of our own. We converted some of our classic Zaraz integrations to Managed Components, and they will soon be available for you to use and improve. You will be able to take our Google Analytics Managed Component, for example, and use WebCM to run Google Analytics on your website, 100% server-side, without Cloudflare.</p>
    <div>
      <h3>Tech-leading vendors are already joining</h3>
      <a href="#tech-leading-vendors-are-already-joining">
        
      </a>
    </div>
    <p>Revolutionizing third-party tools on the internet is something we could only do together with third-party vendors. We love third-party tools, and we want them to be even more popular. That’s why we worked very closely with a few leading companies on creating their own Managed Components. These new Managed Components extend Zaraz capabilities far beyond what’s possible now, and will provide a safe and secure onboarding experience for new users of these tools.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/L2kX7uZuER3EvC7cVOdjK/2a6e905a734309e17052ff7cf7f5175f/Screenshot-2022-05-09-at-12.10.17.png" />
            
            </figure><p><b>Drift</b> – <a href="http://www.drift.com">Drift</a> helps businesses connect with customers in moments that matter most. Drift’s integration will let customers use Drift’s robust Conversation Cloud – which brings together Conversational Marketing, Conversational Sales and Conversational Service into a single platform – while also remaining completely sandboxed and without making third-party network connections, increasing privacy and security for our users.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3SXN13Pzn2NeXEi6r46s4V/0dd48a1d3fa5bca132bd5463a89b0df3/Screenshot-2022-05-09-at-12.10.25.png" />
            
            </figure><p><b>CrazyEgg</b> – <a href="https://crazyegg.com/zaraz">Crazy Egg</a> helps customers make their websites better through visual heatmaps, A/B testing, detailed recordings, surveys and more. Website owners, Cloudflare, and Crazy Egg all care deeply about performance, security and privacy. Managed Components have enabled Crazy Egg to do things that simply aren’t possible with third-party JavaScript, which means our mutual customers will get one of the most performant and secure website optimization tools created.</p><p>We also already have customers that are eager to implement Managed Components:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4PSbj0jBesji7Ns7kSidoF/45b0159b70fe9fbe7158a3cb11c1e8e2/Screenshot-2022-05-09-at-12.10.38.png" />
            
            </figure><p><b>Hopin Quote:</b></p><blockquote><p>"I have been really impressed with Cloudflare’s Zaraz ability to move Drift's JS library to an Edge Worker while loading it off the DOM. My work is much more effective due to the savings in page load time. It's a pleasure to work with two companies that actively seek better ways to increase both page speed and load times with large MarTech stacks."– Sean Gowing, Front End Engineer, <a href="http://hopin.com">Hopin</a></p></blockquote><p>If you’re a third-party vendor, and you want to join these tech-leading companies, do reach out to us, and we’d be happy to support you on writing your own Managed Component.</p>
    <div>
      <h3>What’s next for Managed Components</h3>
      <a href="#whats-next-for-managed-components">
        
      </a>
    </div>
    <p>We’re working on Managed Components on many fronts now. While we develop and maintain WebCM, work with vendors and integrate Managed Components into Cloudflare Zaraz, we’re already thinking about what’s possible in the future.</p><p>We see a future where many open source runtimes exist for Managed Components. Perhaps your infrastructure doesn’t allow you to use WebCM? We want to see Managed Components runtimes created as service workers, HTTP servers, proxies and framework plugins. We’re also working on making Managed Components available on mobile applications. We’re working on allowing unofficial Managed Components installs on Cloudflare Zaraz. We’re fixing a long-standing issue of the WWW, and there’s so much to do.</p><p>We will very soon publish the full specs of Managed Components. We will also open source WebCM, the reference implementation server, as well as many components you can use yourself. If this is interesting to you, reach out to us at <a>zaraz@cloudflare.com</a>, or join us on <a href="https://discord.gg/cloudflaredev">Discord</a>.</p> ]]></content:encoded>
            <category><![CDATA[Platform Week]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Managed Components]]></category>
            <category><![CDATA[Privacy]]></category>
            <category><![CDATA[Zaraz]]></category>
            <guid isPermaLink="false">3XfROgaAJPDzhp7czf4E1i</guid>
            <dc:creator>Yo'av Moshe</dc:creator>
        </item>
        <item>
            <title><![CDATA[Cloudflare Zaraz supports CSP]]></title>
            <link>https://blog.cloudflare.com/cloudflare-zaraz-supports-csp/</link>
            <pubDate>Tue, 15 Mar 2022 12:59:16 GMT</pubDate>
            <description><![CDATA[ If you have Cloudflare Zaraz enabled on your website, you don’t have to ask yourself twice if you should enable CSP because there’s no harmful collision between CSP & Cloudflare Zaraz ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Cloudflare Zaraz can be used to manage and load third-party tools <i>on the cloud</i>, achieving significant speed, privacy and security improvements. <a href="https://wiki.mozilla.org/index.php?title=Security/CSP/Spec&amp;oldid=133465">Content Security Policy (CSP)</a> configuration prevents malicious content from being run on your website.</p><p>If you have Cloudflare Zaraz enabled on your website, you don’t have to ask yourself twice if you should enable CSP because there’s no harmful collision between CSP &amp; Cloudflare Zaraz.</p>
    <div>
      <h3>Why would Cloudflare Zaraz collide with CSP?</h3>
      <a href="#why-would-cloudflare-zaraz-collide-with-csp">
        
      </a>
    </div>
    <p>Cloudflare Zaraz, at its core, injects a  block on every page where it runs. If the website enforces CSP rules, the injected script can be automatically blocked if <i>inline</i> scripts are not allowed. To prevent this, at the moment of script injection, Cloudflare Zaraz adds <i>a nonce to the script-src policy</i> in order for everything to work smoothly.</p><p>Cloudflare Zaraz supports CSP enabled by using both <i>Content-Security-Policy headers</i> or <i>Content-Security-Policy  blocks.</i></p>
    <div>
      <h2>What is CSP?</h2>
      <a href="#what-is-csp">
        
      </a>
    </div>
    <p><a href="https://wiki.mozilla.org/index.php?title=Security/CSP/Spec&amp;oldid=133465">Content Security Policy (CSP)</a> is a security standard meant to <a href="https://www.cloudflare.com/learning/security/glossary/website-security-checklist/">protect websites</a> from <a href="https://en.wikipedia.org/wiki/Cross-site_scripting">Cross-site scripting (XSS)</a> or <a href="https://en.wikipedia.org/wiki/Clickjacking">Clickjacking</a> by providing the means to list approved origins for scripts, styles, images or other web resources.</p><p>Although CSP is a reasonably mature technology with most modern browsers already implementing the standard, <a href="https://www.bitsight.com/blog/content-security-policy-limits-dangerous-activity-so-why-isnt-everyone-doing-it">less than 10% of websites</a> use this extra layer of security. <i>A Google study says that more than 90% of the websites using CSP are still</i> <a href="https://storage.googleapis.com/pub-tools-public-publication-data/pdf/45542.pdf"><i>leaving some doors open for attackers</i></a><i>.</i></p><p>Why this low adoption and poor configuration? An <a href="https://wkr.io/publication/raid-2014-content_security_policy.pdf">early study on ‘why CSP adoption is failing’</a> says that the initial setup for a website is tedious and can generate errors, risking doing more harm for the business than an occasional XSS attack.</p><p>We’re writing this to confirm that <b>Cloudflare Zaraz will comply with your CSP settings</b> without any other additional configuration from your side and <b>to share some interesting findings</b> from our research regarding how CSP works.</p>
    <div>
      <h2>What is Cloudflare Zaraz?</h2>
      <a href="#what-is-cloudflare-zaraz">
        
      </a>
    </div>
    <p>Cloudflare Zaraz aims to make the web faster by moving third-party script bloat away from the browser.</p><p>There are tens of third-parties loaded by almost every website on the Internet (analytics, tracking, chatbots, banners, embeds, widgets etc.). Most of the time, the third parties have a slightly small role on a particular website compared to the high-volume and complex code they provide (for a good reason, because it’s meant to deal with all the issues that particular tool can tackle). This code, loaded a huge number of times on every website is simply <i>inefficient.</i></p><p>Cloudflare Zaraz reduces the amount of code executed on the client side and the amount of time consumed by the client with anything that is not directly serving the user and their experience on the web.</p><p>At the same time, Cloudflare Zaraz does the integration between website owners and third-parties by providing a common management interface with an easy ‘one-click’ method.</p>
    <div>
      <h2>Cloudflare Zaraz &amp; CSP</h2>
      <a href="#cloudflare-zaraz-csp">
        
      </a>
    </div>
    <p>When auto-inject is enabled, Cloudflare Zaraz ‘bootstraps’ on your website by running a small inline script that collects basic information from the browser (Screen Resolution, User-Agent, Referrer, page URL) and also provides the main <a href="https://developers.cloudflare.com/zaraz/web-api/zaraz-track/">`track` function</a>. The `track` function allows you to <i>track</i> the actions your users are taking on your website, and other events that might happen in real time. Common user actions a website will probably be interested in tracking are <i>successful sign-ups, calls-to-action clicks, and purchases</i>.</p><p><i>Before adding CSP support, Cloudflare Zaraz would’ve been blocked on any website that implemented CSP and didn’t include ‘unsafe-inline’ in the script-src policy or default-src policy.</i> Some of our users have signaled collisions between CSP and Cloudflare Zaraz so we decided to make peace with CSP once and forever.</p><p><i>To solve the issue, when Cloudflare Zaraz is automatically injected on a website implementing CSP, it enhances the response header by appending a nonce value in the script-src policy. This way we make sure we’re not harming any security that was already enforced by the website owners, and we are still able to perform our duties - making the website faster and more secure by asynchronously running third parties on the server side instead of clogging the browser with irrelevant computation from the user’s point of view.</i></p>
    <div>
      <h2>CSP - Edge Cases</h2>
      <a href="#csp-edge-cases">
        
      </a>
    </div>
    <p>In the following paragraphs we’re describing some interesting CSP details we had to tackle to bring Cloudflare Zaraz to a trustworthy state. The following paragraphs assume that you already know what CSP is, and you know how <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP#examples_common_use_cases">a simple CSP configuration</a> looks like.</p>
    <div>
      <h3>Dealing with multiple CSP headers/ elements</h3>
      <a href="#dealing-with-multiple-csp-headers-elements">
        
      </a>
    </div>
    <p>The CSP standard allows multiple CSP headers but, on a first look, it’s slightly unclear how the multiple headers will be handled.</p><p>You would think that the CSP rules will be somehow merged and the final CSP rule will be a combination of all of them but in reality the rule is much more simple - the most restrictive policy among all the headers will be applied. Relevant examples can be found in the <a href="https://www.w3.org/TR/CSP2/#enforcing-multiple-policies">w3c’s standard description</a> and in this <a href="https://chrisguitarguy.com/2019/07/05/working-with-multiple-content-security-policy-headers/">multiple CSP headers example</a>.</p><p>The rule of thumb is that “<i>A connection will be allowed only if all the CSP headers will allow it</i>”.</p><p>In order to make sure that the Cloudflare Zaraz script is always running, <b>we’re adding the nonce value to</b> <b>all the existing CSP headers and/or  blocks</b>.</p>
    <div>
      <h3>Adding a nonce to a CSP header that already allows unsafe-inline</h3>
      <a href="#adding-a-nonce-to-a-csp-header-that-already-allows-unsafe-inline">
        
      </a>
    </div>
    <p>Just like when sending multiple CSP headers, when configuring one policy with multiple values, the most restrictive value has priority.</p><p>An illustrative example for a given CSP header:</p><p><i>Content-Security-Policy: default-src ‘self’; script-src ‘unsafe-inline’ ‘nonce-12345678’</i></p><p>If ‘unsafe-inline’ is set in the script-src policy, adding <code>nonce-123456789</code> will disable the effect of <code>unsafe-inline</code> and will allow only the inline script that mentions that nonce value.</p><p>This is a mistake we already made while trying to make Cloudflare Zaraz compliant with CSP. However, we solved it by adding the nonce only in the following situations:</p><ul><li><p>if ‘unsafe-inline’ is not already present in the header</p></li><li><p>If ‘unsafe-inline’ is present in the header but next to it, a ‘nonce-...’ or ‘sha…’ value is already set (because in this situation ‘unsafe-inline’ is practically disabled)</p></li></ul>
    <div>
      <h3>Adding the script-src policy if it doesn’t exist already</h3>
      <a href="#adding-the-script-src-policy-if-it-doesnt-exist-already">
        
      </a>
    </div>
    <p>Another interesting case we had to tackle was handling a CSP header that didn't include the script-src policy, a policy that was relying only on the default-src values. In this case, we’re copying all the default-src values to a new script-src policy, and we’re appending the nonce associated with the Cloudflare Zaraz script to it(keeping in mind the previous point of course)</p>
    <div>
      <h2>Notes</h2>
      <a href="#notes">
        
      </a>
    </div>
    <p>Cloudflare Zaraz is still not 100% compliant with CSP because some tools still need to use <i>eval()</i> - usually for setting cookies, but we’re already working on a different approach so, stay tuned!</p><p>The Content-Security-Policy-Report-Only header is not modified by Cloudflare Zaraz yet - you’ll be seeing error reports regarding the Cloudflare Zaraz  element if Cloudflare Zaraz is enabled on your website.</p><p>Content-Security-Policy Report-Only can not be set using a  element</p>
    <div>
      <h2>Conclusion</h2>
      <a href="#conclusion">
        
      </a>
    </div>
    <p>Cloudflare Zaraz supports the evolution of a more secure web by seamlessly complying with CSP.</p><p>If you encounter any issue or potential edge-case that we didn’t cover in our approach, don’t hesitate to write on <a href="https://discord.gg/2TRr6nSxdd">Cloudflare Zaraz’s Discord Channel</a>, we’re always there fixing issues, listening to feedback and announcing exciting product updates.</p><p>For more details on how Cloudflare Zaraz works and how to use it, check out the <a href="https://developers.cloudflare.com/zaraz/">official documentation</a>.</p>
    <div>
      <h3>Resources:</h3>
      <a href="#resources">
        
      </a>
    </div>
    <p>[1] <a href="https://wiki.mozilla.org/index.php?title=Security/CSP/Spec&amp;oldid=133465">https://wiki.mozilla.org/index.php?title=Security/CSP/Spec&amp;oldid=133465</a>[2] <a href="https://storage.googleapis.com/pub-tools-public-publication-data/pdf/45542.pdf">https://storage.googleapis.com/pub-tools-public-publication-data/pdf/45542.pdf</a>[3] <a href="https://en.wikipedia.org/wiki/Content_Security_Policy">https://en.wikipedia.org/wiki/Content_Security_Policy</a>[4] <a href="https://www.w3.org/TR/CSP2/#enforcing-multiple-policies">https://www.w3.org/TR/CSP2/#enforcing-multiple-policies</a>[5] <a href="https://chrisguitarguy.com/2019/07/05/working-with-multiple-content-security-policy-headers/">https://chrisguitarguy.com/2019/07/05/working-with-multiple-content-security-policy-headers/</a>[6]<a href="https://www.bitsight.com/blog/content-security-policy-limits-dangerous-activity-so-why-isnt-everyone-doing-it">https://www.bitsight.com/blog/content-security-policy-limits-dangerous-activity-so-why-isnt-everyone-doing-it</a>[7]<a href="https://wkr.io/publication/raid-2014-content_security_policy.pdf">https://wkr.io/publication/raid-2014-content_security_policy.pdf</a></p> ]]></content:encoded>
            <category><![CDATA[Security Week]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Zaraz]]></category>
            <guid isPermaLink="false">3Vxj6esMgRKAs43JIZNOLp</guid>
            <dc:creator>Simona Badoiu</dc:creator>
        </item>
        <item>
            <title><![CDATA[Need to keep analytics data in the EU? Cloudflare Zaraz can offer a solution]]></title>
            <link>https://blog.cloudflare.com/keep-analytics-tracking-data-in-the-eu-cloudflare-zaraz/</link>
            <pubDate>Thu, 03 Feb 2022 13:58:05 GMT</pubDate>
            <description><![CDATA[ Zaraz offers a way to use tools like Google Analytics, but doing so with an approach that protects the privacy of personal information and keeps it in the EU ]]></description>
            <content:encoded><![CDATA[ 
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5kSXFj0Tgq1mTPHL6Bdpbd/14567e87448e778cedfb1270a6945642/unnamed--1--1.png" />
            
            </figure><p>A recent decision from the Austrian Data Protection Authority (<a href="https://www.dsb.gv.at/">the Datenschutzbehörde</a>) has network engineers scratching their heads and EU companies that use Google Analytics scrambling. The Datenschutzbehörde found that an Austrian website’s use of Google Analytics violates the EU General Data Protection Regulation (GDPR) as interpreted by the “Schrems II” case because Google Analytics can involve sending full or truncated IP addresses to the United States.</p><p>While disabling such trackers might be one (extreme) solution, doing so would leave website operators blind to how users are engaging with their site. A better approach: find a way to use tools like Google Analytics, but do so with an approach that protects the privacy of personal information and keeps it in the EU, avoiding a data transfer altogether. Enter <a href="https://dash.cloudflare.com/?to=/:account/:zone/zaraz">Cloudflare Zaraz</a>.</p><p>But before we get into just how Cloudflare Zaraz can help, we need to explain a bit of the background for the Datenschutzbehörde’s ruling, and why it’s a big deal.</p>
    <div>
      <h3>What are the privacy and data localization issues?</h3>
      <a href="#what-are-the-privacy-and-data-localization-issues">
        
      </a>
    </div>
    <p>The GDPR is a comprehensive data privacy law that applies to EU residents’ personal data, regardless of where it is processed. The GDPR itself does not insist that personal data must be processed only in Europe. Instead, it provides a number of legal mechanisms to ensure that GDPR-level protections are available for EU personal data if it is transferred outside the EU to a third country like the United States. Data transfers from the EU to the US were, until the 2020 “Schrems II” decision, permitted under an agreement called the <a href="https://www.privacyshield.gov/welcome">EU-US Privacy Shield Framework</a>.</p><p>The Schrems II decision refers to the July 2020 decision by the Court of Justice of the European Union that invalidated the EU-US Privacy Shield. The Court found that the Privacy Shield was not an effective means to protect EU data from US government surveillance authorities once data was transferred to the US, and therefore that under the Privacy Shield, EU personal data would not receive the level of protection guaranteed by the GDPR. However, the court upheld other valid transfer mechanisms designed to allow EU personal data to be transferred to the US in a way that is consistent with the GDPR that ensure EU personal data won’t be accessed by US government authorities in a way that violates the GDPR. One of those was the use of <a href="https://www.cloudflare.com/cloudflare-customer-scc/">Standard Contractual Clauses</a>, which are legal agreements approved by the EU Commission that enable data transfers – but they can only be used if supplementary measures are also in place.</p><p>Following the Schrems II case, the “NOYB” advocacy group founded by Max Schrems (the lawyer and activist who brought the legal action against Facebook that ultimately ended with the Schrems II ruling) filed 101 complaints against European websites that used Google Analytics and Facebook Connect trackers on the grounds that use of these trackers violates the Schrems II ruling because they send EU personal data to the United States without putting in place sufficient supplementary measures.</p><p>That issue of supplementary measures figured prominently in the Austrian data regulator’s decision. In its decision, the Datenschutzbehörde said that a European company could not use Google Analytics on its Austrian website because Google Analytics was sending the IP addresses of visitors to that website to Google’s servers in the United States. The Datenschutzbehörde reiterated earlier case law out of the EU that IP addresses can be sufficiently linked to individuals and therefore constitute personal data, so the GDPR applies. The regulator also found that IP addresses are not pseudonymous, and that Google doesn’t have sufficient supplementary measures in place to prevent US government authorities from accessing the data. As a result, the regulator found the use of Google Analytics and the transmission of IP addresses to the United States in this case violated the GDPR as interpreted by the Schrems II case.</p>
    <div>
      <h3>Google Analytics decision sets worrisome precedent</h3>
      <a href="#google-analytics-decision-sets-worrisome-precedent">
        
      </a>
    </div>
    <p>It’s important to remember that the Austrian ruling relates to one website’s use and implementation of Google Analytics. It is not a ban on Google Analytics throughout Europe. But is it a harbinger of more sweeping actions from data regulators? Any website might use dozens of third-party tools. If any of the third-party tools are transferring personal data to the US, they could attract the attention of an EU data regulator. Even if those tools are not collecting personal data or sensitive information intentionally, there remains a concern with the use of third-party tools, which evolves from how the Internet is built and operates.</p><p>Every time a user loads a website, those tools load and establish a connection between the end user’s browser and the third-party server. This connection is used for multiple purposes, such as requesting a script, reporting analytics data, or downloading an image pixel. In every such communication, the IP address of the visitor is exposed. This is how communication between a browser and a server has worked over the Internet since the Internet’s infancy.</p><p>The implications of the decision are therefore profound. If other European regulators adopt the Austrian ruling, and its conclusion that even the transfer of truncated IP addresses to the United States could constitute transfers of personal data that violate GDPR, the industry will likely need to fundamentally rethink current Internet architecture and the way IP addresses are used. Cloudflare increasingly believes that we’ll eventually solve these challenges by completely disassociating IP addresses from identity. We’ve partnered with others in the industry to pioneer new protocols like <a href="/oblivious-dns/">Oblivious DNS over HTTPS</a> that divorce IP addresses from content being queried online to help begin to make this future a reality.</p><p>While we can envision this future, our customers need immediate ways to address regulators’ concerns. The <a href="https://almanac.httparchive.org/en/2021/third-parties#fig-4">median website in 2021</a> used 21 third-party solutions on mobile and 23 on desktop. At the <a href="https://almanac.httparchive.org/en/2021/third-parties#fig-4">90th percentile</a>, these numbers climbed to 89 third-party solutions on mobile, and 91 on desktop. Taking into account the Austrian DPA ruling, according to which the EU company itself is responsible for making sure no personal data is transmitted to the United States without proper handling, we can conclude that companies may soon become responsible for every one of their third-party solutions implemented on their website. And since this is a staggering amount of tools, it demands a scalable solution. Luckily, that is exactly what we have built.</p>
    <div>
      <h3>Zaraz’s solution leverages Cloudflare’s global network and Workers platform</h3>
      <a href="#zarazs-solution-leverages-cloudflares-global-network-and-workers-platform">
        
      </a>
    </div>
    <p>Zaraz is a third-party manager, built for speed, privacy and security. With Zaraz, customers can load analytics tools, advertising pixels, interactive widgets, and many other types of third-party tools without making any changes to their code.</p><p>Zaraz loads third party tools on the cloud, using Cloudflare Workers. There are multiple reasons why we chose to build on Workers, and you can read more about it in this <a href="/zaraz-use-workers-to-make-third-party-tools-secure-and-fast/">blog post</a>. By using Workers to offload third-party tools to the cloud and away from the browser, Zaraz creates an extra layer of security and control over Personal Identifiable Information (PII), Protected Health Information (PHI), or other sensitive pieces of information that are often unintentionally passed to third-party vendors.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1mxi46XGo4i072f0ftw7yC/6af1062eac8638bcd713178b619022df/image1-2.png" />
            
            </figure><p>In the <i>traditional</i> way of loading third-party tools, either via a Tag Management Software (TMS), a Customer Data Platform (CDP) or by including JavaScript snippets directly in the HTML, the browser always sends requests to the third-party domain. This is problematic for a bunch of reasons, but mainly because even if you wanted to, you can’t hide the user’s IP address. It is revealed with every HTTP request. It is also problematic because those tools execute remote JavaScript resources, and you have almost no visibility over the actions they take in the browser or the data they transmit.</p><p>We can use the Google Analytics example to illustrate the difference. When a website is loading Google Analytics either via Google Tag Manager or directly from the HTML, the browser downloads the <code>analytics.js</code> file that loads Google Analytics. It then sends an HTTP POST request from the browser to Google’s endpoint: <code>https://www.google-analytics.com/collect</code>. Both of these requests reveal the end-user’s IP address and might append to the URL some personal data, such as the Google Client ID, as query parameters for example.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1bWZxnvgilvw6PrUNsmkuq/943310f8ccc5e32d6b4ab3649bb96d3e/image3-3.png" />
            
            </figure><p>In comparison, when you use Zaraz to load Google Analytics, there’s simply no communication at all between the browser and Google’s endpoint. Instead, Zaraz works as an intermediary, and the entire communication is between Zaraz (which runs on Workers servers, isolated from the browser) and the third party. You can think of Zaraz as an extra protection layer between the browser and the third-party endpoint, and this extra layer allows us to include some powerful privacy features.</p><p>For example, Zaraz allows customers to decide whether to transfer an end user's IP address to Google Analytics or not. As simple as that. When configuring a new third-party tool like Google Analytics, you can choose in the tools settings page to hide IP addresses.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4nA1w99BBqIpf1NXlrBhHx/a43c97b468b46674b2059b1e79a9ffc9/image2-1.png" />
            
            </figure><p>You can use this feature currently with Google Analytics and the Facebook Pixel/Conversion API. But with more and more tools opening up their API and allowing server-to-server integrations, we expect the number of tools you can apply this on to grow rapidly.</p><p>A somewhat similar feature Zaraz offers is the Zaraz Data Loss Prevention (DLP) feature, currently used by several of our Enterprise customers. The DLP feature scans every request going to a third-party endpoint to make sure it doesn’t include sensitive information such as names, email addresses, social  security number, credit card numbers, IP addresses, and more. Using this feature, customers can either mask the data or simply be alerted when a tool is collecting such personal data. It gives full visibility and control over the information shared with third parties.</p>
    <div>
      <h3>How Zaraz Can Help with Data Localization</h3>
      <a href="#how-zaraz-can-help-with-data-localization">
        
      </a>
    </div>
    <p>Right now, you might be asking yourself, “wait, but how is Cloudflare different from Google, and won’t end users' logs go to Cloudflare’s US servers as well?” This is a great question, and where the combination of Zaraz with the Cloudflare global network makes us shine. We offer Enterprise customers Zaraz in combination with two powerful features of Cloudflare’s Data Localisation Suite: <a href="/introducing-regional-services/">Regional Services</a>, and the <a href="/introducing-the-customer-metadata-boundary/">Customer Metadata Boundary</a>.</p><p>Cloudflare Regional Services allows you to choose where you want the Cloudflare services to run, including the Zaraz service. To meet your compliance obligations, you may need control over where your data is inspected. Cloudflare Regional Services helps you decide where your data should be handled, without losing the performance benefits our network provides.</p><p>Let’s say you run a website for a European bank. Let’s also assume you enabled the Data Localisation Suite for the EU. When a person in the EU visits your website, an HTTP request is sent to activate Zaraz. Since Zaraz is running in a first-party context, meaning under your own domain, all the Data Localisation settings will apply on it as well. So the network will direct the traffic to the EU, without inspecting its content, and run Zaraz there.</p><p>The EU Customer Metadata Boundary expands the Data Localisation Suite to ensure that a customer’s end-user traffic metadata stays in the EU. “Metadata” can be a scary term, but it’s a simple concept — it just means “data about data.” In other words, it’s a description of activity that happened on our network. Using the EU Customer Metadata Boundary means that this type of metadata would be saved only in the EU.</p><p>And what about the end user’s personal data handled by Zaraz? By default, Zaraz doesn’t log or save any piece of information about the end user, with one exception in the case of error logging. To make our service better, we are saving logs of errors, so we can fix any issues. For customers that are using the Data Localisation Suite, this is something we can toggle off, which means that no log data whatsoever will be saved by Zaraz.</p>
    <div>
      <h3>What Does the Future Hold for Privacy Features?</h3>
      <a href="#what-does-the-future-hold-for-privacy-features">
        
      </a>
    </div>
    <p>Since the <a href="/cloudflare-acquires-zaraz-to-enable-cloud-loading-of-third-party-tools/">Zaraz acquisition</a>, we have been talking to hundreds of Cloudflare enterprise customers, and thousands of users using the beta for the free version of Zaraz. And we have gathered a shortlist of features that we plan to develop in 2022.</p><ul><li><p>The Zaraz Consent Manager. Zaraz is fundamentally changing the way third-party tools are implemented on the web. So, in order to provide our customers with full control over user consent management, we realized we should build our own tool to allow customers to do so easily. The Zaraz consent manager will be fully integrated with Zaraz and will allow customers to take actions according to the user choices in a few clicks.</p></li><li><p>Geolocation Triggers. We are planning to add the option to create <a href="https://developers.cloudflare.com/zaraz/get-started/create-trigger">trigger rules</a> based on an end user’s current location. This means you could configure tools to only load if the user is visiting your site from a specific region. You’d be able to even send specific events or properties according to the end-user’s location. This feature should help global companies to set granular configurations that meet the requirements of their global operations.</p></li><li><p>DLP pattern templates. At the moment, our DLP feature can scan requests going to third-party tools according to the patterns that enterprise customers create themselves. In the near future, we will introduce templates to help customers scan for common PII with more ease.</p></li></ul><p>This is just a taste of what’s coming. If you have any ideas for privacy features you’d like to see, reach out to <a>zaraz@cloudflare.com</a> – we would love to hear from you!</p><p>If you would like to explore the free beta version, please <a href="https://dash.cloudflare.com/?to=/:account/:zone/zaraz">click here</a>. Provided you are an Enterprise customer and want to learn more about Zaraz’s privacy features, please <a href="https://www.cloudflare.com/cloudflare-zaraz-third-party-tool-manager-waitlist">click here</a> to join the waitlist. To join our Discord channel, <a href="https://discord.gg/2TRr6nSxdd">click here</a>.</p> ]]></content:encoded>
            <category><![CDATA[Data Privacy Day]]></category>
            <category><![CDATA[Analytics]]></category>
            <category><![CDATA[Zaraz]]></category>
            <guid isPermaLink="false">7sjFkMUiIg78EGXJ7iMY4Q</guid>
            <dc:creator>Yair Dovrat</dc:creator>
            <dc:creator>Emily Hancock</dc:creator>
        </item>
        <item>
            <title><![CDATA[Cloudflare acquires Zaraz to enable cloud loading of third-party tools]]></title>
            <link>https://blog.cloudflare.com/cloudflare-acquires-zaraz-to-enable-cloud-loading-of-third-party-tools/</link>
            <pubDate>Wed, 08 Dec 2021 14:01:00 GMT</pubDate>
            <description><![CDATA[ We are excited to announce the acquisition of Zaraz by Cloudflare, and the launch of a beta version of the Zaraz product. You can use Zaraz (beta) to manage and load third-party tools on the cloud, and achieve significant speed, privacy and security improvements.  ]]></description>
            <content:encoded><![CDATA[ <p></p><p>We are excited to announce the acquisition of Zaraz by Cloudflare, and the launch of Cloudflare Zaraz (beta). What we are releasing today is a beta version of the Zaraz product integrated into Cloudflare’s systems and dashboard. You can use it to manage and load third-party tools on the cloud, and achieve significant speed, privacy and security improvements. We have bet on Workers, and the Cloudflare technology and network from day one, and therefore are particularly excited to be offering Zaraz to all of Cloudflare's customers today, free of charge. If you are a Cloudflare customer all you need to do is to click the <a href="https://dash.cloudflare.com/?to=/:account/:zone/zaraz">Zaraz icon</a> on the dashboard, and start configuring your third-party stack. No code changes are needed. We plan to keep releasing features in the next couple of months until this beta version is a fully-developed product offering.</p><p>It’s time to say goodbye to traditional Tag Managers and Customer Data Platforms. They have done their part, and they have done it well, but as the web evolves they have also created some crucial problems. We are here to solve that.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7bLngq6vbHBUZSlr8xFT1i/1af22fbd1a7fb1305e8264f4e6b313e4/image6-9.png" />
            
            </figure>
    <div>
      <h3>The problems of third-party bloat</h3>
      <a href="#the-problems-of-third-party-bloat">
        
      </a>
    </div>
    <p>Yo'av and I founded Zaraz after having experienced working on opposite sides of the battle for third-party tools implementation. I was working with marketing and product managers that often asked to implement just one more analytics tool on the website, while Yo'av was a developer trying to push back due to the performance hit and security risks involved.</p><p>We started building Zaraz after talking to hundreds of frustrated engineers from all around the world. It all happened when we joined Y Combinator in the winter of 2020. We were then working on a totally different product: QA software for web analytics tools. On every pitch to a new customer, we used to show a list of the tools that were being loaded on that customer's site. We also presented a list of implementation bugs related to these tools. We kept hearing the same somewhat unrelated questions over and over: “How come we load so many third-party tools? Are these causing a slowdown? Does it affect SEO? How could I protect my users if one of these tools was hacked?” No one really cared about QA. Engineers asked about the ever-increasing performance hit and security risk caused by third-party tools.</p><p>We were not sure about the answers to these questions.  But we realized there might be something bigger hidden behind them. So we decided to do some research. We built a bot and scanned the top-visited 5,000 domains in the US. We loaded them with and without third-party tools and compared the results. On average, third-party tools were slowing down the web by 40%. In the midst of the 2010s, a few years after Google released <a href="https://analytics.googleblog.com/2012/10/google-tag-manager.html">Tag Manager</a>, engineers often asked us if adding Google Tag Manager (GTM) would slow down their website. No one had a clear answer back then. Google's official answer was that GTM loads asynchronously, and therefore it should not slow the loading of the “user-visible parts” of the page. We have learned, in the meantime, that's not at all accurate.</p><p>Despite the fact that Google is pushing the market to launch faster websites, often their own stack is what is causing bloat. If you ever used Google PageSpeed Insights, you might have noticed Google pointing out their own tools as problematic in the diagnostic section. Even on Google's Merchandise Store, which uses mostly Google’s stack of tools (GTM, Analytics, ads, DoubleClick, etc.), <a href="https://lighthouse-dot-webdotdevsite.appspot.com//lh/html?url=https%3A%2F%2Fshop.googlemerchandisestore.com%2F">third-party tools block</a> the main thread for more or less four seconds. GTM itself is responsible for blocking for more than one second. The latest developments in the field, like the invention of Customer Data Platforms, only made it worse, as more third-party code is now being evaluated and run in the browser than ever before.</p><p>The <a href="https://almanac.httparchive.org/en/2021/third-parties#fig-4">median website in 2021</a> uses 21 third-party solutions on mobile and 23 on desktop, while in the <a href="https://almanac.httparchive.org/en/2021/third-parties#fig-4">90th percentile</a>, these numbers climb to a shocking amount of 89 third-party solutions on mobile, and 91 on desktop. The moment you load tens of third-party tools your website is going to be slow. It will damage important metrics like Total Blocking Time, Time to Interactive, and more. It is, in fact, a losing battle.</p><p>In an era where everything is happening online, speed becomes a competitive advantage. In today's digital climate, it is clear that a faster website affects the bottom line and beats the competition. The <a href="https://www2.deloitte.com/content/dam/Deloitte/ie/Documents/Consulting/Milliseconds_Make_Millions_report.pdf">latest data</a> published by Google and Deloitte showed that a mere 0.1 second change in load time can influence every step of the user journey, ultimately increasing conversion rates by up to 10% across different industries. Furthermore, Google announced Core Web Vitals last year, a set of metrics to measure speed that affect your SEO rankings.</p><p>This multiplicity of tools exposes websites to server security and privacy threats as well. Since most tools ask for remote JavaScript resources, customers can’t keep track of what’s being loaded on their website. And if that’s not enough, many third-party tools call other third-party resources, or redirect HTTP requests to endpoints that you never knew existed. This bad practice exposes your users to malicious threats and too often violates privacy ethics. With the adoption of GDPR, CCPA, and other regulations, that is a painful problem to have.</p><p>Trends are pointing towards a big change in how we use third-parties today, especially advertising and marketing tools. Mainstream browsers are forcing built-in strict limitations on usage of third-party cookies. The public is raising concerns about privacy and user consent issues. It's only a matter of time until marketing and advertising tools will be forced to drop usage of third-party cookies. It will only make sense then to open up their APIs and allow cloud loading for customers. And companies will need to adopt an easy-to-use infrastructure to make this shift. Building this infrastructure on the edge only makes sense, as it needs to run as close as possible to the end user to be performant.</p>
    <div>
      <h3>Make your website faster, and secure with Zaraz!</h3>
      <a href="#make-your-website-faster-and-secure-with-zaraz">
        
      </a>
    </div>
    <p>Zaraz can significantly boost a website's performance by optimizing how it loads third-party tools. Every tool we support is a bit different, but the main idea is to run whatever we can on our cloud backend instead of in the browser. Using the dashboard, customers can implement any type of third-party solution: interactive widgets, analytics tools, advertising tools, marketing automation, CRM tools, etc. The beta version includes a library of 18 third-party tools that you can integrate into your website. In a few clicks, you can start loading a tool entirely on the cloud, without any JavaScript running on the browsers of your end-users. You can learn more about our unique technology in a <a href="/zaraz-use-workers-to-make-third-party-tools-secure-and-fast/">blog post</a> written by Yo'av Moshe, our CTO.</p><p>Moving the execution of third-party scripts away from the browser has a significant impact on page loading times, simply because less code is running in the browser. It also creates an extra layer of security and control over Personal Identifiable Information, Protected Health Information, or other sensitive pieces of information that are often unintentionally passed to third-party vendors. And in the case your site does include some third-party resources, Cloudflare will announce just later today <a href="/page-shield-generally-available">PageShield</a>, a solution to <a href="https://www.cloudflare.com/learning/security/glossary/website-security-checklist/">protect your website</a> from potential risks. The two products offer a holistic solution to third-party security and privacy threats.</p><p>For customers that would like to test more complex integrations, we offer an Events API, and a set of pre-set variables you can use. This way you can measure conversions or any action taken on your website with context. For current Google Tag Manager users, we have good news: Zaraz offers <code>dataLayer</code> backward compatibility out-of-the-box. You can easily switch from GTM to Zaraz, without needing to change anything in your code base. In the near future we will make it easy to import your current GTM configuration into Zaraz as well.</p><a></a>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3XsBvZEaq20d9u105WsTE1/99ebc6a5e475b2c7658a981c2fc471c5/image3-15.png" />
            
            </figure><h3>Instacart achieves 0 ms Blocking Time, and increases security with Zaraz</h3><blockquote><p>“Leveraging Zaraz Instacart was able to significantly improve performance of our Shopper-specific domains with minimal changes required to the overall site. We had made numerous optimizations to <a href="https://shoppers.instacart.com/">https://shoppers.instacart.com/</a> but identified third-party tools as the next issue when it came to performance impact. With Zaraz we optimized third-party load times and using Cloudflare Workers we kept the integration on our own subdomain, keeping control of visibility and security.”- <b>Marc Barry</b>, Staff Software Engineer, Cloud Foundations at Instacart</p></blockquote>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2nG8nmYGN7JUiVYj9LNYAM/2c819a9347e18881bd2264c88e65875c/StTXVOnu4LkZz1prlJTjRnEee_bdCcjmu_0xjRcCXCJMIMm3l25ZAm9vuws-AZriUSH6vAh1OfGbrR3QNMAvri_9TRpJDWFgEpbDnNaMT2U209lFKf9YoYuf4426.png" />
            
            </figure><p>No one is more suitable to speak about the benefits of using Zaraz than our customers. Instacart, the leading online grocery platform in North America, has decided to test Zaraz on their <a href="http://shoppers.instacart.com">shoppers.instacart.com</a> domain. They had two objectives: to increase security and privacy, and to boost page speed (more specifically to improve Total Blocking Time).</p><p>For the security and privacy part, the fact that Zaraz, by default, saves no information whatsoever about the end-user, but merely acts as a pipeline, played an important part in their decision to test it. And by preventing third-party scripts from running directly on the browser, they intended to diminish the security risk involved in using third-party tools. To gain even more control, they have decided to use Cloudflare Workers to proxy all the requests to and from the Zaraz service, through their shoppers.instacart.com sub-domain. This gives them complete visibility and control over the process of sending data to third-parties, including Zaraz itself.</p><p>Instacart is one of the most tech-savvy companies in the world, and the Shoppers sub-domain was pretty fast to begin with, compared to other websites. They have done a lot to improve its speed metrics before. But they have reached a point where third-party scripts are the main thing slowing it down.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/xR6tdOYxcCPBcExwnAWbU/daddd34de014deaa23a8c2e9acbbcfb7/image1-40.png" />
            
            </figure><p>As presented in the graph above, launching Zaraz significantly improved page speed for mobile devices. Total Blocking Time decreased from 500 ms to 0 ms. Time to Interactive was improved by 63%, decreasing from 11.8 to 4.26 seconds. CPU Time improved by 60%, from 3.62 seconds to 1.45 seconds. And JavaScript weight shrank by 63%, from 448 KB to 165 KB.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1ughyy5auNuRlwZ9T9MtrN/aebb567738851302683dd6d6c2d0707a/image4-17.png" />
            
            </figure><p>We measured significant improvements on the desktop as well. Total Blocking Time decreased from 65 ms to 0 ms. Time to Interactive was improved by 23%, decreasing from 1.64  to 1.26 seconds. CPU Time improved by 55%, from 1.57 seconds to 0.7 seconds. And the JavaScript weight improved by the same amount — from 448 KB to 165 KB.</p><p>With more and more industry leaders like Instacart starting to offload tools to the cloud, it’s only a matter of time until most SaaS vendors and startups will start building server-side integrations as complete solutions that run on the edge. Third-party vendors never meant to do harm, they were just lacking the tools to build scalable integrations on the edge. Together with Instacart, we had a chance to connect directly with some vendors, collaborate, and work on finding the most optimized solutions. We are going to put a lot of effort moving forward into collaborating with SaaS companies and vendors, and offer them an easy way to build solutions on the edge. Stay tuned!</p>
    <div>
      <h3>The future of Zaraz as a platform</h3>
      <a href="#the-future-of-zaraz-as-a-platform">
        
      </a>
    </div>
    <p>Today marks an important milestone in our company’s life. Our team is happy to join Cloudflare’s office in Portugal where we will keep leading the product development of Zaraz. As part of Cloudflare, we will turn Zaraz into a platform on which third-party vendors can easily build tools and leverage Cloudflare’s global network capabilities. We will lead the entire industry toward adoption of server-side loading of third-party tools and will make it possible for everyone to build better, faster and more secure products easily.</p><p>The fact that Zaraz was running entirely on Workers, even before we joined Cloudflare, made the integration simple and fast. As a result, we can quickly move on to building new features until we reach a complete offering and general availability. Cloudflare’s unique, in-house abilities will enable us to make Zaraz even more robust and simplify the onboarding process of new customers. One big improvement we have already achieved is that Cloudflare customers don’t need to make any code changes to use Zaraz. Once it is toggled on, our script will be in-lined directly in the <code>&lt;head&gt;</code> of the HTML. Another exciting point is that the entire service is now running on your own domain.</p><p>Furthermore, we are planning to leverage Cloudflare's expertise to expand our feature set and help our customers deal with more security threats and privacy risks presented by third-party code. One example is adding geolocation triggers, to make it possible to load different tools to end-users who visit your website from different parts of the world. This is needed to stay compliant with different regulations. Another example is the Data Loss Prevention feature, currently used by several of our enterprise customers. The DLP feature scans every request that’s going to a third-party endpoint, to make sure it doesn’t include sensitive information such as names, email addresses, SSN, etc. There are plenty more features in the pipeline.</p><p>An influential company like Cloudflare will help us drive positive change in the market, pushing vendors to build on the edge, and companies to adopt cloud loading. We plan to extend our SDK to enable all third-party vendors to build their integrations on our platform and easily run their solutions on the edge, using Workers. Together with Cloudflare, we will play a leading role in the shift to cloud loading of third-party code. It’s time to say goodbye to Tag Managers and Customer Data Platforms. This announcement marks the end of an era. In no time, we are all going to enjoy a browsing experience that's 40% faster, simply by optimizing how websites load third-party tools.</p><p>Offering Zaraz to the millions of Cloudflare's users from all around the world takes us one step further towards achieving our goal: making the Internet faster and safer, for everyone. We believe that the user experience of any website — small or large — should not be degraded by the use of analytics, chatbots, or any other third-party tool. These tools should <i>improve</i> the user experience, not impair it. And we won't rest until the entire web shifts to cloud loading of third-party tools, freeing the browser to do what it was initially designed to do: loading websites. We are excited by this future and won't rest until it's achieved.</p><p>If you would like to explore the free beta version, <a href="https://dash.cloudflare.com/?to=/:account/:zone/zaraz">please click here</a>. If you are an enterprise and have additional/custom requirements, please <a href="https://www.cloudflare.com/cloudflare-zaraz-third-party-tool-manager-waitlist/">click here</a> to join the waitlist. To join our Discord channel, <a href="https://discord.gg/2TRr6nSxdd">click here</a>.</p> ]]></content:encoded>
            <category><![CDATA[CIO Week]]></category>
            <category><![CDATA[Zaraz]]></category>
            <category><![CDATA[Acquisitions]]></category>
            <guid isPermaLink="false">4gfK398sSCWQZlrmahA7HP</guid>
            <dc:creator>Yair Dovrat</dc:creator>
        </item>
    </channel>
</rss>