Implementation of Server-Side Tracking for Ad Attribution by Mafumu MumbaImplementation of Server-Side Tracking for Ad Attribution by Mafumu Mumba

Implementation of Server-Side Tracking for Ad Attribution

Mafumu Mumba

Mafumu Mumba

Savanna Roast Co.: every sale, seen by your ads

When your ads can't see a sale, you keep paying for clicks that look like they never worked. This system makes sure every purchase reaches your analytics, your ad platforms and a record you own. We run it live on a demo coffee store in the Limba Labs Engineering Lab, so it is proven long before it touches your business.
3
Destinations per event
4
Working parts
15 min
Abandoned-cart check
Where it runs
Live in our own Engineering Lab, on a real server
Tested with
Google Analytics, TikTok and HubSpot
See it work
Live walkthrough & proof below

THE CHALLENGE

Your ads are probably missing sales.

Most online stores rely on small scripts in the visitor's browser to report each sale. Ad blockers, privacy settings and closed tabs stop some of those reports from ever arriving. Your ad platform then believes fewer ads worked than really did, and spends your budget on that basis.
What it costs you: wasted ad spend, and reports you can't fully trust.
Before: browser only
Visitor
Website
Browser pixel
Blocked or lost
Missed conversionsAds learn from partial dataNo copy you own
After: through your own server
Visitor
Website
Your tracking server
GA4 (analytics)
TikTok Events API (ads)
Your own event store
Fewer lost events Each sale counted once A record you own

WATCH IT RUN

The whole setup, start to finish.

A purchase on the demo store, followed through the tracking server to each destination.
Live walkthrough from the Limba Labs Engineering Lab · Open on YouTube ↗

HOW IT WORKS

One event, three destinations.

Click a step, or press Play to follow a purchase through the system.
Browser Website Server-SideGTM GA4 TikTokEvents API EventStore Purchase / Add to Cart Event + event_id Forward to GA4 Forward to TikTok Events API (same event_id) Store raw event Browser Website Server-SideGTM GA4 TikTokEvents API EventStore
Click a step below, or press Play to walk through the flow.

THE FOUR PARTS

Each part has its own walkthrough.

Clients rarely need all four at once. Each part below works on its own, with a video, screenshots and the output that proves it ran.
See how it works →
PART 01

The tracking server on AWS

Hosting it properly: Docker, Nginx, HTTPS, and a server that restarts itself after a crash.
See how it works →
PART 02

TikTok Events API

Sending sales to TikTok from the server, with customer details scrambled first and duplicates merged.
See how it works →
PART 03

HubSpot to TikTok

When a deal closes in the CRM, its value goes back to TikTok so the ads learn which leads pay.
See how it works →
PART 04

Abandoned cart detection

A scheduled job finds carts that never became orders and flags them for follow-up.

PROOF

What we checked, and where you can see it.

Events reach the tracking server

Shown in the walkthrough video and the event store below.

TikTok receives server events

Events Manager screenshot on the TikTok page .

Closed deal accepted by TikTok

TikTok replied "code":0 (OK). Log on the HubSpot page .

Server survives a crash

Killed on purpose and back up on its own. See the AWS page .
Event storeEvery event is also written to a database the store owns, so the numbers can be checked against GA4 and TikTok.
ArchitectureBrowser, tracking server, and the three places each event is sent.
Everything here runs on demo data in our lab, so we don't quote sales figures. On your account, we measure the before and after so you can see the difference for yourself.

FOR YOUR BUSINESS

What you would get.

An audit of your current tracking: what is firing, what is missing, and what is counted twice.
A tracking server on your own domain, set up for the ad platforms you use, hosted and monitored.
A copy of every event in your own database, so you aren't relying only on ad platform dashboards.
Optional add-ons: sending closed CRM deals back to the ads, and abandoned-cart detection.
Handover notes so your team knows what was set up and how to check it.

TECHNOLOGIES

Google Tag Manager (server-side)GA4TikTok Pixel + Events APISHA-256 hashingHubSpot APILaravel 12AWS EC2DockerNginxLet's Encrypt
Like this project

Posted Nov 6, 2026

Developed a tracking system for accurate ad performance measurement.