Shopify
Complete technical guide: the e-commerce platform every data point starts from. Store architecture, pre-install cleanup, checkout, pixels, Privacy API, multi-currency markets and verification.
1Role / Purpose
Shopify is the source of all e-commerce data. The store emits the user events that the rest of the stack (Addingwell, GTM, sGTM) collects and distributes.
- Source of e-commerce events (page_view, add_to_cart, purchase, …)
- Proprietary checkout with the Custom Pixel API
- Shopify Privacy API for pixel consent control
- Markets for multi-currency and multi-language
- Customer Events for web pixels and custom pixels
Shopify handles no marketing tag directly. Everything goes through Addingwell (DataLayer + GTM injection) and then GTM (tags + consent).
2Store Architecture
Stack layers on Shopify
Shopify Store ├── Theme (Storefront) │ └── Public pages (home, collection, product, cart) │ ├── Checkout (isolated iframe) │ └── Extensible through Custom Pixels │ ├── Customer Events (Settings) │ ├── Web Pixels (JS sandbox) │ └── Custom Pixels (arbitrary code) │ ├── Installed apps │ ├── Addingwell (DataLayer + GTM + sGTM) │ ├── Cookiebot (CMP via GTM) │ └── Klaviyo (Shopify-native) │ └── Privacy API └── Consent management for pixels
Key points
- The theme plays no part in tracking (no custom Liquid code)
- The checkout is isolated: only Custom Pixels reach it
- Addingwell handles the whole DataLayer and GTM layer automatically
- The Privacy API governs Shopify web/custom pixels only
3Pre-install Cleanup
Before installing the tracking stack you must clean up whatever is already there. Two tracking systems running in parallel means duplicate events, which means corrupted data.
Absolute rule
Clean up before installing the stack. One forgotten pixel or tracking app can corrupt all the data.
Apps to remove
| App | Reason |
|---|---|
| Facebook & Instagram (Meta native) | Built-in Meta pixel, conflicts with Meta CAPI via GTM |
| Google & YouTube (Google native) | Built-in Google tracking, conflicts with GA4 + Google Ads via GTM |
| Trackify, Pixel Perfect, Elevar, etc. | Third-party tracking apps, guaranteed duplicates |
| Tracking scripts hardcoded in the theme | <script> tags injected by hand into theme.liquid |
Where to check
- 1Shopify Admin > Settings > Apps and sales channels: uninstall the tracking apps listed above
- 2Shopify Admin > Settings > Customer events (custom pixels): delete the old custom pixels
- 3theme.liquid — find and remove fbq('init', …), gtag('config', …) and any hand-injected tracking script
Disable Shopify's native privacy features
Consent conflict
Consent is handled by Cookiebot through GTM, not by Shopify. The native banner and opt-out page must be disabled to avoid conflicts (double banner, contradictory signals).
Go to Shopify Admin > Settings > Customer privacy:
| Setting | Required value |
|---|---|
| Cookie banner — automated settings | OFF |
| Cookie banner — regions | Not shown in any region (uncheck every region) |
| Opt-out page — automated settings | OFF |
| Opt-out page — regions | Not active in any region (uncheck every region) |
| Privacy policy | May stay "Automated" (legal content, does not interfere) |
| Data hosting | European Union (consistent with CDS Region .eu in Cookiebot) |
4DataLayer Events
The DataLayer is generated automatically by Addingwell. No custom code is needed in the theme.
Events per page
| Page | Events | Key data |
|---|---|---|
| All | page_view | URL, title, referrer |
| Collection | view_item_list, select_item | Product list, position |
| Product | view_item | SKU, price, variant |
| Product / Collection | add_to_cart | Item, quantity, value |
| Cart | view_cart, remove_from_cart | Items, total value |
| Checkout | begin_checkout | Items, value (Custom Pixel) |
| Checkout | add_shipping_info, add_payment_info | Shipping/payment method |
| Thank you | purchase | Transaction ID, revenue, items (Custom Pixel) |
Single source
Every event flows through the same DataLayer. There is no second source: Addingwell is the only injector.
5Checkout Extensibility
The Shopify checkout is an isolated iframe. Theme JavaScript cannot reach it directly. Shopify offers two mechanisms for checkout tracking:
| Mechanism | Access | Usage |
|---|---|---|
| Web Pixels | JS sandbox (limited) | Standard pixels (Meta) |
| Custom Pixels | Arbitrary code (full) | Custom DataLayer, GTM events |
Addingwell Custom Pixel
Addingwell uses a Custom Pixel to capture begin_checkout and purchase inside the checkout, then pushes them to the GTM DataLayer.
Permission: Not required
The Addingwell Custom Pixel uses "Not required". That is deliberate: consent is handled by Cookiebot inside GTM (Consent Mode v2), not by the Shopify Privacy API.
Checkout sandbox — testing limitation
GTM Preview does not work on the checkout
The Shopify checkout is an isolated sandbox. GTM Preview does not run there. Verify the begin_checkout and purchase events through DevTools > Network and the JavaScript console only.
6Web Pixels vs Custom Pixels
| Web Pixels | Custom Pixels | |
|---|---|---|
| Environment | JS sandbox (worker) | JS sandbox (iframe) |
| DOM access | No | No |
| Cookie access | No | No |
| Custom code | No (config only) | Yes (arbitrary code) |
| Consent | Shopify Privacy API | Configurable (Required / Not required) |
| Example | Klaviyo, native Meta | Addingwell DataLayer |
Web pixels are managed by Shopify apps (Klaviyo and friends). Custom pixels are configured by hand under Settings → Customer Events.
7Shopify Privacy API
Role
The Shopify Customer Privacy API decides which web pixels and custom pixels are allowed to fire. It is kept in sync with Cookiebot through the bridge.
Consent flow
Cookiebot (CMP in GTM)
↓
Bridge cookie-consent_boostecom.liquid
↓
Shopify.customerPrivacy.setTrackingConsent({
marketing: true/false
})
↓
Web pixels fire / blockedWhat the Privacy API governs
| Element | Governed by Privacy API | Governed by GTM Consent Mode |
|---|---|---|
| Web pixels (Klaviyo, native Meta) | Yes | No |
| Custom pixels | If permission = Required | No |
| GTM tags (GA4, Meta CAPI, …) | No | Yes |
| Theme scripts | No | No |
Shopify's native banner
The Shopify cookie banner and opt-out page must be disabled (no region checked) to avoid conflicts with Cookiebot. See the Pre-install Cleanup section for details.
8Markets & Multi-currency
Shopify Markets handles multi-currency and multi-language. Tracking must support conversions in the local currency.
Impact on tracking
- Addingwell includes the currency in every e-commerce event
- Values (value, price) are in the visitor's local currency
- GA4 supports multi-currency natively
- Meta CAPI receives the correct currency through the sGTM
- No extra configuration needed
The Addingwell DataLayer handles the local currency automatically. No extra configuration is needed for markets.
9Configuration
Prerequisites
- Active Shopify store (Basic plan or above)
- Admin access with the Apps and Customer Events permissions
- Custom domain configured
- Pre-install cleanup done (see section 3)
Apps to install
- 1Addingwell — GA4 DataLayer, GTM injection, adblocker bypass, cookie restore
- 2Cookiebot — GDPR CMP (consent banner, configured through GTM)
Addingwell features to enable
| Feature | Role |
|---|---|
| GA4 DataLayer | 11+ automatic e-commerce events |
| GTM injection | GTM on every page of the store |
| Checkout Custom Pixel | Checkout events (begin_checkout, purchase) |
| Adblocker bypass | CDN proxy, works around blockers |
| Cookie restore | Safari ITP bypass, long-window attribution |
Checkout Custom Pixel
- 1Go to Shopify Admin > Settings > Customer Events
- 2Add custom pixel > paste the code Addingwell provides
- 3Permission: "Not required" (not "Required"), consent is handled by GTM, not the Privacy API
sGTM server
- 1Create the server in Addingwell
- 2Configure the custom domain (e.g. tags.my-store.com)
- 3Recommended region: Europe multi-region
- 4DNS: the CNAME provided by Addingwell > Server > Custom Domain
Post-install checks
- 1Addingwell connected and active in the dashboard
- 2Addingwell Custom Pixel present under Settings → Customer Events
- 3Custom Pixel permission = "Not required"
- 4Shopify native banner disabled (Settings → Customer Privacy)
- 5Consent bridge present in theme.liquid (cookie-consent_boostecom.liquid)
- 6DataLayer Monitor custom pixel installed under Customer Events
- 7sGTM custom domain answers with status 200
10Verification
Verify the DataLayer
- 1Open the browser console on the store
- 2Type dataLayer and check the events are there
- 3Browse: home → collection → product → cart
- 4Check page_view, view_item_list, view_item, add_to_cart, view_cart
- 5Complete a test checkout → check begin_checkout and purchase
Verify the Custom Pixels
- 1Shopify Admin → Settings → Customer Events
- 2Check the Addingwell Custom Pixel is present and active
- 3Check the permission reads "Not required"
- 4Check the DataLayer Monitor is present and active
- 5No other conflicting custom pixel
Verify the Privacy API
- 1Browser console → Shopify.customerPrivacy.getTrackingConsent()
- 2Before consent: marketing = "no_interaction"
- 3After accepting in Cookiebot: marketing = "yes"
- 4After declining in Cookiebot: marketing = "no"
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
Purchase test — test order
Place a test order, then run this in the console:
dataLayer.filter(e => e.event === 'purchase')- transaction_id unique (no duplicates)
- value correct (total price including tax and shipping)
- currency valid (ISO 4217, e.g. EUR, USD)
- items array complete, with every product
Final cleanup
Once the stack is verified, confirm that nothing left behind can interfere:
- "Facebook & Instagram" app removed (native Meta pixel)
- "Google & YouTube" app removed (native Google tracking)
- Old tracking apps removed (Trackify, Pixel Perfect, Elevar, …)
- No manual tracking script left in the theme (liquid)
- Shopify cookie banner + opt-out page disabled (no region checked)
11Troubleshooting
Check:
- 1Addingwell app installed and active
- 2Store connected in the Addingwell dashboard
- 3No conflict with another DataLayer script
Check:
- Custom Pixel active under Settings → Customer Events
- Permission = "Not required"
- No JS error in the checkout console
- DataLayer Monitor active for diagnosis (?awdebug=1)
Check:
- Bridge cookie-consent_boostecom.liquid present in theme.liquid
- Position: after {{ content_for_header }}
- Shopify.loadFeatures fine in the console
- CookiebotOnConsentReady event fires
Check:
- Native pixels still active (Facebook & Instagram, Google & YouTube)
- event_id not passed in the DataLayer
- GTM containers imported more than once
- Remove the native tracking apps and check the event_id
Check:
- Addingwell checkout custom pixel not active
- purchase trigger missing in GTM
- sGTM request not sent (check Network)
- Check in the console: dataLayer.filter(e => ['begin_checkout','purchase'].includes(e.event))
Check:
- Not enabled under Addingwell > Settings
- sGTM custom domain DNS incorrect
- Check the shopify_y field in the DataLayer
- Check the DNS records (CNAME)
Check:
- Wrong CBID in the GTM variable
- Domain invalid under Cookiebot > Settings > Domain Groups
- Cookiebot tag disabled in GTM
Check:
- Expected behaviour — the Klaviyo app embed loads on first render
- The Cookiebot → Shopify Privacy API bridge governs consent for the Klaviyo web pixels
- Check that cookie-consent_boostecom.liquid is installed
- setTrackingConsent must be called after CookiebotOnConsentReady
Check the layer you just set up
Scan the store: 41 checks read what it now sends to GA4, Meta and Google Ads.