Short answer
Use Shopify customer events as the checkout data source. Choose an app pixel or GTM implementation, and give each destination one purchase-event sender.
The answer in detail
A data layer is the JavaScript dataLayer array where a site places events for Google Tag Manager to read. On Shopify, customer events provide the checkout-inclusive source: an app pixel can read them, or a custom pixel can pass them into GTM.
The benchmark
A site adds events to window.dataLayer with dataLayer.push(). Google's documentation specifies one data layer per page: do not overwrite it, and preserve its exact capitalization.
In Shopify, pixels are managed under Settings > Customer events, using the source's October 2026 labels. They can operate through checkout and the thank-you page.
| App pixel | Custom pixel | |
|---|---|---|
| Installed by | An app, such as Google & YouTube, Meta, or Klaviyo | You, using JavaScript |
| Sandbox | Strict | Lax |
| Support | App provider | No Shopify support for custom code |
The sandbox is the isolated environment in which the pixel executes. The source cites fifteen Shopify standard events. Google's integration maps checkout_started to GA4 begin_checkout, and checkout_completed to purchase.
Shopify has moved checkout customization to its extensibility framework. Code placed only in theme.liquid does not provide complete checkout visibility. Audit the actual thank-you and order-status configuration rather than assuming a legacy script still observes checkout events.
The rule
The most useful Shopify data layer is usually one you do not build from scratch. Customer events already cover the purchase journey. Decide who reads them, with one sender per destination and event.
If GA4 and Google Ads are your only destinations, the Google & YouTube app may cover the requirement. For several tools or finer triggers, a custom pixel can load GTM and push Shopify events into its data layer. Shopify publishes a tutorial but does not support the resulting custom implementation.
For a theme-specific action such as opening a size guide, publish a custom event with Shopify.analytics.publish('my_brand:size_guide', data). Shopify warns that browser-console users can publish these events too. Use them for behavioral analysis, and base revenue measurement on checkout_completed rather than an untrusted custom action.
The steps
- Inventory senders. Record installer, status, permissions, events, and destination for every pixel. Include
theme.liquid, app embeds, and GTM. Two integrations sendingpurchaseto the same property are a duplication risk. - Remove replaced tracking. Identify and remove obsolete code and apps, following Shopify's guidance. Confirm which sender will remain before disabling anything.
- Create a custom pixel if needed. Choose Add pixel, name it, insert GTM code without
<script>tags, subscribe throughanalytics.subscribe, save, and connect the pixel. - Configure privacy requirements. Review Customer privacy permissions and purposes. Where permission is required, an app pixel loads only after every declared purpose is granted. Consent-dependent tracking loses some purchases when permission is declined. Configure this for the rules applying to your visitors and business; one consent regime is not worldwide law.
- Configure GTM. Match the custom-event trigger to the exact
eventkey. Add data-layer variables for value, currency, transaction ID, and items. - Test the whole journey. Use the pixel's Test action and Shopify Pixel Helper to inspect incoming events. Place an actual test order and confirm exactly one
purchasereaches GA4 DebugView.
The pitfall
The common mistake is letting both the Google app and a GTM pixel send purchases to the same GA4 property. Transaction-ID deduplication is limited: the cited Google documentation describes it for the same user on a web stream. Different user attribution can let both copies through.
An apparel brand in the contributors' spring-2026 fieldwork showed 1,026 GA4 purchases against 568 Shopify orders, with €158,257 reported versus €79,602 collected. The old Google & YouTube app remained active beside a newer tracking app, and Google Ads learned from duplicated purchases. Four pixels were Always active, including one subscribed to no event. These original euro amounts describe that case.
Divide GA4 purchases by Shopify orders over matching dates and scope. Above 100%, investigate duplication; below it, missing consent-dependent events can conceal duplicates. Watch especially for an increase after installing an app, against the usual Shopify–GA4 gap.
What to tell your team
This example is fictional:
“Three sources sent purchases to GA4, producing 118 purchases for 100 orders. We will keep the Google app as GA4's sender and use a GTM pixel for Meta and TikTok. GA4 purchases should fall about 15% and move closer to actual orders.”
Sources
- Google Tag Platform: The data layer
- Shopify Help: Managing custom pixels
- Shopify Developers: Standard events
- Google Tag Platform: Shopify event parameters
- Shopify Help: Upgrading thank-you and order-status pages
- Shopify Help: Google Tag Manager tutorial
- Shopify Developers: Emitting data
- Shopify Developers: Pixel privacy
- Shopify Help: Testing custom pixels
- Google Analytics: Measuring e-commerce
