Server-side Google Tag Manager (sGTM) lets you proxy tracking requests through your own server. For Zenovay, that means a smaller client-side script, fewer ad-blocker hits, and full control over what data leaves the browser. This article walks through the canonical sGTM + Zenovay setup.
When is sGTM worth the effort?
sGTM adds operational overhead — you need a Cloud Run / EC2 / Cloud Function instance, a custom subdomain, and ongoing maintenance. It's worth it if:
- You're seeing >5% adblock-driven data loss and want first-party-domain delivery.
- You need to enrich events with server-only data (e.g. internal user-tier, IP-derived ASN) before they reach Zenovay.
- Your security/legal team requires that all third-party HTTP requests be inspectable.
If none of those apply, the regular client-side tracker is simpler and faster.
High-level architecture
Browser → https://t.example.com/zv → https://api.zenovay.com/api/event
(your sGTM container)
The browser only sees t.example.com (your domain). The sGTM container forwards to Zenovay, optionally enriching the payload.
Step 1 — Set up the sGTM container
- In Google Tag Manager, create a new Server container.
- Choose Manually provision tagging server and pick your hosting (Cloud Run is the typical path).
- Note the container's URL (e.g.
https://gtm-abc123.run.app). - Add a custom domain mapping so the container is reachable at
t.example.com.
Step 2 — Add the Zenovay client template
- In the server container, Templates → Client templates → Search Gallery.
- Search for
Zenovay Server-side. (If you don't see it, you can import it fromgithub.com/zenovay/sgtm-template— the template is open-source.) - Add to workspace.
Step 3 — Configure the client
- Clients → New → Zenovay Server-side.
- Settings:
- Path — e.g.
/zv(the URL prefix the browser will hit). - Tracking Code — paste your Zenovay tracking code.
- Forwarding endpoint —
https://api.zenovay.com/api/event(default).
- Path — e.g.
- Save and Publish.
Step 4 — Update the website tracker
Replace your existing Zenovay <script> tag with the sGTM-aware version:
<script
src="https://t.example.com/zv/script.js"
data-tracking-code="YOUR_TRACKING_CODE"
defer
></script>
The script source now points at your sGTM container, but data-tracking-code stays the same.
Step 5 — Verify end-to-end
- Open a real visit on the site.
- DevTools → Network → filter by
t.example.com— you should see the script load and one or more/zv/eventrequests. - In sGTM Preview mode, you should see the request being routed through the Zenovay client and forwarded.
- In Zenovay Live → Events, the event should appear within ~30 seconds.
What's enriched
The sGTM client automatically forwards:
- The visitor's IP (so country/city detection still works on Zenovay's side — but you can strip this in sGTM if you want full IP anonymisation).
- The User-Agent string.
- All headers needed for cookieless / GPC honouring.
Cookieless mode + sGTM
If you want sGTM and cookieless mode, set data-cookieless="true" on the script tag as usual. The sGTM client respects the flag and won't write any cookies on its way through.
Plan availability
Server-side GTM integration is supported on the Scale plan and higher. Pro plan users should use the regular client-side tracker. Free plan does not include server-side eligibility.