Skip to main content
Zenovay
Scale Plan15 minutesAdvanced

Google Tag Manager: setting up server-side GTM with Zenovay

Run the Zenovay tracker through a server-side GTM container to keep the client-side script tiny and dodge ad-blockers. Here's the full setup.

gtmserver-sidetag-managerfirst-party
Last updated:

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

  1. In Google Tag Manager, create a new Server container.
  2. Choose Manually provision tagging server and pick your hosting (Cloud Run is the typical path).
  3. Note the container's URL (e.g. https://gtm-abc123.run.app).
  4. Add a custom domain mapping so the container is reachable at t.example.com.

Step 2 — Add the Zenovay client template

  1. In the server container, Templates → Client templates → Search Gallery.
  2. Search for Zenovay Server-side. (If you don't see it, you can import it from github.com/zenovay/sgtm-template — the template is open-source.)
  3. Add to workspace.

Step 3 — Configure the client

  1. Clients → New → Zenovay Server-side.
  2. Settings:
    • Path — e.g. /zv (the URL prefix the browser will hit).
    • Tracking Code — paste your Zenovay tracking code.
    • Forwarding endpointhttps://api.zenovay.com/api/event (default).
  3. 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

  1. Open a real visit on the site.
  2. DevTools → Network → filter by t.example.com — you should see the script load and one or more /zv/event requests.
  3. In sGTM Preview mode, you should see the request being routed through the Zenovay client and forwarded.
  4. 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.

Was this article helpful?