Server-side tagging with Stape for an ecommerce store
Browsers and ad blockers were stopping part of the store's tracking. We moved its key ecommerce events onto a server it owns, and the activity GA4 recorded climbed in the weeks after go-live.
Ecommerce brand · Stape · Google Tag Manager · GA4 · Consent Mode
The situation
The store tracked everything in the visitor’s browser. That left gaps in its data and numbers in GA4 that did not line up with what was really happening, which made marketing decisions harder and privacy compliance messier.
Most of the loss came from three places: browser restrictions, Safari’s Intelligent Tracking Prevention (ITP) and ad blockers. The client needed a way of collecting data that was more reliable and easier to keep compliant.
What we did
We moved the store’s tracking server-side, using Stape to host the server.
- A dedicated server for tracking. We set up a Stape server to receive tracking requests, so data goes to a server the client owns instead of straight from the browser to each platform.
- A server-side GTM container. Events are received, processed and sent on from there.
- The key ecommerce events, routed through the server. Page views, product views, add to cart, begin checkout and purchases.
- First-party cookies, set by the server. This makes them more reliable than cookies set by scripts in the browser.
- Fewer scripts in the browser. With the work moved to the server, less code runs on each page, which helps page speed.
- Consent respected. Google Consent Mode keeps data collection in line with each visitor’s cookie choices, and the data is handled on the client’s own server.
The result
The server-side setup went live in the first week of April 2024. Over the following four weeks, the item views GA4 recorded each week rose from about 13,000 to about 24,000, as more of the store’s real activity reached GA4 instead of being lost in the browser.
Tools we used
- Stape to host the server-side container
- Google Tag Manager for both the browser and server containers
- Google Analytics 4, set up to receive events from the server
- Google Consent Mode to keep collection in line with consent
Want this for one of your clients?
Run the free check on one account. If it’s clean, great. If it isn’t, we’ll show you exactly what to fix.