---
title: "GTM Event ID Deduplication Variable (Web & sGTM)"
description: "Open-source Apache-2.0 custom variable template for Web and Server-Side GTM. Generates collision-resistant event_id keys to deduplicate browser pixels against Meta CAPI and GA4 Measurement Protocol."
canonical: "https://gordongeraghty.com/resources/gtm-event-id-deduplication-variable"
type: "resource"
date: "2026-11-28T00:00:00Z"
updated: "2026-11-28T00:00:00Z"
---



# GTM Event ID Deduplication Variable (Web & sGTM)

**Gordon Geraghty:** GTM Event ID Deduplication Variable (Web & sGTM). Open-source Apache-2.0 custom variable template for Web and Server-Side GTM. Generates collision-resistant event_id keys to deduplicate browser pixels against Meta CAPI and GA4 Measurement Protocol.

**Category: GTM & Analytics · Type: template-file · Level: intermediate · Licence: Apache-2.0**

When running browser pixels alongside server-side conversions (Meta CAPI, GA4 Measurement Protocol), both pipelines must emit an identical event_id per user action so ad platforms deduplicate rather than double-count.

This sandboxed GTM custom variable template generates deterministic, collision-resistant event_id keys that persist cleanly between Web GTM tags and Server-Side GTM clients.

**Tags:** Server-Side GTM, Meta CAPI

[GitHub Repository Mirror](https://github.com/gordongeraghty/gtm-event-id-deduplication-variable)

[Canonical URL](https://gordongeraghty.com/resources/gtm-event-id-deduplication-variable)
