GuideInfrastructure~15 min

Addingwell

Complete technical guide: the Shopify infrastructure plugin. Installation, GA4 DataLayer, checkout Custom Pixel, GTM injection, adblocker bypass, cookie restore, attribution cookies, DataLayer Monitor.

Connectors0/1
sGTM custom domain
Addingwell > Server > Custom Domain. e.g. tags.my-store.com
Addingwell account
addingwell.com. account email + active billing

1Role / Purpose

Addingwell is the infrastructure plugin that automates the entire technical layer of Shopify tracking:

  • Automatic GA4 DataLayer injection (11+ e-commerce events)
  • Custom Pixel for checkout events (begin_checkout, purchase)
  • GTM injection on every page of the store
  • Adblocker bypass through a first-party CDN proxy
  • Cookie restore to work around Safari ITP
  • Hosting for the sGTM server (server-side GTM)

Addingwell replaces every manual DataLayer setup. No custom code is needed in the theme for tracking.

2Architecture

What Addingwell installs automatically

Shopify Store
├── GA4 DataLayer (every page)
│   └── 11+ standard e-commerce events
├── Custom Pixel (checkout)
│   └── begin_checkout + purchase
├── GTM Web Container (injection)
│   └── Script injected on every page
├── CDN Proxy (adblocker bypass)
│   └── First-party domain for the scripts
├── Cookie Restore (Safari ITP)
│   └── First-party cookie restoration
└── sGTM server
  └── Custom domain + configurable region

Where it sits in the stack

Shopify
→ Theme layer
  → Cookiebot bridge → Shopify Privacy API
→ Addingwell
  → GA4 DataLayer + DataLayer Monitor (custom pixel)
  → GTM Web
    → Cookiebot CMP (Consent Mode v2, EEA + UK)
    → GA4 tag → sGTM
    → Meta Pixel → sGTM
    → Google Ads tag → sGTM
  → sGTM (Addingwell server)
    → GA4 (server)
    → Meta CAPI (server)
    → Google Ads Enhanced Conversions (server)
    → Attribution cookies (fbp, fbc, gclid, wbraid, gbraid)

Benefits

  • Zero theme configuration — everything is automatic
  • Works with every Shopify theme
  • No custom Liquid code needed for tracking
  • Updates itself when Shopify changes its APIs
  • Native support for multi-currency markets

3Installation

Create an account and install

  1. 1Create an account on addingwell.com (active billing required)
  2. 2Install the Shopify plugin from the Addingwell App Store
  3. 3In the plugin settings, enable the features below

Features to enable

FeatureRole
GA4 DataLayer11+ automatic e-commerce events
GTM injectionGTM on every page of the store
Checkout Custom PixelCheckout events (begin_checkout, purchase)
Adblocker bypassCDN proxy, works around blockers
Cookie restoreSafari ITP bypass, long-window attribution

Configure the checkout custom pixel

  1. 1Shopify Admin > Settings > Customer Events
  2. 2Add custom pixel > paste the code Addingwell provides

Permission: Not required

The Custom Pixel uses the "Not required" permission. It relies on Google Advanced Consent Mode through GTM, not on the Shopify Privacy API. Never change this permission.

Configure the sGTM server

  1. 1Create the server in the Addingwell dashboard
  2. 2Custom domain: tags.my-store.com (your subdomain)
  3. 3Recommended region: Europe multi-region

Configure DNS (custom domain)

The custom domain (e.g. tags.my-store.com) serves as both the sGTM endpoint and the CDN proxy for GTM. It is what makes first-party tracking possible (adblocker bypass, Safari ITP).

TypeNameValue
CNAMEtagsprovided by Addingwell

The exact CNAME value appears under Addingwell > Server > Custom Domain when the server is created. DNS propagation: a few minutes to 48h depending on the registrar.

4GA4 DataLayer

Injected e-commerce events

GA4 eventPageDescription
page_viewAllPage load
view_item_listCollectionProduct list view
select_itemCollectionClick on a product
view_itemProductProduct page view
add_to_cartProduct / CollectionAdded to cart
remove_from_cartCartRemoved from cart
view_cartCartCart view
begin_checkoutCheckoutCheckout started (Custom Pixel)
add_shipping_infoCheckoutShipping details entered
add_payment_infoCheckoutPayment details entered
purchaseThank youPurchase confirmed (Custom Pixel)

Structure of an event

dataLayer.push({
event: "view_item",
ecommerce: {
  currency: "EUR",
  value: 49.90,
  items: [{
    item_id: "SKU-001",
    item_name: "Premium T-Shirt",
    price: 49.90,
    quantity: 1
  }]
}
})

Quick check

  1. 1Open the browser console on the store
  2. 2Type dataLayer and inspect the events
  3. 3Browse: page → collection → product → cart
  4. 4Check page_view, view_item_list, view_item, add_to_cart

This structure is generated automatically by Addingwell. No custom dataLayer.push() is needed.

5Checkout Custom Pixel

The Shopify checkout is isolated (iframe). Addingwell uses a Custom Pixel to capture the checkout events.

Captured events

  • begin_checkout — the purchase process starts
  • purchase — purchase confirmed, with transaction_id, value, items

Permission: Not required

The Custom Pixel uses the "Not required" permission. That is deliberate: it relies on Google Advanced Consent Mode through GTM, not on the Shopify Privacy API. Never change this permission.

Checkout event flow

Shopify Checkout (iframe)
      ↓
Addingwell Custom Pixel
      ↓
dataLayer.push({ event: "purchase", ... })
      ↓
GTM Web Container
      ↓
GA4 → sGTM → Destinations

GTM injection

Addingwell injects the GTM Web snippet automatically on every page of the Shopify store.

  • No need to edit theme.liquid
  • Optimised injection (async, non-blocking)
  • Works with every theme
  • The snippet updates itself
  • Supports the CDN proxy for adblocker bypass

GTM injection through Addingwell is the recommended method. Do not inject GTM by hand into the theme when Addingwell is installed.

Adblocker bypass

Normal request (blocked)
browser → googletagmanager.com ✗ (adblocker)

Request through the CDN proxy (passes)
browser → cdn.mystore.com → googletagmanager.com ✓
  • First-party CDN proxy on the store domain
  • GTM/GA4 scripts are served from the same domain
  • Adblockers do not block first-party requests
  • Recovers 15-30% of otherwise lost data

The Safari ITP problem

Safari ITP caps JavaScript first-party cookies at 7 days (or 24h in some cases). Tracking identifiers (_ga, _fbp, _fbc) expire far too quickly.

The Cookie Restore solution

  • Addingwell intercepts the cookies before they expire
  • The cookies are rewritten through a server-side endpoint
  • Server-side cookies are not affected by ITP
  • Lifetime restored to its normal value (2 years for _ga)

Impact

Without cookie restore, Safari attribution is capped at 7 days. With it, the attribution windows return to their normal length.

Attribution cookies (1P)

Attribution cookies are persisted first-party by Addingwell (cookie restore). They survive Safari ITP and browser purges, which is what makes attribution reliable.

CookiePlatformUsage
_fbpMetaBrowser ID: identifies the browser for CAPI matching
_fbcMetaClick ID: captures the fbclid from Meta ads
_gcl_aw (gclid)Google AdsClick ID: Google Ads conversion attribution
_gcl_gb (gbraid)Google AdsClick ID: cross-device attribution (app→web)
_gcl_gw (wbraid)Google AdsClick ID: web-to-app attribution, iOS 14.5+

These cookies are read and forwarded automatically by the sGTM to their respective destinations. Addingwell's cookie restore rewrites them first-party through the custom domain, working around Safari ITP (7 days → full lifetime).

7DataLayer Monitor

The DataLayer Monitor is a Shopify Custom Pixel that adds an observability layer over the tracking. It instruments dataLayer.push() and gtag(), loads the Addingwell snippet, and provides real-time debugging tools.

Features

FeatureDescription
dataLayer instrumentationIntercepts every dataLayer.push() for logging and auditing
gtag() instrumentationCaptures gtag() calls (config, event, consent, set)
Styled consoleStructured, colour-coded logs in the DevTools console
Duplicate auditDetects events sent more than once (configurable window)
PII maskingMasks sensitive data (email, phone) in the console logs
Debug modeEnabled with ?awdebug=1 in the URL: verbose logs
Page context pushPublishes reliable page_location, page_referrer and page_title from init.context
Shopify Customer EventsSubscribes to the standard Shopify events and logs them
Addingwell loaderLoads the Addingwell snippet inside the custom pixel context

Installing the Custom Pixel

  1. 1Shopify Admin > Settings > Customer Events > Add custom pixel
  2. 2Name: "AW × BE. DataLayer Monitor"
  3. 3Permission: "Not required" — the pixel uses Google Advanced Consent Mode through GTM
  4. 4Data sale: "Not a data sale"
  5. 5Paste the DataLayer Monitor script (v3.0.0)
  6. 6Connect the pixel > Save

Debug mode is enabled by adding ?awdebug=1 to any store URL. Verbose logs appear in the DevTools console with colour-coded badges per event type.

Only one checkout pixel active

This custom pixel replaces the default Addingwell checkout pixel. Never run both at once: that causes duplicates.

8Configuration

Prerequisites

  • Active Addingwell account (billing required)
  • Shopify store connected
  • GTM Web Container ID (GTM-XXXXXXX)
  • Custom domain configured for the CDN proxy and sGTM (recommended)

Configuration steps

  1. 1Install the Addingwell app from the Shopify App Store
  2. 2Connect the store in the Addingwell dashboard
  3. 3Enter the GTM Web Container ID
  4. 4Enable the CDN proxy (adblocker bypass)
  5. 5Enable Cookie Restore (ITP bypass)
  6. 6Create the sGTM server + configure the custom domain DNS
  7. 7Verify the GTM injection on the store

sGTM configuration

ParameterValue
Custom domaintags.my-store.com (a store subdomain)
RegionEurope multi-region (recommended)
DNSCNAME: value provided by Addingwell

9Verification

Phase 1: Addingwell infrastructure

  1. 1Addingwell plugin active in Shopify (Apps > Addingwell)
  2. 2GA4 DataLayer present — type dataLayer in the console
  3. 3Checkout custom pixel configured in Addingwell
  4. 4Cookie restore active — shopify_y field present in the DataLayer
  5. 5First-party sGTM requests visible in Network (custom domain)
  6. 6sGTM custom domain answers with status 200

Verify the DataLayer

  1. 1Open the browser console on the store
  2. 2Type dataLayer and inspect the events
  3. 3Browse: page → collection → product → cart
  4. 4Check page_view, view_item_list, view_item, add_to_cart
  5. 5Complete a test checkout → check begin_checkout and purchase

Verify GTM

  • Open GTM Preview Mode
  • The events must appear in the debug panel
  • Check that the ecommerce variables are populated

Verify the CDN proxy

  • Open the browser's Network tab
  • GTM/GA4 requests must point to the custom domain
  • No direct request to googletagmanager.com

Verify the attribution cookies

  • DevTools > Application > Cookies
  • Check that _fbp, _fbc and _gcl_aw (gclid) are present
  • The cookies must carry the store domain (first-party)

10Troubleshooting

Empty DataLayer

Check:

  1. 1Addingwell app installed and connected
  2. 2Store active in the Addingwell dashboard
  3. 3No conflict with another DataLayer script
purchase missing

Check:

  • Custom Pixel active under Settings → Customer Events
  • Permission = "Not required"
  • No JS error in the checkout console
  • Check that the purchase trigger exists in GTM
  • Check that the sGTM request answers 200
GTM not injected

Check:

  • GTM Container ID correct in Addingwell
  • No manual GTM snippet in the theme (conflict)
  • Addingwell app enabled
Cookie restore not working

Check:

  • Cookie Restore enabled under Addingwell > Settings
  • Check the shopify_y field in the DataLayer
  • Check the sGTM custom domain DNS records
  • sGTM custom domain answers with status 200
Attribution cookies missing (fbp, fbc, gclid)

Check:

  • Cookie restore disabled in Addingwell
  • sGTM custom domain not configured
  • The cookies must appear under DevTools > Application > Cookies with the store domain
Duplicate events detected

Check:

  • Check that only one checkout custom pixel is active (DataLayer Monitor OR the Addingwell pixel, not both)
  • Check in GTM that an event does not have two active triggers
  • Use ?awdebug=1 to see the duplicate audit in the console
Addingwell Checklist0/12

Check the layer you just set up

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