Server-side GTM on Stape: Custom Domain and First-Party Cookies, No Magic
Server-side GTM has collected a lot of myths. Half the market thinks it is “a trendy thing for big companies,” the other half sets it up and doesn't understand why. Let's get to the point: what it actually gives you and whether it is worth the effort.
What you get beyond the words “server-side”
Four concrete things. Cookies in a first-party context that live longer and get stripped less often. A way around ITP, which kills your cookies in the browser after 7 days. Control over your data before it leaves for the ad platforms. And server-side CAPI delivery without a zoo of browser pixels.
If none of those pains bother you, then you may not need sGTM yet, and that's fine. But for fintech and for e-commerce with a long funnel, all four usually do.
Deploying on Stape
Stape is the simplest way to stand up a server container without wrestling with the cloud by hand. You create a tagging server, get a URL, and link it to your GTM web container. The basic configuration is half an hour of work.
But the basic configuration is not what you started all this for. The real thing begins with a custom domain.
A custom domain via CNAME — this is the whole point
By default the server container lives on a stape domain. That alone kills half the point, because to the browser it is a third-party domain, with every cookie restriction that entails.
So you add a CNAME record and hang the server container on a subdomain of your own site. Now it is first-party as far as the browser is concerned, and the cookies the server sets live in a first-party context. That is exactly the ITP workaround everyone talks about.
Without a custom domain sGTM still works, but you are leaving its main advantage on the table. This is a step you cannot skip.
Stretching cookies from 7 days to a year
The most tangible benefit. Safari's ITP trims _ga and ad cookies down to 7 days in the browser. Someone comes back on day eight and they are already a “new user” — attribution has been reset.
The server container sets those same cookies from its side, in a first-party context, and can give them a lifetime of up to a year. The attribution window widens radically — which matters most for a long funnel, where weeks pass between the first touch and the purchase.
What to send server-side first
Don't move everything at once. Prioritize by impact on optimization: GA4 and Meta CAPI first, then Google Ads, then TikTok. Start with what moves Smart Bidding the most and add the rest as you go.
The take: sGTM is not “better analytics,” it is first and foremost a longer attribution window and the recovery of the data ITP eats. People install it to tick a box and never configure the custom domain — and end up with a complex system minus the main benefit. If you set up sGTM and don't do the CNAME, you wasted your time
SKAdNetwork and SKAN 4.0: Why Your iOS Attribution Lies, and What to Do About It
SKAN 4.0 without the fluff: conversion values, three postback windows, the lock window. How to set up iOS attribution for a fintech app.
Read →GA4 in BigQuery: App Funnel SQL Queries That Actually Work
Ready-made SQL for the GA4 BigQuery export: signup funnel, retention cohorts, first-touch attribution. Plus UNNEST event_params and why the GA4 UI lies.
Read →Web-to-App: How Not to Lose the Source Between the Ad on Your Site and the Install
Setting up web-to-app attribution with deferred deep links. Why the source dies on the site → store → install hop and how OneLink preserves it.
Read →