
<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>Mon, 13 Apr 2026 15:03:13 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[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[Announcing AI Gateway: making AI applications more observable, reliable, and scalable]]></title>
            <link>https://blog.cloudflare.com/announcing-ai-gateway/</link>
            <pubDate>Wed, 27 Sep 2023 13:00:35 GMT</pubDate>
            <description><![CDATA[ AI Gateway helps developers have greater control and visibility in their AI apps, so that you can focus on building without worrying about observability, reliability, and scaling. AI Gateway handles the things that nearly all AI applications need ]]></description>
            <content:encoded><![CDATA[ <p></p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3KExrqxBeL4yGLYsMeeZ2j/26e12b714f8653f8132aeaf14c0a1e78/image4-10.png" />
            
            </figure><p>Today, we’re excited to announce our beta of <b>AI Gateway</b> – the portal to making your AI applications more observable, reliable, and scalable.</p><p>AI Gateway sits between your application and the AI APIs that your application makes requests to (like OpenAI) – so that we can cache responses, limit and retry requests, and provide analytics to help you monitor and track usage. AI Gateway handles the things that nearly all AI applications need, saving you engineering time, so you can focus on what you're building.</p>
    <div>
      <h3>Connecting your app to AI Gateway</h3>
      <a href="#connecting-your-app-to-ai-gateway">
        
      </a>
    </div>
    <p>It only takes one line of code for developers to get started with Cloudflare’s AI Gateway. All you need to do is replace the URL in your API calls with your unique AI Gateway endpoint. For example, with OpenAI you would define your baseURL as <code>"https://gateway.ai.cloudflare.com/v1/ACCOUNT_TAG/GATEWAY/openai"</code> instead of <code>"https://api.openai.com/v1"</code> – and that’s it. You can keep your tokens in your code environment, and we’ll log the request through AI Gateway before letting it pass through to the final API with your token.</p>
            <pre><code>// configuring AI gateway with the dedicated OpenAI endpoint

const openai = new OpenAI({
  apiKey: env.OPENAI_API_KEY,
  baseURL: "https://gateway.ai.cloudflare.com/v1/ACCOUNT_TAG/GATEWAY/openai",
});</code></pre>
            <p>We currently support model providers such as OpenAI, Hugging Face, and Replicate with plans to add more in the future. We support all the various endpoints within providers and also response streaming, so everything should work out-of-the-box once you have the gateway configured. The dedicated endpoint for these providers allows you to connect your apps to AI Gateway by changing one line of code, without touching your original payload structure.</p><p>We also have a universal endpoint that you can use if you’d like more flexibility with your requests. With the universal endpoint, you have the ability to define fallback models and handle request retries. For example, let’s say a request was made to OpenAI GPT-3, but the API was down – with the universal endpoint, you could define Hugging Face GPT-2 as your fallback model and the gateway can automatically resend that request to Hugging Face. This is really helpful in improving resiliency for your app in cases where you are noticing unusual errors, getting rate limited, or if one bill is getting costly, and you want to diversify to other models. With the universal endpoint, you’ll just need to tweak your payload to specify the provider and endpoint, so we can properly route requests for you. Check out the example request below and <a href="https://developers.cloudflare.com/ai-gateway">the docs</a> for more details on the universal endpoint schema.</p>
            <pre><code># Using the Universal Endpoint to first try OpenAI, then Hugging Face

curl https://gateway.ai.cloudflare.com/v1/ACCOUNT_TAG/GATEWAY  -X POST \
  --header 'Content-Type: application/json' \
  --data '[
  {
    "provider": "openai",
    "endpoint": "chat/completions",
    "headers": { 
      "Authorization": "Bearer $OPENAI_TOKEN",
      "Content-Type": "application/json"
    },
    "query": {
      "model": "gpt-3.5-turbo",
      "stream": true,
      "messages": [
        {
          "role": "user",
          "content": "What is Cloudflare?"
        }
      ]
    }
  },
  {
    "provider": "huggingface",
    "endpoint": "gpt2",
    "headers": { 
      "Authorization": "Bearer $HF_TOKEN",
      "Content-Type": "application/json"
    },
    "query": {
      "inputs": "What is Cloudflare?"
    }
  },
]'</code></pre>
            
    <div>
      <h3>Gaining visibility into your app’s usage</h3>
      <a href="#gaining-visibility-into-your-apps-usage">
        
      </a>
    </div>
    <p>Now that your app is connected to Cloudflare, we can help you gather analytics and give insight and control on the traffic that is passing through your apps. Regardless of what model or infrastructure you use in the backend, we can help you log requests and analyze data like the number of requests, number of users, cost of running the app, duration of requests, etc. Although these seem like basic analytics that model providers should expose, it’s surprisingly difficult to get visibility into these metrics with the typical model providers. AI Gateway takes it one step further and lets you aggregate analytics across multiple providers too.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7yPlnJxKwRTlaUEeU9qvpg/706604d295c464f7d1608df10311e1d4/image3-24.png" />
            
            </figure>
    <div>
      <h3>Controlling how your app scales</h3>
      <a href="#controlling-how-your-app-scales">
        
      </a>
    </div>
    <p>One of the pain points we often hear is how expensive it costs to build and run AI apps. Each API call can be unpredictably expensive and costs can rack up quickly, preventing developers from scaling their apps to their full potential. At the speed that the industry is moving, you don’t want to be limited by your scale and left behind – and that’s where <a href="https://www.cloudflare.com/learning/cdn/what-is-caching/">caching</a> and rate limiting can help. We allow developers to cache their API calls so that new requests can be served from our cache rather than the original API – making it cheaper and faster. <a href="https://www.cloudflare.com/learning/bots/what-is-rate-limiting/">Rate limiting</a> can also help control costs by throttling the number of requests and preventing excessive or suspicious activity. Developers have full flexibility to define caching and rate limiting rules, so that apps can scale at a sustainable pace of your choosing.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6EgZOiCNWYJkkqeEjkV9Ew/cad537af80e68a5eac2b1f6c8cc977d0/image1-20.png" />
            
            </figure>
    <div>
      <h3>The Workers AI Platform</h3>
      <a href="#the-workers-ai-platform">
        
      </a>
    </div>
    <p>AI Gateway pairs perfectly with our new <a href="/workers-ai">Workers AI</a> and <a href="/vectorize-vector-database-open-beta">Vectorize</a> products, so you can build full-stack AI applications all within the Workers ecosystem. From deploying applications with Workers, running model inference on the edge with Workers AI, storing <a href="https://www.cloudflare.com/learning/ai/what-are-embeddings/">vector embeddings</a> on Vectorize, to gaining visibility into your applications with AI Gateway – the Workers platform is your one-stop shop to bring your AI applications to life. To learn how to use AI Gateway with Workers AI or the different providers, check out <a href="https://developers.cloudflare.com/ai-gateway/">the docs</a>.</p>
    <div>
      <h3>Next up: the enterprise use case</h3>
      <a href="#next-up-the-enterprise-use-case">
        
      </a>
    </div>
    <p>We are shipping v1 of AI Gateway with a few core features, but we have plans to expand the product to cover more advanced use cases as well – usage alerts, jailbreak protection, dynamic model routing with A/B testing, and advanced cache rules. But what we’re really excited about are the other ways you can apply AI Gateway…</p><p>In the future, we want to develop AI Gateway into a product that helps organizations monitor and observe how their users or employees are using AI. This way, you can flip a switch and have all requests within your network to providers (like OpenAI) pass through Cloudflare first – so that you can log user requests, apply access policies, enable rate limiting and <a href="https://www.cloudflare.com/learning/access-management/what-is-dlp/">data loss prevention (DLP)</a> strategies. A powerful example: if an employee accidentally pastes an API key to ChatGPT, AI Gateway can be configured to see the outgoing request and redact the API key or block the request entirely, preventing it from ever reaching OpenAI or any end providers. We can also log and alert on suspicious requests, so that organizations can proactively investigate and control certain types of activity. AI Gateway then becomes a really powerful tool for organizations that might be excited about the efficiency that <a href="https://www.cloudflare.com/learning/ai/what-is-artificial-intelligence/">AI</a> unlocks, but hesitant about trusting AI when <a href="https://www.cloudflare.com/learning/privacy/what-is-data-privacy/">data privacy</a> and user error are really critical threats. We hope that AI Gateway can alleviate these concerns and make adopting AI tools a lot easier for organizations.</p><p>Whether you’re a developer building applications or a company who’s interested in how employees are using AI, our hope is that AI Gateway can help you demystify what’s going on inside your apps – because once you understand how your users are using AI, you can make decisions on how you actually want them to use it. Some of these features are still in development, but we hope this illustrates the power of AI Gateway and our vision for the future.</p><p>At Cloudflare, we live and breathe innovation (as you can tell by our Birthday Week announcements!) and the pace of innovation in AI is incredible to witness. We’re thrilled that we can not only help people build and use apps, but actually help <i>accelerate</i> the adoption and development of AI with greater control and visibility. We can’t wait to hear what you build – head to the Cloudflare dashboard to <a href="https://dash.cloudflare.com/?to=/:account/ai/ai-gateway/general/">try out AI Gateway</a> and let us know what you think!</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3HQSDDrg5pgwRfiz2kAOXP/dca3745aa7d061a0b37d36de6537cf65/image2-17.png" />
            
            </figure><p></p> ]]></content:encoded>
            <category><![CDATA[Birthday Week]]></category>
            <category><![CDATA[AI Gateway]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[AI]]></category>
            <guid isPermaLink="false">7aWkvjGXI3nxWNZsx759Q5</guid>
            <dc:creator>Michelle Chen</dc:creator>
            <dc:creator>Yo'av Moshe</dc:creator>
            <dc:creator>Meaghan Choi</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[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[Zaraz use Workers to make third-party tools secure and fast]]></title>
            <link>https://blog.cloudflare.com/zaraz-use-workers-to-make-third-party-tools-secure-and-fast/</link>
            <pubDate>Wed, 08 Dec 2021 14:00:00 GMT</pubDate>
            <description><![CDATA[ Zaraz fundamentally changes how third-parties are loaded on the web. Learn how we built it from the ground up, and why we chose Cloudflare Worker to power it. ]]></description>
            <content:encoded><![CDATA[ 
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4WT0OzykEX9fSzalaoD8GP/138b4dab26180f9995f46a9172708078/image4-14.png" />
            
            </figure><p>We decided to create Zaraz around the end of March 2020. We were working on another product when we noticed everyone was asking us about the performance impact of having many third-parties on their website. Third-party content is an important part of the majority of websites today, powering analytics, chatbots, conversion pixels, widgets — you name it. The definition of third-party is an asset, often JavaScript, hosted outside the primary site-user relationship, that is not under the direct control of the site owner but is present with ‘approval’. <a href="/cloudflare-acquires-zaraz-to-enable-cloud-loading-of-third-party-tools">Yair wrote in detail about the process of measuring the impact of these third-party tools, and how we pivoted our startup</a>, but I wanted to write about how we built Zaraz and what it actually does behind the scenes.</p><p>Third parties are great in that they let you integrate already-made solutions with your website, and you barely need to do any coding. Analytics? Just drop this code snippet. Chat widget? Just add this one. Third-party vendors will usually instruct you on how to add their tool, and from that point on things should just be working. Right? But when you add third-party code, it usually fetches even more code from remote sources, meaning you have less and less control over whatever is happening in your visitors’ browsers. How can you guarantee that none of the multitude of third parties you have on your website wasn’t hacked, and started <a href="https://www.theregister.com/2018/12/12/ticketmaster_denies_fault_website_magecart_infection/">stealing information</a>, <a href="https://www.wired.co.uk/article/browsealoud-ico-texthelp-cryptomining-how-cryptomining-work">mining cryptocurrencies</a> or logging key presses on your visitors' computers?</p><p>It doesn’t even have to be a deliberate hack. As we investigated more and more third-party tools, we noticed a pattern — sometimes it’s easier for a third-party vendor to collect everything, rather than being selective or careful about it. More often than not, user emails would find their way into a third-party tool, which could very easily put the website owner in trouble due to GDPR, CCPA, or similar.</p>
    <div>
      <h2>How third-party tools work today</h2>
      <a href="#how-third-party-tools-work-today">
        
      </a>
    </div>
    <p>Usually, when you add a third party to your page, you’re asked to add a piece of JavaScript code to the <code>&lt;head&gt;</code> of your HTML. Google Analytics is by far the most popular third-party, so let’s see how it’s done there:</p>
            <pre><code>&lt;!-- Google Analytics --&gt;
&lt;script&gt;
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-XXXXX-Y', 'auto');
ga('send', 'pageview');
&lt;/script&gt;
&lt;!-- End Google Analytics --&gt;</code></pre>
            <p>In this case, and in most other cases, the snippet that you’re pasting actually calls more JavaScript code to be executed. The snippet above creates a new <code>&lt;script&gt;</code> element, gives it the <code>https://www.google-analytics.com/analytics.js</code> <code>src</code> attribute, and appends it to the DOM. The browser then loads the <code>analytics.js</code> script, which includes more JavaScript code than the snippet itself, and sometimes asks the browser to download even more scripts, some of them bigger than <code>analytics.js</code> itself. So far, however, no analytics data has been captured at all, although this is why you’ve added Google Analytics in the first place.</p><p>The last line in the snippet, <code>ga('send', 'pageview');</code>, uses a function defined in the <code>analytics.js</code> file to finally <code>send</code> the <code>pageview</code>. The function is needed because it is what is capturing the analytics data — it fetches the kind of browser, the screen resolution, the language, etc…  Then, it constructs a URL that includes all the data, and  sends a request to this URL. It’s only after this step that the analytics information gets captured. Every user behavior event you record using Google Analytics will result in another request.</p><p>The reality is that the vast majority of tools consist of more than one resource file, and that it’s practically impossible to know in advance what a tool is going to load without testing it on your website. You can use <a href="https://requestmap.webperf.tools/">Request Map Generator</a> to get a visual representation of all the resources loaded on your website, including how they call each other. Below is a Request Map of a demo e-commerce website we created:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6d0x1iH8o1cnjj1qJkJXt2/9cf3432bf125d8e6cd4bee4136a6d633/image6-6.png" />
            
            </figure><p>That big blue circle is our website’s resources, and all other circles are third-party tools. You can see how the big green circle is actually a sub-request of the main Facebook pixel (fbevents.js), and how many tools, like LinkedIn on top right, are creating a redirect chain in order to sync some data, on the expense of forcing the browser to make more and more network requests.</p>
    <div>
      <h2>A new place to run a tag manager — the edge</h2>
      <a href="#a-new-place-to-run-a-tag-manager-the-edge">
        
      </a>
    </div>
    <p>Since we want to make third-parties faster, more secure, and private, we had to develop a fundamental new way of thinking about them and a new system for how they run. We came up with a plan: build a platform where third-parties can run code outside the browser, while still getting access to the information they need and being able to talk with the DOM when necessary. We don’t believe third parties are evil: they never intended to slow down the Internet for everyone, they just didn’t have another option. Being able to run code on the edge and run it fast opened up new possibilities and changed all that, but the transition is hard.</p><p>By moving third-party code to run outside the browser, we get multiple wins.</p><ul><li><p>The website will load faster and be more interactive. The browser rendering your website can now focus on the most important thing — your website. The downloading, parsing and execution of all the third-party scripts will no longer compete or even block the rendering and interactivity of your website.</p></li><li><p>Control over the data sent to third-parties. Third-party tools often automatically collect information from the page and from the browser to, for example, measure site behaviour/usage. In many cases, <a href="https://www.backblaze.com/blog/privacy-update-third-party-tracking/">this information should stay private</a>. For example, most tools collect the <code>document.location</code>, but we often see a “reset password” page including the user email in the URL, meaning emails are unknowingly being sent and saved by third-party providers, usually without consent. Moving the execution of the third parties to the edge means we have full visibility into what is being sent. This means we can provide alerts and filters in case tools are trying to collect Personally Identifiable Information or mask the private parts of the data before they reach third-party servers. This feature is currently not available on the public beta, but contact us if you want to start using it today.</p></li><li><p>By reducing the amount of code being executed in the browser and by scanning all code that is executed in it, we can continuously verify that the code hasn’t been tampered with and that it only does what it is intended to do. We are working to connect Zaraz with <a href="https://www.cloudflare.com/page-shield/">Cloudflare Page Shield</a> to do this automatically.</p></li></ul><p>When you configure a third-party tool through a normal tag manager, a lot happens in the browsers of your visitors which is out of your control. The tag manager will load and then evaluate all trigger rules to decide which tools to load. It would then usually append the script tags of those tools to the DOM of the page, making the browser fetch the scripts and execute them. These scripts come from untrusted or unknown origins, increasing the risk of malicious code execution in the browser. They can also block the browser from becoming interactive until they are completely executed. They are generally free to do whatever they want in the browser, but most commonly they would then collect some information and send it to some endpoint on the third-party server. With Zaraz, the browser essentially does none of that.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4FfeOuSS5KXe1m3JtPX8LB/9c7de59bbd06987f1f2a9b9fdac17df0/BLOG-713---Pageload.png" />
            
            </figure>
    <div>
      <h2>Choosing Cloudflare Workers</h2>
      <a href="#choosing-cloudflare-workers">
        
      </a>
    </div>
    <p>When we set about coding Zaraz, we quickly understood that our infrastructure decisions would have a massive impact on our service. In fact, choosing the wrong one could mean we have no service at all. The most common alternative to Zaraz is traditional Tag Management software. They generally have no server-side component: whenever a user “publishes” a configuration, a JavaScript file is rendered and hosted as a static asset on a CDN. With Zaraz the idea is to move most of the evaluation of code out of the browser, and respond with a dynamically generated JavaScript code each time. We needed to find a solution that would allow us to have a server-side component, but would be as fast as a <a href="https://www.cloudflare.com/learning/cdn/what-is-a-cdn/">CDN</a>. Otherwise, there was a risk we might end up slowing down websites instead of making them faster.</p><p>We needed Zaraz to be served from a place close to the visiting user. Since setting up servers all around the world seemed like too big of a task for a very young startup, we looked at a few distributed serverless platforms. We approached this search with a small list of requirements:</p><ul><li><p><b>Run JavaScript:</b> Third-party tools all use JavaScript. If we were to port them to run in a cloud environment, the easiest way to do so would be to be able to use JavaScript as well.</p></li><li><p><b>Secure:</b> We are processing sensitive data. We can’t afford the risk of someone hacking into our EC2 instance. We wanted to make sure that data doesn’t stay on some server after we sent our HTTP response.</p></li><li><p><b>Fully programmable:</b> Some CDNs allow setting complicated rules for handling a request, but altering HTTP headers, setting redirects or HTTP response codes isn’t enough. We need to generate JavaScript code on the fly, meaning we need full control over the responses. We also need to use some external JavaScript libraries.</p></li><li><p><b>Extremely fast and globally distributed:</b> In the very early stages of the company, we already had customers in the USA, Europe, India, and Israel. As we were preparing to show them a Proof of Concept, we needed to be sure it would be fast wherever they are. We were competing with tag managers and Customer Data Platforms that have a pretty fast response time, so we need to be able to respond as fast as if our content was statically hosted on a CDN, or faster.</p></li></ul><p>Initially we thought we would need to create Docker containers that would run around the globe and would use their own HTTP server, but then a friend from our Y Combinator batch said we should check out Cloudflare Workers.</p><p>At first, we thought it wouldn’t work — Workers doesn’t work like a Node.js application, and we felt that limitation would prevent us from building what we wanted. We planned to let Workers handle the requests coming from users’ browsers, and then use an AWS Lambda for the heavy lifting of actually processing data and sending it to third-party vendors.</p><p>Our first attempt with Workers was very simple: just confirming we could use it to actually return dynamic browser-side JavaScript that is generated on-the-fly:</p>
            <pre><code>addEventListener('fetch', (event) =&gt; {
 event.respondWith(handleRequest(event.request))
})
 
async function handleRequest(request) {
   let code = '(function() {'
  
   if (request.headers.get('user-agent').includes('Firefox')) {
     code += `console.log('Hello Firefox!');`
   } else {
     code += `console.log('Hey other browsers...');`
   }
  
   code += '})();'
  
   return new Response(code, {
     headers: { 'content-type': 'text/javascript' }
   });
}</code></pre>
            <p>It was a tiny example, but I remember calling Yair afterwards and saying “this could actually work!”. It proved the flexibility of Workers. We just created an endpoint that served a JavaScript file, this JavaScript file was dynamically generated, and the response time was less than 10ms. We could now put <code>&lt;script src="path/to/worker.js"&gt;</code> in our HTML and treat this Worker like a normal JavaScript file.</p><p>As we took a deeper look, we found Workers answering demand after demand from our list, and learned we could even do the most complicated things inside Workers. The Lambda function started doing less and less, and was eventually removed. Our little Node.js proof-of-concept was easily converted to Workers.</p>
    <div>
      <h2>Using the Cloudflare Workers platform: “standing on the shoulders of giants”</h2>
      <a href="#using-the-cloudflare-workers-platform-standing-on-the-shoulders-of-giants">
        
      </a>
    </div>
    <p>When we raised our seed round we heard many questions like “if this can work, how come it wasn’t built before?” We often said that while the problem has been a long standing one, accessible edge computing is a new possibility. Later, on our first investors update after creating the prototype, we told them about the unbelievably fast response time we managed to achieve and got much praise for it — talk about “standing on the shoulders of giants”. Workers simply checked all our boxes. Running JavaScript and using the same V8 engine as the browser meant that we could keep the same environment when porting tools to run on the cloud (it also helped with hiring). It also opened the possibility of later on using WebAssembly for certain tasks. The fact that Workers are serverless and stateless by default was a selling point for our own trustworthiness: we told customers we couldn’t save their personal data even by mistake, which was true. The integration between webpack and Wrangler meant that we could write a full-blown application — with modules and external dependencies — to shift 100% of our logic into our Worker. And the performance helped us ace all our demos.</p><p>As we were building Zaraz, the Workers platform got more advanced. We ended up using Workers KV for storing user configuration, and Durable Objects for communicating between Workers. Our main Worker holds server-side implementations of more than 50 popular third-party tools, replacing hundreds of thousands of JavaScript lines of code that traditionally run inside browsers. It’s an ever growing list, and we recently also published an SDK that allows third-party vendors to build support for their tools by themselves. For the first time, they can do it in a secure, private, and fast environment.</p>
    <div>
      <h2>A new way to build third-parties</h2>
      <a href="#a-new-way-to-build-third-parties">
        
      </a>
    </div>
    <p>Most third-party tools do two fundamental things: First, they collect some information from the browser such as screen resolution, current URL, page title or cookie content. Second, they send it to their server. It is often simple, but when a website has tens of these tools, and each of them query for the information it needs and then sends its requests, it can cause a real slowdown. On Zaraz, this looks very different: Every tool provides a <code>run</code> function, and when Zaraz evaluates the user request and decides to load a tool, it executes this <code>run</code> function. This is how we built integrations for over 50 different tools, all from different categories, and this is how we’re inviting third-party vendors to write their own integrations into Zaraz.</p>
            <pre><code>run({system, utils}) { 
  // The `system` object includes information about the current page, browser, and more 
  const { device, page, cookies } = system
  // The `utils` are a set of functions we found useful across multiple tools
  const { getCookieString, waitUntil } = utils

  // Get the existing cookie content, or create a new UUID instead
  const cookieName = 'visitor-identifier'
  const sessionCookie = cookies[cookieName] || crypto.randomUUID()

  // Build the payload
  const payload = {
    session: sessionCookie,
    ip: device.ip,
    resolution: device.resolution,
    ua: device.userAgent,
    url: page.url.href,
    title: page.title,
  }

  // Construct the URL
  const baseURL = 'https://example.com/collect?'
  const params = new URLSearchParams(payload)
  const finalURL = baseURL + params

  // Send a request to the third-party server from the edge
  waitUntil(fetch(finalURL))
  
  // Save or update the cookie in the browser
  return getCookieString(cookieName, sessionCookie)
}</code></pre>
            <p>The above code runs in our Cloudflare Worker, instead of the browser. Previously, having 10x more tools meant 10x more requests browsers rendering your website needed to make, and 10x more JavaScript code they needed to evaluate. This code would often be repetitive, for example, almost every tool implements their own “get cookie” function. It’s also 10x more origins you have to trust no one is tampering with. When running tools on the edge, this doesn’t affect the browser at all: you can add as many tools as you want, but they wouldn’t be loading in the browser, so they will have no effect.</p><p>In this example, we first check for the existence of a cookie that identifies the session, called “visitor-identifier”. If it exists, we read its value; if not, we generate a new UUID for it. Note that the power of Workers is all accessible here: we use <code>crypto.randomUUID()</code> just like we can use any other Workers functionality. We then collect all the information our example tool needs — user agent, current URL, page title, screen resolution, client IP address — and the content of the “visitor-identifier” cookie. We construct the final URL that the Worker needs to send a request to, and we then use <code>waitUntil</code> to make sure the request gets there. Zaraz’s version of fetch gives our tools automatic logging, data loss prevention and retries capabilities.</p><p>Lastly, we return the value of the <code>getCookieString</code> function. Whatever string is returned by the <code>run</code> function is passed to the visitor as browser-side JavaScript. In this case, <code>getCookieString</code> returns something like <code>document.cookie = 'visitor-identifier=5006e6fa-7ce6-45ef-8724-c846f1953369; Path=/; Max-age=31536000';</code>, causing the browser to create a first-party cookie. The next time a user loads a page, the <code>visitor-identifier</code> cookie should exist, causing Zaraz to reuse the UUID instead of creating a new one.</p><p>This system of <code>run</code> functions allows us to separate and isolate each tool to run independently of the rest of the system, while still providing it with all the required context and data coming from the browser, and the capabilities of Workers. We are inviting third-party vendors to work with us to build the future of secure, private and fast third-party tools.</p>
    <div>
      <h2>A new events system</h2>
      <a href="#a-new-events-system">
        
      </a>
    </div>
    <p>Many third-party tools need to collect behavioral information during a user visit. For example, you might want to place a conversation pixel right after a user clicked “submit” on the credit card form. Since we moved tools to the cloud, you can’t access their libraries from the browser context anymore. For that we created <code>zaraz.track()</code> — a method that allows you to call tools programmatically, and optionally provide them with more information:</p>
            <pre><code>document.getElementById("credit-card-form").addEventListener("submit", () =&gt; {
  zaraz.track("card-submission", {
    value: document.getElementById("total").innerHTML,
    transaction: "X-98765",
  });
});</code></pre>
            <p>In this example, we’re letting Zaraz know about a trigger called “card-submission”, and we associate some data with it — the <code>value</code> of the transaction that we’re taking from an element with the ID <code>total</code>, and a transaction code that is hardcoded and gets printed directly from our backend.</p><p>In the Zaraz interface, configured tools can be subscribed to different and multiple triggers. When the code above gets triggered, Zaraz checks, on the edge, what tools are subscribed to the card-submission trigger, and it then calls them with the right additional data supplied, populating their requests with the transaction code and its value.</p><p>This is different from how traditional tag managers work: GTM’s <code>dataLayer.push</code> serves a similar purpose, but is evaluated client-side. The result is that GTM itself, when used intensively, will grow its script so much that it can become the heaviest tool a website loads. Each event sent using <code>dataLayer.push</code> will cause repeated evaluation of code in the browser, and each tool that will match the evaluation will execute code in the browser, and might call more external assets again. As these events are usually coupled with user interactions, this often makes interacting with a website feel slow, because running the tools is occupying the main thread. With Zaraz, these tools exist and are evaluated only at the edge, improving the website’s speed and security.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/zfeXBueyJMyduWMF5VzXv/37af1f8270a57bab5edaad333ed6ff85/unnamed-7.png" />
            
            </figure><p>You don’t have to be coder to use triggers. The Zaraz dashboard allows you to choose from a predefined set of templates like click listeners, scroll events and more, that you can attach to any element on your website without touching your code. When you combine <code>zaraz.track()</code> with the ability to program your own tools, what you get is essentially a one-liner integration of Workers into your website. You can write any backend code you want and Zaraz will take care of calling it exactly at the right time with the right parameters.</p>
    <div>
      <h2>Joining Cloudflare</h2>
      <a href="#joining-cloudflare">
        
      </a>
    </div>
    <p>When new customers started using Zaraz, we noticed a pattern: the best teams we worked with chose Cloudflare, and some were also moving parts of their backend infrastructure to Workers. We figured we could further improve performance and integration for companies using Cloudflare as well. We could inline parts of the code inside the page and then further reduce the amount of network requests. Integration also allowed us to remove the time it takes to DNS resolve our script, because we could use Workers to proxy Zaraz into our customers' domains. Integrating with Cloudflare made our offering even more compelling.</p><p>Back when we were doing Y Combinator in Winter 2020 and realized how much third parties could affect a websites’ performance, we saw a grand mission ahead of us: creating a faster, private, and secure web by reducing the amount of third-party bloat. This mission remained the same to this day. As our conversations with Cloudflare got deeper, we were excited to realize that we’re talking with people who share the same vision. We are thrilled for the opportunity to scale our solutions to millions of websites on the Internet, making them faster and safer and even reducing carbon emissions.</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[Cloudflare Workers]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <guid isPermaLink="false">WKGRmdzjfhPVQe2iAYCmP</guid>
            <dc:creator>Yo'av Moshe</dc:creator>
            <dc:creator>Andrew Galloni</dc:creator>
        </item>
    </channel>
</rss>