Server-side tracking
Some links on this page are affiliate links: we may earn a commission at no extra cost to you. Our approach
Server-side tracking fixes a simple problem: browsers and blockers prevent part of the events from being measured. By sending data from the server, you get a truer picture and better-optimised campaigns. ## What you gain in reliability GA4 and advertising platforms make decisions on the data they receive. If they undercount sales, they optimise on a biased view. By bringing measurement closer to reality, attribution and results improve. ## Security and consent Events may contain personal data. You hash it before sending, respect consent and transmit only the necessary fields. This is as much a legal question as one of trust. ## A gradual rollout Server-side tracking is deployed site by site, event by event, with a comparison period. Successful projects start with the most important conversions and then expand, rather than migrating everything at once.When this guide is for you
- You see a large gap between conversions recorded by GA4 and those in your back office or CRM
- Your Meta or TikTok campaigns seem less effective than before, with no real drop in sales
- A growing share of your visitors use blockers that prevent browser-side tracking
- You handle customer data and want to limit what leaves the browser
- You have several sites or tools and want consistent tracking
Step by step
- Audit existing tracking — List events, compare figures with the back office, identify duplicates and missing events, and fix a faulty measurement plan first.
- Choose the server container — Set up a server container (cloud or shared hosting) and route events from the site to it, with a light environment suited to the traffic.
- Handle consent and hashing — Respect visitor consent, hash personal data before sending and transmit only the necessary fields, in line with law 09-08.
- Roll out event by event — Start with the most important conversions, compare with the browser-side data for a few weeks, then extend to the other events.
- Connect advertising platforms — Send conversions to Meta and TikTok through their conversion APIs and check that optimisation uses the new signal.
What it costs (in MAD)
| Service | Indicative price | Good to know |
|---|---|---|
| Audit of existing tracking | 3,000 – 10,000 MAD (approx. 270 – 900 €) | Events, gaps, duplicates |
| Server-side tracking setup | 10,000 – 40,000 MAD (approx. 900 – 3,700 €) | Container, routing, consent, integrations |
| Meta and TikTok integration (CAPI) | 4,000 – 15,000 MAD (approx. 370 – 1,400 €) | Conversion API for advertising campaigns |
| Server container hosting | 0 – 500 MAD / month (approx. 0 – 45 €) | Cloud or shared hosting depending on traffic |
| Monitoring and upkeep | 2,000 – 8,000 MAD / month (approx. 180 – 730 €) | Checking events and gaps |
Indicative ranges for the Moroccan market in 2026, excluding tax. Prices vary with scope and provider.
Mistakes to avoid
- Migrating all events at once without a comparison period, which makes duplicates impossible to detect
- Sending unhashed personal data to advertising platforms
- Forgetting consent: measurement must respect law 09-08 and the visitor's choices
- Setting up server-side tracking without fixing an already flawed measurement plan: you make bad figures more reliable
Frequently asked questions
What changes with cookie blockers?
Browser-side tracking is blocked more often than before. Server-side tracking captures the event on the server, with less loss. It does not replace consent but helps measure what is allowed.
Is server-side tracking compulsory?
No, but it has become the norm as soon as you invest seriously in advertising. Without it, platforms undercount conversions and optimise on incomplete data.
Do you need a dedicated server?
A light cloud environment is enough for most SMEs. Cost depends on event volume. Managed services exist and avoid maintenance.
Is it complicated to maintain?
A little: events, errors and platform updates need monitoring. That is why limited monthly monitoring is recommended rather than a one-off setup.
Does it improve campaign results?
Indirectly, by giving platforms more complete conversion data. A better optimisation signal can reduce cost per acquisition, especially on Meta.
Updated on
Related guides
Version française: /services/cro-analytics/tracking-server-side/ · AR · NL