Sentry Logo Debug Microservices & Distributed Systems

Join my free newsletter

Level up your dev skills and career with curated tips, practical advice, and in-depth tech insights – all delivered straight to your inbox.

Updated on
3 min read
Up to date

Trevor I. Lasn

Staff Software Engineer & Engineering Manager

Offload Your Third Party Scripts With Cloudflare Zaraz

How I used Cloudflare Zaraz to offload third party scripts and improve my website performance.

While optimizing my website’s performance, I discovered Cloudflare Zaraz - a tool that helps offload third-party scripts. After implementing it, my mobile performance score improved from around 75% to over 90%. Beyond the speed improvements, it also had a positive impact on SEO.

trevorlasn.com Page Speed Insights

What is Cloudflare Zaraz?

Cloudflare Zaraz is a third-party manager that runs your third-party tools server-side instead of in the user’s browser. This means fewer requests, better privacy, and faster page loads.

Cloudflare Zaraz

I was able to offload Google Analytics and Simple Analytics scripts to Cloudflare’s edge network. This reduced the number of requests made by my website and improved the overall performance.

With Cloudflare Zaraz you can load tools such as analytics tools, advertising pixels and scripts, chatbots, marketing automation tools, and more, in the most optimized way.

Why use Zaraz?

  • Performance: Third-party scripts run on Cloudflare’s edge, not the visitor’s browser
  • Privacy: Better control over what data is shared with third parties
  • Security: Reduced risk from third-party code vulnerabilities
  • Simplified Management: Central dashboard to manage all third-party tools

Setting up Zaraz

Enable Zaraz in your Cloudflare dashboard:

  • Select Zaraz from the side menu.
  • If you have already added a tool before, select Tools Configuration > Third-party tools and click on Add new tool.
  • Choose a tool from the tools catalog. Select Continue to confirm your selection.
  • In Set up, configure the settings for your new tool. The information you need to enter will depend on the tool you choose. If you want to use any dynamic properties or variables, select the + sign in the drop-down menu next to the relevant field.
  • In Actions setup the actions for your new tool. You should be able to select Pageviews, Events or E-Commerce 1.
  • Select Save.

Cloudflare Zaraz has significantly improved my site’s performance while maintaining the functionality of my third-party tools. It’s a great example of how moving processing to the edge can benefit both users and developers.

Disclaimer: I’m not affiliated with Cloudflare, and this is not a sponsored post. I’m sharing my experience with Zaraz to help others improve their website performance.

Useful Resources


Become a better engineer

Here are engineering resources I've personally vetted and use. They focus on skills you'll actually need to build and scale real projects - the kind of experience that gets you hired or promoted.

Many companies have a fixed annual stipend per engineer (e.g. $2,000) for use towards learning resources. If your company offers this stipend, you can forward them your invoices directly for reimbursement.


This article was originally published on https://www.trevorlasn.com/blog/cloudflare-zaraz. It was written by a human and polished using grammar tools for clarity.

Interested in a partnership? Shoot me an email at hi [at] trevorlasn.com with all relevant information.