We accept USD, EUR, PLN and 19 other currencies
Seamless communication in English and Polish
We always meet deadlines - no more dragging projects
dots
Custom Websites

Server-side data counting and page tagging: using Cloudflare Web Analytics and Cloudflare Zaraz

Well-designed analytics is no longer just “an add-on to a website”. It is a key part of business infrastructure. Without reliable data, you cannot sensibly calculate the return on marketing investment.

Fewer users consent to tracking, browsers block scripts, and analytics systems that rely solely on in-browser JavaScript tend to underreport heavily. That is why companies that take data seriously move counting to the server and use tools like Cloudflare Web Analytics and Cloudflare Zaraz.

Why complete analytics data is essential for business

At an operational level, web analytics answers simple questions: how many people visited the site, where they came from, and how many completed the action you care about. At a management level, it is no longer just “page views”. It becomes the foundation for decisions about budgets, priorities, and growth direction.

Analytics data is used, among other things, to:

  • evaluate which campaigns actually generate sales or leads, and which only drive traffic
  • calculate customer acquisition cost (CAC) and compare it with customer lifetime value (LTV)
  • understand which on-site content supports the sales process and which drives high exit rates
  • feed advertising algorithms (Google Ads, Meta Ads, LinkedIn Ads) with reliable conversions so the systems learn from the right data
  • build credible attribution models and understand the role a company website plays in the sales funnel

If the data is incomplete, everything built on it will be distorted as well. Underreported conversions inflate CAC, push teams to cut campaigns that “do not work”, and lead to overly cautious investment in channels that actually deliver results. In extreme cases, leadership may switch off a profitable channel simply because the analytics platform only sees half the events.

That is why the starting point is a simple question: can you trust what you see in your analytics dashboard?

The standard stack still includes tools like Google Analytics 4, Google Tag Manager, Hotjar, or Microsoft Clarity. They run in the browser: they load as a JavaScript script, store cookies, identify users, and record behaviour. This model has several major limitations:

  • the user must accept cookies, otherwise the tool does not collect data
  • browsers and anti-tracking extensions (AdBlock, uBlock, Brave, Firefox with stricter protection) increasingly block scripts from popular analytics domains
  • each additional script slows down loading, hurts Core Web Vitals, and worsens the user experience

In practice, Google Analytics only “sees” users who clicked “I agree” on the cookie banner, do not use a browser that blocks tracking, and do not have an ad blocker enabled. Typically, this is around 55 to 65 percent of users, though it can be lower or higher depending on the audience and the project.

The consequence is simple: in GA4 you always see fewer conversions than in reality. The gap can be significant and changes over time, so you cannot convert it with a fixed multiplier. You can try simpler approaches, such as:

  • comparing organic traffic in Google Search Console (which does not rely on cookies) with organic traffic reported in GA4
  • implementing your own measurement of what percentage of users accept all cookies, accept only some, or reject and ignore the banner

These signals help you interpret analytics better, but they do not solve script blocking itself. On top of that, some tools behave poorly in more restrictive browsers.

If your website is meant to be the foundation for marketing, it is worth considering an approach that does not rely only on browser-side scripts.

Server-side counting and server-side tagging

Server-side counting and server-side tagging reverse the logic of traditional tracking. Instead of pushing multiple scripts into the user’s browser, you use an intermediary server or cloud infrastructure (for example Cloudflare) that:

  • receives basic request data (URL, HTTP headers, browser and country signals)
  • executes analytics and marketing logic in the background
  • decides which systems should receive which data (for example GA4, advertising pixels, marketing automation tools)

The user’s browser does not need to load a dozen tags. It sends one request, while the logic runs inside infrastructure controlled by the site owner. This has several business consequences:

  • the site loads faster because the front end is lighter
  • some browser blocks and ad blockers become less relevant because communication happens server to server
  • compliance becomes easier because the business controls what data is sent to third-party vendors and in what form

Server-side tracking does not remove the need for a sensible privacy policy or a cookie banner, but it reduces browser overhead and helps recover some events that are lost in the classic model.

Cloudflare Web Analytics and RUM: analytics and performance in one place

Cloudflare is a natural choice for companies focused on performance and security. At WebProfessor, we treat it as the default network layer: DNS, CDN, edge computing, and protections. Analytics can live in the same infrastructure.

How Cloudflare Web Analytics works

Cloudflare Web Analytics is designed to be lightweight and privacy-friendly. It does not use cookies, does not rely on localStorage, and does not try to fingerprint the browser. It counts requests at the server level, or via a small beacon script that is much lighter than typical analytics libraries.

There are two main modes:

  • JavaScript beacon: a very small snippet added to the site, sending Cloudflare data about page views, load time, and errors
  • Server log-based counting: if traffic goes through Cloudflare proxy, Cloudflare can build statistics without any code on the site, based on HTTP requests alone

In the dashboard, you get a clear view of key metrics: page views, top pages, countries, HTTP status codes, and traffic sources. The data refreshes close to real time and does not require consent banner handling because it does not create a user profile.

Cloudflare Web Analytics works well as a baseline layer. It gives a fuller view than GA4 because it does not depend on cookies, and it has essentially no impact on Core Web Vitals. For many smaller business sites, it can be sufficient.

Cloudflare RUM: performance measurement under real conditions

It is worth adding Cloudflare RUM (Real User Measurements). Instead of relying only on lab tests, it measures performance for real users:

  • load times
  • Core Web Vitals (for example LCP, Largest Contentful Paint, and INP, Interaction to Next Paint)
  • the impact of location and device on user experience

From a business perspective, this pairs well with traffic data. You can check whether weaker campaign performance in a given country is caused by the offer, or simply because the site loads noticeably slower there.

In our stack (Astro.js, Next.js, Cloudflare), these metrics help keep performance under control without heavy “performance monitoring” tools added to the browser.

Cloudflare Zaraz: server-side tag manager in practice

Cloudflare Zaraz extends this approach. Instead of embedding Google Analytics, advertising pixels, chat widgets, and other scripts into the site code, you can move them into Cloudflare and manage them centrally.

In practice:

  • the user visits a site running behind Cloudflare proxy
  • Cloudflare adds a lightweight Zaraz snippet to the response
  • part of the tag logic runs in Cloudflare infrastructure, not in the browser

Zaraz allows you to:

  • connect prebuilt integrations with popular analytics and marketing tools
  • add custom tags based on HTTP requests or TypeScript code
  • control what data is sent to specific vendors, for example IP anonymisation
  • connect tag behaviour with a consent mechanism

Up to a certain traffic level, Zaraz is free, and higher tiers follow a simple subscription model. This is important compared with expensive server-side implementations in other ecosystems.

With Zaraz, you can move to Cloudflare, among other things:

  • Google Analytics 4 and related events
  • advertising pixels (Meta, LinkedIn, Google Ads)
  • marketing automation tools, chat widgets, A/B testing tools

The user’s browser sends standardised data to Cloudflare, and Zaraz decides what happens next. This improves privacy control, boosts performance, and reduces the impact of third-party scripts on Core Web Vitals.

When Web Analytics is enough, and when Zaraz is worth implementing

Not every business needs full server-side tagging immediately. The selection logic is relatively straightforward.

Cloudflare Web Analytics works well when:

  • the site is mainly informational, brand-focused, or thought-leadership driven
  • your key metrics are visits, traffic sources, top pages, and possibly simple events
  • you want a fast, lightweight tool with a better picture than cookie-based analytics

Cloudflare Zaraz is a natural choice when:

  • the site generates meaningful revenue or leads and relies heavily on marketing tools
  • marketing needs many integrations (GA4, pixels, automation platforms, A/B tests) but you do not want to load them on the front end
  • you care about stronger compliance, data flow control, and better resistance to ad blockers

You can also combine both: Web Analytics as the “gross” traffic source and Zaraz as the tag and integrations layer. The key is to design it properly and avoid double-counting the same events.

How this fits into the WebProfessor website architecture

At WebProfessor, we build sites in a headless architecture based on Astro.js or Next.js, plus React and Tailwind CSS, with Cloudflare as the default network layer. This approach delivers:

  • very high performance (Lighthouse 90+ as a baseline, low TTFB)
  • easy scaling as traffic or project scope grows
  • flexible content management through a headless CMS (Sanity, Strapi, Payload)

Server-side counting and Cloudflare Web Analytics, RUM, and Zaraz naturally complement this architecture. The front end stays clean and lightweight, while heavier tracking logic runs at the network edge. From a business perspective, this means:

  • more trustworthy traffic and conversion data, not limited to cookie-consenting users
  • better foundations for marketing budget decisions and on-site changes
  • higher ROI from SEO and paid campaigns because algorithms learn on more complete data
  • lower privacy compliance risk because data is controlled and anonymised at the infrastructure level

What next?

If you want your company website to function as a real sales and marketing tool, you need two things: a high-performance architecture and trustworthy data. Cloudflare Web Analytics and Zaraz help you build an analytics layer that is lightweight, regulation-friendly, and resilient to some cookie-related limitations.

In our projects, we implement these tools either alongside a new website build or during a replatforming of an existing one. We combine Cloudflare configuration, headless CMS, and server-side counting into one coherent system designed to support business results, not just measure page views.

If you want to see what this could look like for your case, book a free consultation or ask for a quick estimate. Based on your current setup, we will recommend a practical path to server-side analytics and configure Cloudflare so your website is both fast and properly measured.

FAQ: frequently asked questions

Can Cloudflare Web Analytics fully replace Google Analytics 4?

Not always. Cloudflare Web Analytics is excellent as a source of complete, “raw” traffic data without relying on cookies or consent. However, it does not offer advanced behavioural reports or deep funnel analysis. In many projects, the best setup is a combination: Cloudflare Web Analytics as the baseline layer and GA4 for deeper analysis.

Is server-side counting compliant with GDPR and cookie regulations?

Yes, as long as it is configured correctly. Server-side tracking does not remove the obligation to inform users about data processing, but it gives significantly more control over what is sent to external systems and in what form. Cloudflare Web Analytics does not use cookies, and Cloudflare Zaraz lets you connect tags to consent mechanisms and data anonymisation.

Does Cloudflare Zaraz require rebuilding the whole website?

No. Zaraz operates at the Cloudflare infrastructure level and does not require changes to application code beyond minimal configuration. In many cases, you can migrate existing tags (GA4, advertising pixels) without refactoring the front end, which makes implementation fast and relatively cost-effective.

Does server-side tagging really improve website performance?

Yes. Moving tag logic from the browser to edge infrastructure reduces the number of external scripts loaded on the user side. The result is faster load times, stronger Core Web Vitals, and a lower risk of script conflicts, especially on marketing sites and landing pages.

Which projects benefit the most from this approach?

The biggest gains come for businesses where the website is a real revenue or lead-generation channel: B2B, SaaS, e-commerce, content sites driven by SEO, and PPC-heavy projects. For simple brochure websites, Cloudflare Web Analytics is often enough, while Zaraz and server-side tagging start paying off as traffic and marketing budgets grow.

More tips and resources

See more