All Guides
Analytics + Measurement

Implement Server-Side Tracking

Track users accurately, even when ad blockers are running.

What this covers: Server-side tracking architecture, three setup options (Google Tag Manager Server-Side, Stape.io managed hosting, custom implementation), what to track server-side vs. client-side, first-party data enrichment, and privacy considerations.

Who it’s for: Marketing teams with developer support who are losing conversion data to ad blockers and browser cookie restrictions.

Key outcome: You’ll have a server-side tracking container deployed that accurately captures conversion events even when users have ad blockers enabled.

Time to read: 4 minutes

Part of: Analytics & Measurement series

🔧 Skill Level: Developer required (cloud infrastructure)

Server-side tracking requires Google Cloud setup, tagging infrastructure, and ongoing maintenance. This is an advanced implementation typically handled by agencies or in-house developers.

Track users accurately even with ad blockers. Here’s how.

Why Server-Side

You’re losing data. Not because your tracking is misconfigured, but because browsers and ad blockers are actively preventing collection.

Client-side tracking fails when:

  • User has ad blocker (~Many users)
  • Browser blocks third-party cookies
  • ITP/ETP limits cookie lifetime

Server-side tracking sends data from your server, not the user’s browser.

How It Works


Traditional:
Browser → gtag.js → Google Analytics

Server-side:
Browser → Your Server → Google Analytics

Ad blockers block requests to google-analytics.com. They don’t block requests to your own domain.

Setup Options

Pick the option that matches your team’s technical ability. Option 1 gives the most control. Option 2 is the fastest path to production. Option 3 is for teams that want to skip GTM entirely.

Option 1: Google Tag Manager Server-Side

Google’s official solution. Requires:

  • Google Cloud Platform account
  • Cloud Run container (starts at ~$30/month)

Setup: GTM Server-Side docs

Option 2: Stape.io

Managed GTM server-side hosting:

  • Free tier: 500K requests/month
  • Handles setup complexity
  • Custom domain included

Setup: Stape GTM guide

Option 3: Custom Implementation

Send events from your backend:

Note: Replace G-XXXXXXXXXX with your GA4 Measurement ID and YOUR_API_SECRET with your Measurement Protocol API secret (found in GA4 Admin → Data Streams → Measurement Protocol API secrets).


// Node.js example
async function trackEvent(userId, eventName, params) {
 await fetch('https://www.google-analytics.com/mp/collect?measurement_id=G-XXXXXXXXXX&api_secret=YOUR_API_SECRET', {
 method: 'POST',
 body: JSON.stringify({
 client_id: userId,
 events: [{ name: eventName, params }]
 }),
 headers: {
 'Content-Type': 'application/json'
 }
 });
}

What to Track Server-Side

Not everything needs server-side tracking. Move your high-value events — the ones ad blockers are costing you — and leave the rest client-side.

  • Conversions – Purchases, signups (most important)
  • Form submissions – After server validates
  • API events – Webhook triggers

Keep client-side for:

  • Page views
  • Scroll depth
  • Time on page

First-Party Data

Server-side tracking lets you attach data you already have — CRM records, purchase history, account status — to analytics events before they reach GA4. This data never touches the browser, so it stays private and can’t be blocked.

  • Customer lifetime value
  • Subscription status
  • Purchase history

This data never goes to the browser.

Privacy Considerations

Server-side doesn’t bypass consent requirements:

  • Still need consent for EU visitors
  • Still need to honor opt-outs

Just more reliable tracking for consenting users.

Verify It’s Working

The simplest test: simulate the conditions that break client-side tracking and check if your data still arrives.

  1. Enable ad blocker
  2. Trigger a conversion
  3. Check GA4 Realtime report

Event should still appear.

Validate Server-Side Data Matches Client-Side

After setup, compare server-side event counts against client-side for the same period. Some discrepancy is normal — you should see more events server-side. That’s the whole point. If server-side shows fewer, something is misconfigured.

Start with Stape.io free tier. Set up purchase and conversion tracking first — that’s where ad blocker losses cost you the most.

Sources

Server-Side Tracking Questions Answered

Does server-side tracking bypass ad blockers?

Yes. Server-side tracking sends data from your server to analytics platforms, not from the browser. Ad blockers can’t intercept server-to-server requests, recovering 15-30% of typically blocked tracking data.

How much does server-side tracking cost to run?

Google Cloud Run or AWS costs $20-100/month for most sites under 1M monthly pageviews. Managed services like Stape.io start at $20/month. Self-hosted GTM Server-Side containers need at minimum 3 instances for production reliability.

Can I use server-side tracking without Google Tag Manager?

Yes. You can send events directly from your backend via the GA4 Measurement Protocol, Facebook Conversions API, or any platform’s server-side API. GTM Server-Side is just the most common orchestration layer—it’s not required.

Does server-side tracking comply with GDPR?

Server-side tracking still requires user consent under GDPR. Moving tracking server-side doesn’t change consent obligations—it changes where data processing happens. You must still honor opt-outs and implement a consent management platform.

✓ Confirming Server-Side Events Are Firing

  • Server-side container is deployed and receiving hits
  • GA4 receives events from the server container
  • Data appears even when testing with ad blockers enabled