GuideInfrastructure~25 min

Google Tag Manager

Complete guide: Web Container (client-side) and Server Container (server-side). Importing the pre-configured containers, checking the values, publishing, tag architecture, consent, GA4 transport, CAPI destinations, Enhanced Conversions.

Connectors0/3
GTM Web Container ID
tagmanager.google.com. e.g. GTM-XXXXXXX
GTM Server Container ID
tagmanager.google.com. e.g. GTM-XXXXXXX
Server Container URL
Addingwell > Server > Custom Domain. e.g. https://tags.domain.com
Credentials required0/7
GA4 Measurement IDServer Container URLCookiebot CBIDMeta Pixel IDMeta Access TokenGoogle Ads Conv. IDGoogle Ads Conv. Label

Fill them in from the matching guides (Connectors section at the top of each guide).

1Role / Purpose

GTM is the central hub of the tracking stack. It receives DataLayer events (injected by Addingwell), handles consent (Cookiebot CMP), gates the marketing tags, and routes hits to the server container (sGTM) through a first-party custom domain.

Shopify Store
      ↓
Addingwell (DataLayer + Custom Pixel + GTM injection)
      ↓
┌─────────────────────────────────────────────────┐
│  GTM Web Container (client-side)                │
│  Consent, marketing tags, GA4 transport         │
└─────────────────────────────────────────────────┘
      ↓  GA4 hits via server_container_url
┌─────────────────────────────────────────────────┐
│  GTM Server Container (server-side)             │
│  GA4 Server, Meta CAPI, Google Ads EC, etc.     │
└─────────────────────────────────────────────────┘
ContainerRoleHosted on
Web (client-side)Consent, marketing pixels, GA4 config/transport, forwarding to sGTMBrowser (through Addingwell)
Server (server-side)CAPI destinations, Enhanced Conversions, first-party trackingCustom domain (tags.mystore.com)

Both containers ship pre-configured and complete. Every tag, trigger, variable and vendor template is included. Credentials are interpolated from Connectors at download time.

2Web + Server Architecture

How the Web Container is organised

GTM Web Container
├── Consent Initialization
│   └── Cookiebot CMP (Denied defaults)
│
├── GA4 Config / Transport
│   └── GA4 tag → server_container_url → sGTM
│
├── Marketing Tags (waiting for consent)
│   ├── Meta Pixel (PageView, ViewContent, AddToCart, Purchase)
│   └── Google Ads Remarketing
│
├── DataLayer Triggers
│   ├── page_view, view_item_list, view_item
│   ├── add_to_cart, remove_from_cart, view_cart
│   └── begin_checkout, purchase
│
└── Variables
  ├── DataLayer Variables (ecommerce.*)
  ├── Consent State Variables
  └── Connectors Variables

How the Server Container is organised

sGTM Server Container
├── Client
│   └── GA4 Client (receives hits from the Web Container)
│
├── Tags
│   ├── GA4 Server Tag → Google Analytics
│   ├── Meta Conversions API Tag → Meta
│   └── Google Ads Server Conversions Tag → Google Ads
│
├── Triggers
│   └── Based on the GA4 event_name (purchase, page_view, etc.)
│
└── Variables
  ├── Event Data Variables (transaction_id, value, etc.)
  └── User Data Variables (email, phone: hashed)

Full Web → Server flow

GTM Web → GA4 transport → server_container_url
                                  ↓
                          sGTM Server Container
                                  ↓
                  ┌───────────────┼───────────────┐
                  ↓               ↓               ↓
            GA4 Server       Meta CAPI      Google Ads EC
                  ↓               ↓               ↓
          google-analytics   graph.facebook   googleads.g

Principles

  • Every tag has its own DataLayer trigger
  • Marketing tags are gated on consent
  • GA4 acts as transport to the sGTM through the first-party custom domain
  • No tag fires without an explicit trigger
  • Client-side and server-side share the same event_id for deduplication
Web Container. Client-Side

3GTM Web Container

Import procedure

Import the Web container
1

Download the Web container below

2

GTM Web → Admin → Import Container

3

Workspace: Default

4

Mode: Merge → Overwrite conflicting tags, triggers, and variables

0/8 variables

What the container holds

17 tagsCookiebot CMP, GA4 Config + Addingwell Transport, Conversion Linker, Google Ads Remarketing, and more
18 triggersE-commerce events (page_view, view_item, add_to_cart, begin_checkout, purchase) + consent updates
32 variablesConnectors constants (GA4 ID, Server URL, CBID) + DataLayer, Event Data and User Data variables
3 templatesCookiebot CMP, Facebook Pixel, Event ID

DataLayer & triggers

Addingwell feeds the DataLayer, not the theme. Events reach GTM automatically.

DataLayer eventGTM triggerAssociated tags
page_viewCE - page_viewGA4, Meta PageView
view_itemCE - view_itemGA4, Meta ViewContent
add_to_cartCE - add_to_cartGA4, Meta AddToCart
begin_checkoutCE - begin_checkoutGA4, Meta InitiateCheckout
purchaseCE - purchaseGA4, Meta Purchase, Google Ads Conversion

Consent Mode v2

1. Consent Initialization
 └── Cookiebot → Denied defaults
     (ad_storage, analytics_storage, ad_user_data, ad_personalization)

2. Visitor accepts/declines
 └── Cookiebot → consent_update

3. Gated tags
 └── Built-in Consent checks before each tag fires
TagRequired consent
Cookiebot CMPNone (Consent Initialization)
GA4 Configanalytics_storage (Advanced Consent Mode)
Meta Pixelad_storage + ad_user_data
Google Ads Remarketingad_storage + ad_personalization

Advanced Consent Mode

GA4 uses Advanced Consent Mode: even without consent it sends anonymised pings (no cookies). Marketing tags are strictly blocked without consent.

GA4 Config / Transport

The GA4 Config tag initialises GA4 and sets up hit transport to the server container (sGTM) through the custom domain.

ParameterValueRole
Measurement IDG-XXXXXXXXXXGA4 identifier
server_container_urlhttps://tags.mystore.comsGTM custom domain (first-party)
send_page_viewfalseDisabled: handled by the page_view trigger
DataLayer event (e.g. purchase)
      ↓
GA4 Event Tag (purchase)
      ↓
GA4 Config (server_container_url)
      ↓
https://tags.mystore.com (sGTM)
      ↓
Server-side destinations

server_container_url

server_container_url routes GA4 hits to the sGTM instead of google-analytics.com. That is what enables the adblocker bypass and first-party tracking.

Client-side marketing tags

PlatformTagEvents
MetaMeta PixelPageView, ViewContent, AddToCart, InitiateCheckout, Purchase
Google AdsRemarketingPage view + audiences
  • Client-side: enriches first-party signals (_fbp, _fbc, ttclid cookies, …)
  • Server-side (sGTM): sends conversions through the API (resilient, deduplicated)
  • event_id / transaction_id deduplication prevents doubles
  • The two channels complement each other to maximise signal

Reminder — Consent Mode

Consent Mode v2 (every default at Denied) is handled by the Cookiebot CMP tag in GTM. That tag loads the banner, sets the defaults, sends consent updates and fires the conditional triggers.

Server Container. Server-Side

4GTM Server Container

Import procedure

Import the Server container
1

Download the Server container below

2

GTM Server (through Addingwell) → Admin → Import Container

3

Workspace: Default

4

Mode: Merge → Overwrite conflicting tags, triggers, and variables

0/7 variables

What the container holds

15 tagsGA4 Server, Meta CAPI (Full server-only), Google Ads EC (10 conversions), Addingwell Monitoring
12 triggersGA4 Client events (page_view, purchase, add_to_cart, view_item, begin_checkout, …)
8 variablesEvent Data (items, value, currency, event_id, fbc, gclid) + Conversion ID constant
4 templatesMeta CAPI by Addingwell, Addingwell Monitoring, URL Builder, Facebook CAPI

sGTM routing flow

GA4 Client (receives the Addingwell transport requests)
├── GA4 Server → Forward to GA4
├── META – CAPI → Conversions API (Full server-only)
│   └── fbp/fbc 1P cookies, event_id, user_data
├── GADS – Conv (x10) → Enhanced Conversions
│   └── purchase, add_to_cart, begin_checkout, view_item, etc.
├── Addingwell Monitoring → Logs & analytics
└── Automatic enrichment:
  • User data through the GA4 Event Settings Variable
  • event_id for Meta deduplication
  • Consent Mode v2 signals

First-party custom domain

  • Hits go to tags.mystore.com instead of google-analytics.com
  • Adblockers do not block first-party requests
  • Cookies are first-party (unaffected by ITP)
  • Better attribution and longer cookie lifetimes
DNS
tags.mystore.com → CNAME → sGTM hosting

GTM Web
GA4 Config → server_container_url = https://tags.mystore.com

Result
Every GA4 hit travels through the custom domain

HTTPS required

The custom domain must be served over HTTPS. The sGTM provider (Addingwell, Stape, …) manages the SSL certificate automatically.

Server-side destinations

DestinationsGTM tagAPIEvents
MetaMeta Conversions APIgraph.facebook.comPageView, ViewContent, AddToCart, Purchase
Google AdsGoogle Ads Conversionsgoogleads.googleapis.compurchase (Conversion Action)

Deduplication

PlatformDeduplication key
Metaevent_id (identical client + server)
Google Adstransaction_id / order_id

Addingwell templates

The Addingwell templates (Meta CAPI, Google Ads Conversions) enrich events automatically with user_data, cookies and URL parameters. No manual variable configuration.

Turnkey container: server-side connectors, first-party routing and destination credentials (Pixel IDs, Access Tokens) are pre-filled through Connectors. Meta runs in Full CAPI (no browser pixel).

Configuration & Publishing

5Check the Values

Every value is pre-filled in the imported containers. Open each variable/tag in GTM and confirm the value matches.

GTM Web. 3 constants
GA4 Measurement ID
Measurement IDG-XXXXXXX
Server Container URL
Container URLhttps://tags.my-store.com
Cookiebot CBID
CBIDxxxxxxxx-xxxx-...
GTM Server. destination credentials
Meta CAPI
Pixel ID123456789
Access TokenEAAG...
Google Ads
Conversion IDAW-XXXXXXXXX
Conv. LabelAbCdEf...

Procedure: GTM → Variables (Web) or Tags (Server) → open the item → check the Connectors value. DataLayer variables (DLV - ecommerce - *) fill themselves through Addingwell.

6Disable Unused Destinations

When a destination is not in use, pause its tags: do not delete them.

Destination not used
Web tag to pause
Server tag to pause
No Meta Ads
META - Pixel - All Events
META - CAPI - All Events
No Google Ads
GADS - Remarketing - All Pages
GADS - Conv - purchase

Procedure: GTM → Tags → open the tag → ... menu → Pause → save.

7Publish the Containers

Once the values are checked and the unused destinations paused:

GTM Web
1Submit
2Name the version
3Publish
GTM Server
1Submit
2Name the version
3Publish

Before you publish

Do not publish if any value looks wrong, or if placeholders are still visible in the variables or tags. Go back to Connectors and fix them first.

Reference & Verification

8Tag Reference

Enhanced Conversions

Enhanced Conversions improve user matching by sending hashed (SHA-256) data to the platforms.

DataSourceHashing
EmailDataLayer (purchase)Automatic SHA-256
PhoneDataLayer (purchase)Automatic SHA-256
First NameDataLayer (purchase)Automatic SHA-256
Last NameDataLayer (purchase)Automatic SHA-256
AddressDataLayer (purchase)Automatic SHA-256
Shopify Checkout (purchase)
      ↓
DataLayer (user_data in clear text)
      ↓
GTM Web → GA4 transport → sGTM
      ↓
sGTM templates hash it automatically
      ↓
Platforms receive the hashed data

Consent required

User data is never sent without marketing consent. Consent Mode v2 blocks the transmission when ad_user_data = Denied.

DataLayer variables (Web Container)

VariableDataLayer pathUsage
DLV - ecommerce.currencyecommerce.currencyCurrency (EUR, USD, …)
DLV - ecommerce.valueecommerce.valueTransaction amount
DLV - ecommerce.transaction_idecommerce.transaction_idUnique order ID
DLV - ecommerce.itemsecommerce.itemsProducts (array)

Credentials needed (Server Container)

DestinationCredentials
Meta CAPIPixel ID + Access Token
Google AdsConversion ID + Conversion Label
GA4Measurement ID (inherited from Web)

Naming convention

DataLayer variables use the DLV - prefix. Configuration constants are named after their role. Triggers use the CE - prefix (Custom Event).

9Verification

GTM Preview Mode (Web Container)

  1. 1Open GTM → Preview (top-right button)
  2. 2Enter the Shopify store URL
  3. 3Browse the store in the preview tab
  4. 4Check which tags fire in the debug panel
CheckExpected
Consent InitializationCookiebot CMP fires first
Before consentOnly Cookiebot and GA4 Config fire
After marketing consentMeta and Google Ads fire
purchase eventEvery ecommerce variable populated
server_container_urlGA4 hits leave through the custom domain

GTM Preview Mode (Server Container)

  1. 1Open GTM Server → Preview Mode
  2. 2Browse the store and trigger some events
  3. 3Check the GA4 Client receives the hits
  4. 4Check each server tag fires correctly

Verify the destinations

DestinationVerification tool
Meta CAPIMeta Events Manager → Test Events
Google AdsGoogle Ads → Conversions → Diagnostics
GA4GA4 DebugView (Realtime)

CDN proxy and Preview

When the Addingwell CDN proxy is active, Preview Mode may not work on the custom domain. Test with the proxy temporarily disabled, or use the direct GTM URL.

Phase 2: GTM + consent foundations

GTM + consent foundations0/7
Pre-consent test (private window)
1Open the site in a private window
2Click "Deny all" in the Cookiebot banner
3GTM Preview: check that only Necessary tags fire
4Network: no request to GA4, Meta or Google Ads
Post-consent test
1Open the site in a private window
2Click "Accept all" in the banner
3GTM Preview: analytics and marketing tags must fire
4GA4 DebugView: events visible in real time

10Troubleshooting

Tags not firing (Web)

Check:

  1. 1GTM injected by Addingwell (no conflicting manual snippet)
  2. 2Container ID correct
  3. 3DataLayer events present (console → dataLayer)
  4. 4Triggers correctly mapped to the events
Marketing tags fire without consent

Check:

  • Cookiebot tag on Consent Initialization (not All Pages)
  • Built-in consent configured on every marketing tag
  • No tag left on "No additional consent required"
sGTM receives no hits

Check:

  1. 1server_container_url correct in GTM Web (GA4 Config tag)
  2. 2Custom domain working (curl https://tags.mystore.com/healthz)
  3. 3Server container published
  4. 4GA4 Client configured in the sGTM
Meta CAPI returns errors

Check:

  • Access Token valid and not expired
  • Pixel ID correct
  • Token permissions (ads_management, ads_read)
  • Event format (event_name, user_data)
Duplicate conversions

Check:

  • event_id identical between client-side and server-side
  • No duplicate purchase tag in GTM Web
  • No conversion imported manually in parallel
  • Deduplication enabled on the platform side
Enhanced Conversions low match rate

Check:

  • user_data present in the DataLayer (email, phone)
  • Values non-empty at purchase time
  • Automatic hashing active in the templates
  • ad_user_data consent = Granted

Full checklist

GTM. Import, Config & Publish0/9

Check the layer you just set up

Scan the store: 41 checks read what it now sends to GA4, Meta and Google Ads.