GuideAnalytics~15 min

Google Analytics 4

Technical guide: measuring traffic and e-commerce conversions. Server-side architecture, transport layer, debugging, attribution.

Connectors0/1
GA4 Measurement ID
GA4 > Admin > Data Streams > Web stream. e.g. G-XXXXXXX

1Role / Purpose

GA4 plays a dual role in our stack:

Analytics

  • Traffic and behaviour measurement
  • Full e-commerce funnel
  • Conversion attribution
  • Reporting and insights

Technical transport

  • Carries events to the sGTM
  • Standard collection protocol
  • The only reliable way to reach the sGTM
  • Bypasses adblockers via a custom domain

GA4 is both the analytics tool and the technical vehicle feeding every server-side destination (Meta CAPI, Google Ads, and so on).

2Server-Side Architecture

Full flow

Addingwell DataLayer
      |
GTM Web Container
      |
GA4 Config Tag (transport_url = sGTM)
      |
Server-Side GTM (custom domain)
      |
+-- GA4 Server Tag --> Google Analytics
+-- Meta CAPI Tag --> Meta Conversions API
+-- Google Ads Tag --> Enhanced Conversions
+-- Other server-side destinations

Why server-side?

  • Bypasses adblockers (first-party custom domain)
  • More reliable data (no client-side loss)
  • Consent Mode handled server-side
  • A single collection point for every destination
  • ITP cookie restore via Addingwell

3Data Transport

In our architecture GA4 acts as the transport layer between the GTM Web container and the sGTM. GA4 events carry everything the destinations need.

server_container_url

The server_container_url field in the GA4 Config tag redirects hits to the sGTM instead of google-analytics.com.

Without server_container_url:
browser --> google-analytics.com (blocked by adblockers)

With server_container_url:
browser --> tags.my-store.com --> sGTM --> GA4 + destinations

Critical

Without server_container_url, GA4 hits go straight to Google and no server-side destination works (Meta CAPI, Google Ads Enhanced Conversions, and so on).

GA4 data flow

GA4 is wired automatically through the server-side transport. The GA4 Config tag in the GTM Web container sends hits to the sGTM custom domain (first-party). The sGTM receives and distributes them.

GTM Web (client)
--> GA4 Config + Transport tag
  --> HTTP request to the sGTM custom domain (first-party)

sGTM (server)
--> GA4 Client (receives the request)
  +-- GA4 Server tag --> Google Analytics 4
  +-- META - CAPI - All Events --> Meta (Full CAPI, server-only)
  +-- GADS - Conv - purchase --> Google Ads Enhanced Conversions
  +-- (coming soon) TikTok Events API, Snap CAPI

Server-side enrichment:
- Automatic SHA-256 hashing (email, phone, address)
- Attribution cookies (fbp, fbc, gclid, wbraid, gbraid)
- event_id for deduplication
- Consent Mode v2 signals forwarded

What GA4 receives

  • Every e-commerce event from the DataLayer (page_view, view_item, add_to_cart, purchase, and so on)
  • Enriched parameters (items[], value, currency, transaction_id)
  • Consent Mode v2 signals (analytics_storage, ad_storage)
  • First-party attribution cookies (fbp, fbc, gclid) via cookie restore

What GA4 does not receive directly

  • Plain-text PII (hashed server-side only)
  • Events for other destinations (Meta, Google Ads): the sGTM handles those in parallel
  • Events without analytics consent (only anonymised Advanced Consent Mode pings)

GA4 needs no extra configuration to act as transport. The Measurement ID and server_container_url in Connectors are enough, the pre-configured GTM containers do the rest.

4E-commerce Events

Events tracked in GA4

GA4 eventFunnelKey parameters
page_viewAll pagespage_location, page_title
view_item_listDiscoveryitem_list_name, items[]
select_itemDiscoveryitem_list_name, items[]
view_itemConsiderationcurrency, value, items[]
add_to_cartConsiderationcurrency, value, items[]
remove_from_cartConsiderationcurrency, value, items[]
view_cartConsiderationcurrency, value, items[]
begin_checkoutConversioncurrency, value, items[]
add_shipping_infoConversionshipping_tier, currency, value
add_payment_infoConversionpayment_type, currency, value
purchaseConversiontransaction_id, currency, value, items[]

Enriched parameters

Every e-commerce event carries the full items[] array with item_id, item_name, price, quantity, item_category and item_variant.

Config Tag (GTM Web)

The GA4 Config tag in the GTM Web container sets up collection and transport to the sGTM.

ParameterValueRole
Measurement IDG-XXXXXXXXXXIdentifies the GA4 property
server_container_urlhttps://tags.my-store.comRoutes hits to the sGTM
Consentanalytics_storageGated on Cookiebot consent
TriggerAll PagesInitialised on every page

GA4 Transport Tag

A second GA4 Event tag acts as transport for e-commerce events to the sGTM, forwarding DataLayer events to the server container.

Both tags (Config + Transport) ship inside the pre-configured GTM Web container. The credentials (Measurement ID, server_container_url) are interpolated from Connectors.

GA4 Server Tag (sGTM)

The GA4 Server Tag in the sGTM receives events and forwards them to the Google Analytics property.

GA4 Client (sGTM) receives the hit
      |
GA4 Server Tag --> forwards to Google Analytics
      |
Other tags (Meta, Google Ads) --> read the same events
      |
Every destination receives the enriched data
  • The GA4 Client parses incoming hits
  • The GA4 Server Tag forwards to Google Analytics
  • Other tags (Meta CAPI, Google Ads) fire on the same events
  • No double sending: one GA4 hit feeds every destination

Conversions & attribution

In GA4, mark the key events as conversions:

EventConversionValue
purchaseYesTransaction revenue
begin_checkoutOptionalCart value
add_to_cartNo-
page_viewNo-

Attribution model

  • GA4 uses Data-Driven Attribution by default
  • Modelled conversions compensate for data loss (consent, adblockers)
  • Advanced Consent Mode sends anonymised pings even without analytics consent
  • Google Ads conversions imported from GA4 benefit from the modelling

5Configuration

Prerequisites

  • GA4 property created in Google Analytics
  • Measurement ID (G-XXXXXXXXXX)
  • Web stream configured
  • sGTM custom domain configured (server_container_url)

Connectors

GA4 credentials are configured in Connectors:

FieldExampleUsage
ga4_measurement_idG-XXXXXXXXXXGA4 Config tag in GTM Web
server_container_urlhttps://tags.my-store.comTransport to the sGTM

These values are interpolated automatically into the GTM containers at download time. No manual configuration in GTM is required.

DebugView & Realtime

DebugView

  1. 1GA4 Admin → DebugView
  2. 2Enable debug mode (GTM Preview or debug_mode=true)
  3. 3Events appear in real time with all their parameters
  4. 4Check the ecommerce parameters (items[], value, currency)
  5. 5Check that events actually arrive (no gaps in the funnel)

Realtime

  • GA4 Admin → Reports → Realtime
  • Shows events from the last 30 minutes
  • Useful for a quick check after a change
  • Does not show detailed parameters (use DebugView for that)

Latency

Standard GA4 reports lag by 24-48h. For debugging, always use DebugView or Realtime.

6Verification

Verify the sGTM transport

  1. 1Open the browser's Network tab
  2. 2Filter by the custom domain (tags.my-store.com)
  3. 3/collect requests must point to the sGTM
  4. 4No direct request to google-analytics.com

Verify GA4 events

  1. 1GA4 → DebugView (enable debug mode)
  2. 2Browse the store: home → collection → product → cart → checkout
  3. 3Check every event in the funnel
  4. 4Check the ecommerce parameters (items[], value, currency)
  5. 5Complete a test purchase → check purchase carries transaction_id

Verify consent

  • Before consent: anonymised pings only (Advanced Consent Mode)
  • After analytics consent: full events with GA4 cookies
  • Check in GTM Preview Mode that consent really gates the tags

GA4-as-destination checks (Phase 3)

Checkpoints specific to GA4 as an sGTM destination:

  • Events visible in GA4 Realtime after consent
  • Requests sent through the sGTM custom domain (not googletagmanager.com)
  • GA4 Server Tag active in the sGTM and forwarding to Google Analytics
  • Check in GA4 → Admin → DebugView that events really arrive from the server

7Troubleshooting

No events in GA4

Check:

  1. 1Measurement ID correct in Connectors
  2. 2GA4 Config tag present in GTM Web
  3. 3GTM injected by Addingwell (no missing GTM)
  4. 4server_container_url points to the right sGTM
Events in GA4 but not in the sGTM

Check:

  • server_container_url configured in the GA4 Config tag
  • Custom domain DNS points to the sGTM
  • sGTM running (not stopped)
  • GA4 Client active in the sGTM
purchase missing in GA4

Check:

  • Addingwell Custom Pixel active in Shopify
  • purchase event present in the DataLayer (console)
  • GA4 Event tag fired on the purchase event in GTM
  • transaction_id present and unique
GA4 DebugView empty

Check:

  • Measurement ID wrong in the GTM variable
  • Debug mode inactive (enable via GTM Preview or debug_mode=true)
  • Consent declined — accept consent and reload the page
  • Check that the GA4 Config tag fires in GTM Preview
GA4 requests blocked by adblockers

Check:

  • Check that server_container_url uses a first-party custom domain
  • The sGTM custom domain must sit on the same domain as the store
  • Check in Network: requests must go to tags.my-store.com, not google-analytics.com
  • If the custom domain is missing, every server-side destination is affected
Duplicate purchases in GA4

Check:

  • Check that event_id (transaction_id) is unique for each order
  • Remove native tracking apps (Facebook & Instagram, Google & YouTube)
  • Check there is no duplicate GA4 tag in GTM Web
  • Only one GTM container may be active on the store

8GA4 Checklist

GA4 Checklist0/10

Check the layer you just set up

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