How to Setup Google Analytics with Cloudflare Zaraz [2024]
Cloudflare is one of the largest networks operating on the internet. It is a global network specially designed to easily connect everything on the internet more securely, quickly and reliable. The main purpose behind using Cloudflare is to increase the security and performance of your websites and services. Here, we have prepared a detailed guide to setup Google Analytics with Cloudflare Zaraz.
Benefits of Using Cloudflare
The main benefits of using Cloudflare are as follows:
- Facilitates to easily protect, secure, and accelerate your apps, websites in just minutes by pointing your DNS to Cloudflare. Having secure and fast web applications leads to having a better user experience.
- Allows to securing internal operations on a single global network. It is possible to protect the office networks and data centers by easily connecting them to Cloudflare’s network.
- Helps to create new applications or improve existing ones on a serverless platform without affecting the infrastructure.
Cloudflare Zaraz
Cloudflare Zaraz allows you to completely control over third-party tools and services for your website. It also helps in improving the speed and security of your website. This network allows loading tools like analytics tools, marketing automation tools, chatbots, and much more.
This biggest global network, Cloudflare Zaraz, is available in Beta with a website integrated with Cloudflare. It is easily accessible to all the customers on each and every plan. Hence, the main benefit of using Cloudflare Zaraz is to integrating as many tools you need with almost zero performance ensuring high speed and advanced security.
Cloudflare acquired Zaraz with an aim to make the web more secure, reliable, and faster enough. This content delivery network has pledged to speed up the website performance using a single line of code.
Also Read: Setup & Use Microsoft Clarity on Your Website.
Almost all the websites rely on third-party integrations like Ads tracking pixels, Google Analytics, Facebook, HubSpot for gathering crucial information about the visitors. These third-party tools affect the performance of your website and would show a huge impact, the longer script the company adds to its codebase. Here, Zaraz comes into the picture!
It is possible to run as many tools as you need using Zaraz with making any compromise in security or affecting the site speed. Thus, Zaraz helps to prevent site security from entering malicious code and prevents from running third-party tools on the browser.
Setup Google Analytics With Cloudflare Zaraz
To setup Google Analytics with Cloudflare Zaraz, you simply need to follow these steps:
Step 1: Log into Cloudflare.
Step 2: In the left-hand-side panel, find and click on Zaraz>Tools and click on Add New Tool under the Third-Party Tools.
Step 3: Now, under the All Tools, select Google Analytics to configure it with Cloudflare Zaraz.
Step 4: On the Set Up Google Analytics popup, click on Continue to configure Google Analytics.
Step 5: Now, enter the Tracking ID of your Google Analytics account and click on Save.
Step 6: By default, the Pageview tracking action will be there. In order to create a new action, you need to create a new trigger first.
Step 7: To create a new trigger, click on “Triggers” under Zaraz from the sidebar.
Step 8: Now, under the Triggers section, click on the Create trigger button.
Step 9: Enter the trigger name as per your convenience and set the match rules. You can choose the match rules as per your requirements. For an instance, here we have selected Page rule.
Step 10: Choose a variable name and property as per your needs from the list provided there or from here. For an eg, here we have taken {{ system.page.url.pathname }} as a variable to track the URL path.
Step 11: After entering the match operation and match string, click on Save.
Step 12: Now, click on the Tools option from the sidebar & then “Edit” to create a new action.
Step 13: Under the Tool actions section, click on the Create action button.
Step 14: Now, enter your action name, select the firing trigger that we have created previously, select the event type, enter event action, category, label, and click on Save.
Step 15: Now, you can find Google Analytics fully functional and get real-time data in google analytics set-up using Cloudflare Zaraz.
Step 16: You can also track the events that have fired the trigger under the events section.
Step 17: That’s it! Now, you have successfully set up Google Analytics with Cloudflare Zaraz.
Setup Google Analytics 4 With Cloudflare Zaraz
You can use the following steps to setup Google Analytics 4 with Cloudflare Zaraz:
Step 1: Log into Cloudflare.
Step 2: In the left-side panel, find and click on Zaraz>Tools and click on Add New Tool under the Third-Party Tools..
Step 3: Now, under the All Tools, select Google Analytics 4 to configure it with Cloudflare Zaraz.
Step 4: After selecting Google Analytics 4, enter the Measurement ID and then click on the Save button.
Now, after that follow the same steps that we mentioned above to set up Google Analytics 4 with Cloudflare Zaraz.
That’s it.
If you have any questions regarding this post, feel free to ask in the comments section below.
I’d be happy to answer.
Do consider sharing this post with your friends via social media.
Thank You.
Shivbhadrasinh Gohil
Shivbhadrasinh is the Co-founder & Chief Marketing Officer at Meetanshi. He leads the marketing team and is the person behind the marketing & branding success of the company. Being a seasoned digital marketer, he has been consulting online businesses for growth since 2010 and has helped 100+ clients with digital marketing success.
He loves sharing tips and insights about the latest digital marketing trends aimed at helping online business owners.
6 Comments
Hi and thanks for this.
I have done the above, I am using WordPress. Does this mean I can delete the code added into the header?
Thanks
Hey!
There is no need to put the code into your site’s header if you’re setting up Google Analytics on Cloudflare.
Hi Sanjay, I have a question. I set up Zaraz as described. One thing doesn’t work in Analytics, and that’s page speed. I’m not much of a technician, so maybe that has something to do with it. Can you explain how you approach this? Thank you in advance.
Jack
Hello Jack,
It seems like you’re mentioning the speed that can be set from the Behavior>Site Speed option in Google analytics. Please be informed that it will take some time in the whole speed increasing process.
Moreover, it also seems like you recently connected your website with Google Analytics.
Thank You
Respected sir
First amazing tutorial. but please update the tutorial Step 9 not showing in my cloudflare
Hello Iliyas,
Regarding your query, it seems like you’re doing something wrong as we’re able to see step 9 from our end.
Thank You