---
title: "Server-Side GTM Container Recipe Pack (Meta CAPI & GA4 Dual Pipeline)"
description: "Production-ready web and server GTM container exports with deduplicated Meta CAPI, Google Enhanced Conversions, and Consent Mode v2 pre-configured."
canonical: "https://gordongeraghty.com/resources/sgtm-container-recipe-pack"
type: "resource"
date: "2026-08-01T08:00:00+10:00"
updated: "2026-09-24T15:40:35+10:00"
---



# Server-Side GTM Container Recipe Pack (Meta CAPI & GA4 Dual Pipeline)

**Gordon Geraghty:** Server-Side GTM Container Recipe Pack (Meta CAPI & GA4 Dual Pipeline). Production-ready web and server GTM container exports with deduplicated Meta CAPI, Google Enhanced Conversions, and Consent Mode v2 pre-configured.

**Category: GTM & Analytics · Type: container-recipe · Level: advanced · Licence: MIT**

## Architecture Overview & Deduplication Pipeline

This package provides importable web and server GTM container exports to prevent browser signal loss and match browser pixels with Meta Conversions API (CAPI) events.

### Key Technical Inclusions

1. Dual-pipeline event routing with deterministic event_id generation. 2. First-party user_data SHA-256 normalisation (E.164 phone and lowercased email). 3. Consent Mode v2 monitoring reading the gcd and gcs parameters. 4. Pre-built CMP bridges for OneTrust, Cookiebot and Termly.

### DataLayer Normalised Purchase Event Spec

```javascript
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
  event: 'purchase',
  event_id: 'order_' + orderId + '_' + Date.now(), // Shared event_id for browser and CAPI dedup
  ecommerce: {
    transaction_id: orderId,
    value: 120.00,
    currency: 'AUD',
    tax: 10.91,
    shipping: 10.00,
    items: [
      {
        item_id: 'SKU_12345',
        item_name: 'Performance Running Shoe',
        item_category: 'Footwear',
        price: 120.00,
        quantity: 1
      }
    ]
  },
  user_data: {
    email: 'customer@example.com.au', // Automatically lowercased and trimmed by sGTM variable
    phone: '+61412345678',             // Formatted in international E.164 standard
    address: {
      first_name: 'Alex',
      last_name: 'Smith',
      postal_code: '3121',
      country: 'AU'
    }
  }
});
```

### Changelog
- **1.0.0:** Initial production release with Meta CAPI deduplication, E.164 phone normalisation and Consent Mode v2 CMP bridges.

**Tags:** Server-Side GTM, Meta CAPI, Consent Mode v2

[Canonical URL](https://gordongeraghty.com/resources/sgtm-container-recipe-pack)
