Code Library
Production-correct snippets. De-identified. Module-mapped to the Advanced GTM & Server-Side Tracking course.
Filter by module:AllModule 3 · GA4 Base ConfigModule 5 · Consent Mode v2Module 6 · Server-Side GTMModule 7 · Enhanced ConversionsModule 8 · Meta CAPIModule 9 · Cross-DomainModule 10 · Ecommerce
Filter by topic:Allattributioncaddycmpconsent-mode-v2conversions-apicross-domaincustomer-eventsdatalayerdeduplicationdockerecommerceenhanced-conversionsevent_idga4gdprgoogle-adsgtmmeasurement-protocolmeta-capimeta-pixelnextjsprivacypurchaseself-hostedserver-sidesgtmsha256shopifyvps
Module 8 · Meta CAPI
Meta CAPI and browser Pixel deduplication via shared event_id
Prevent double-counting Meta conversions when you run both the browser Pixel and CAPI. The event_id must be identical on both sides.
meta-capimeta-pixeldeduplicationevent_id
Module 8 · Meta CAPI
Meta CAPI: server-side conversion from a Next.js route handler
Send a Meta Conversions API event from a Next.js route handler. Includes SHA-256 hashing of user data and the event_id for browser-Pixel deduplication.
meta-capinextjsserver-sideconversions-api