Debugging Microservices & Distributed Systems
Updated on
3 min read

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


Related Articles

If you enjoyed this article, you might find these related pieces interesting as well.

Recommended Engineering Resources

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.

Imagine where you would be in two years if you actually took the time to learn every day. A little effort consistently adds up, shaping your skills, opening doors, and building the career you envision. Start now, and future you will thank you.


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.