This article evaluates the use of Cloudflare’s Zaraz and compares it to a clientside implementation of Google Analytics through Google Tag Manager.
From a market research perspective, I will specifically look at a webpage’s loading times and the (location) accuracy within google analytics.
I am in the process of revamping my marketing consulting business, and with that comes the update of the website. One vital step is the implementation of analytics which I wanted to do today. (done, click here to skip to my final decision, it may come as a surprise)
The Cloudflare Zaraz comparison is preliminary to my interest in the following topics:
- How to adhere to privacy regulations in the EU (& thus worldwide – GDPR & Schremms II)
- The sunsetting of Universal Analytics (Google Analytics 3) on July 1st of this year (2023)
- What are the benefits of a serverside or cloud-based analytics hosting solution
- How to prepare for the future regarding data & analytics
I also wanted to write another article and share my findings with you, so 2 birds, 1 stone 🙂
Let’s dive in, shall we?
- Note that I have not yet ‘peer reviewed’ my findings. I will do this with the publication of this article, after which I will notify and share my findings on the Zaraz community forums and Twitter and ask for feedback.
- I am also a bit cautious about the results of the different online speed testing tools;
I have done several tests on the same day with the same settings and tools, and the results were very different for the first few tests. I will repeat the same tests on other days to compare more comprehensively.
What is Cloudflare Zaraz? And What Are The Potential Benefits?
If you’re familiar with Cloudflare, you know they specialize in making the internet faster and more secure. Essentially, they act as a proxy for your website, handling all requests and filtering them before they even reach your site. Their Web Application Firewall is powerful – it serves as an outer perimeter defense, filtering out known hack attacks on your site.
Cloudflare offers many other services beyond their firewall, one of which is the focus of this article: Zaraz. With Zaraz, you can host third-party scripts like Google Analytics and Facebook Pixel as part of Cloudflare’s infrastructure rather than embedding them directly on your site. This results in faster and more secure loading of these scripts.
Additionally, these scripts would run in a first-party context, meaning they appear as part of my domain and issue cookies as if they were from my site rather than being seen as third-party cookies.
A list of the potential benefits of serverside data tracking:
- More control over data (privacy, 1st party, and GDPR)
- Faster loading speeds (by offloading 3rd party scripts)
- Better security (spammers can’t track your data processing)
Additional benefits for choosing Zaraz over GTM serverside:
- Low cost (no need to spin up an expensive Google Cloud or hire a 3rd party to do this)
- More user-friendly *initial* setup
How I Tested Zaraz vs. GTM Clientside
The webpage used for the comparison is the home page of this site (Great Results Online or GRO), and I want to make sure that:
- Page load speeds are as optimal as possible (so you don’t have to wait long)
- Accuracy of tracking visitors in Google Analytics (so I can see where you are reading from)
I have a pretty
empty clean homepage now, with only 2 published articles and no images. The domain is already proxied through Cloudflare DNS and hosted on a server in Singapore.
Here are the steps I took:
- Created both the Google Analytics 4 (GA4) as well as the Universal Analytics* (UA) properties
- For testing GTM clientside, I used Thomas Geiger’s excellent GTM4WP plugin, which I switched off within the plugin when I tried Zaraz.
- I used the following 3 tools to measure page loads:
- To measure page loads and scores, I tested several times before the last 3 mentioned in the results table.
- I cleared the cache on every step, and every test and even re-opened the chrome incognito for the lighthouse test**
** = I did this for 2 reasons:
- I did not make similar screenshots and wanted to redo the tests.
- I noticed a big difference in load times. I also saw these numbers normalize after several tries.
For instance, caching and switching from a setup with Zaraz to a setup with GTM clientside. Did the caching and test results bleed into the other? Hence my ambition to do the same tests again spread over several days.
The Test Results
GTMETRIX TESTS WITH ZARAZ
GTMETRIX TESTS WITH GTM CLIENTSIDE
PINGDOM TOOLS TESTS WITH ZARAZ
PINGDOM TOOLS TESTS WITH GTM CLIENT SIDE
LIGHTHOUSE TESTS WITH ZARAZ
LIGHTHOUSE TESTS WITH GTM CLIENTSIDE
LOCATION ACCURACY ZARAZ
LOCATION ACCURACY GTM CLIENTSIDE
My Conclusion & Decision
I will not be using Zaraz right now despite it being faster, safer, and offering a higher performance grade.
The reason is simple:
The locations seen in google analytics are in or just outside Jakarta, on a different island almost 1200 kilometers (or 750 miles) away from my I live and work in Bali, Indonesia.
Imagine basing any market research conclusion on that, let alone running any paid ads on that discrepancy.
I also noticed that even without Zaraz’s proxy server – because that is what I believe causes the discrepancy – and direct implementation of GTM clientside, Universal Analytics listed Surabaya, a city ‘only’ 430 kilometers (or 270 miles) away, as the location from where I was testing.
For reference: The Netherlands, where I was born and grew up, is 200 kilometers (or 125 miles) wide, and the longest distance within the country is 274 kilometers (or 170 miles).
I will follow Zaraz online and reach out to the team to see if anything can be done (or if I tested wrong).