Skip to content
🚀 Find us on Product Hunt

Google Analytics 4 Tracking Setup for BigCommerce

Quick answer: Use the free container builder wizard to select Google Analytics 4 and your events, enter your tracking ID, then import the generated file into Google Tag Manager - no manual tag setup needed for any of the 23 events below.

GA4 configuration and ecommerce event tracking via a native Google tag. This container uses a native GTM tag type for this platform.

Build my Google Analytics 4 container →

Events you can track

ecommerce events

engagement events

By Humayun Kabir Naim — Last updated: 8 November 2026

Quick answer

To track a BigCommerce store in GA4 through Google Tag Manager, install GTM on every page through Script Manager, turn BigCommerce's native GA4 connection off so it cannot double-send, and give GTM a GA4-format data layer: a data layer app or Script Manager pushes fire view_item, add_to_cart and begin_checkout while the shopper browses, and a script on the order confirmation page — the one place BigCommerce exposes the completed order — pushes purchase with the order ID, value and items. One GA4 event tag in GTM reads the pushed ecommerce object, and the same layer later feeds Meta, Google Ads and every other tag, so nothing is ever installed twice.

What gets tracked

Ten ecommerce events carry the funnel; the container also covers the engagement events (search, login, clicks, scroll) listed on this page.

Shopper actionGA4 eventWhere its data comes from
Product list or category viewedview_item_listdataLayer push on category / search / list pages
Product page viewedview_itemdataLayer push on the product page
Product added to cartadd_to_cartdataLayer push on the add-to-cart action
Product removed from cartremove_from_cartdataLayer push on the cart page
Checkout startedbegin_checkoutdataLayer push when checkout opens
Shipping details enteredadd_shipping_infopush from the checkout — coverage depends on checkout setup (see below)
Payment details enteredadd_payment_infopush from the checkout — coverage depends on checkout setup (see below)
Order completedpurchaseScript on the order confirmation page, with transaction_id, value, currency, items
Order refundedrefundManual or server-side send from the admin / orders data — refunds happen off-site, so no page push exists
Coupon used at checkoutapply_coupon (custom event)Checkout / confirmation push carrying the coupon code

Two BigCommerce realities shape this table. The checkout is separate: BigCommerce's Optimized One-Page Checkout often runs on its own checkout domain, so a container installed on the storefront does not automatically cover it — the mid-checkout events (add_shipping_info, add_payment_info) are the ones that go missing when coverage is incomplete, while purchase survives because the confirmation page is yours to script. The events are not automatic: unlike some platforms, BigCommerce does not push a GA4-format data layer by default — the pushes above are a job of their own, covered in Step 2.

Deep dives: View Item, Add to Cart, Begin Checkout, Purchase, Refund. Running ads too? The same purchase push feeds the BigCommerce + Google Ads hub and the BigCommerce + Meta hub. See all options on the BigCommerce hub.

Before you start

  1. A GA4 property and its Measurement ID (G-XXXXXXXXXX). One property for the store; if an old Universal Analytics property is still connected anywhere, retire it — its events are not GA4 events.
  2. One sender only — decide before you install anything. BigCommerce has a native GA4 connection (Settings → Data Solutions) that sends pageviews and ecommerce events by itself. If GTM will run GA4, the native connection must be off: both live means every pageview and purchase arrives twice, and the duplication looks like growth until someone reconciles GA4 revenue against the order export. Also check the legacy Affiliate Conversion Tracking field — old conversion code left there fires on the confirmation page alongside your new setup.
  3. A GTM account and a web container for the store. One container across the whole store — and if you run multiple storefronts (channels), each channel has its own Script Manager, so the container goes on every channel that takes traffic or orders. A channel without it is invisible: it sells, and GA4 never sees it.
  4. Script Manager permission on your BigCommerce user account — both the GTM install and the confirmation-page script go through it (Storefront → Script Manager).
BigCommerce native GA4 connection in Data Solutions switched off to prevent duplicates

Route 1: Use the free TagManagerBuilder container

Open the GTM Container Builder, choose BigCommerce, then Google Analytics 4, and tick the events you want. Enter your Measurement ID, download the JSON, then in GTM go to Admin → Import Container and choose Merge → Overwrite conflicting tags, triggers, and variables. The container listens for the dataLayer pushes in Step 2 — install GTM and the pushes (Route 2, Steps 1–2) either way, then test with the testing section below before publishing.

Route 2: Build it manually in GTM

Step 1 — Install GTM through Script Manager

In the BigCommerce control panel: Storefront → Script Manager → Create a Script. Name it (for example "GTM — container"), set Location: Head, Pages: All pages, Script type: Script, and paste the GTM container snippet with your container ID. Save. Then handle the checkout honestly: BigCommerce's checkout may live on a separate checkout domain or a store subdomain depending on your setup. Open your own store, start a checkout, and check in GTM Preview whether the container loads there. If it does not, your mid-checkout events will have a coverage gap — purchase still works through Step 3, and the troubleshooting section shows how to recognise the gap. Multi-storefront stores: repeat this install in every channel's Script Manager.

Installing the GTM container through BigCommerce Script Manager

Step 2 — Give the store a data layer

GTM can only forward what the store pushes, and BigCommerce does not push GA4-format ecommerce events by default. Pick the route that fits your store:

Whichever route: the push format is GA4's. Clear the previous ecommerce object before each new one, so items from one event never leak into the next:

dataLayer.push({ ecommerce: null });
dataLayer.push({
  event: 'add_to_cart',
  ecommerce: {
    currency: 'USD',
    value: 129.99,
    items: [{ item_id: 'SKU-123', item_name: 'Trail Running Shoes', price: 129.99, quantity: 1 }]
  }
});

Step 3 — The purchase push, on the order confirmation page

The confirmation page is the only place the completed order exists in the browser, so it is the only correct place to fire purchase. Create a second script in Script Manager scoped to the Order Confirmation page only, and push the full GA4 purchase — order ID, value, tax, shipping and the items array. BigCommerce's confirmation tooling exposes order placeholders such as %%ORDER_ID%% and %%ORDER_AMOUNT%%; a fuller script reads the order's line items as well:

dataLayer.push({ ecommerce: null });
dataLayer.push({
  event: 'purchase',
  ecommerce: {
    transaction_id: '1042',
    value: 149.99,
    tax: 12.00,
    shipping: 8.00,
    currency: 'USD',
    items: [
      { item_id: 'SKU-123', item_name: 'Trail Running Shoes', price: 129.99, quantity: 1 }
    ]
  }
});

Never fire purchase from the checkout page or a generic "thank-you" guess: checkout fires for people who abandon, and a purchase without a real transaction_id cannot be deduplicated when the shopper refreshes or revisits the confirmation page — a known BigCommerce duplicate, covered in troubleshooting.

Purchase data layer push on the BigCommerce order confirmation page in GTM Preview

Step 4 — The GA4 tags and trigger

Back in GTM:

  1. Google tag: Tags → New → Google tag, your Measurement ID, trigger All Pages. This loads GA4 and sends page_view.
  2. Variables: Variables → User-Defined Variables → New → Data Layer Variable for ecommerce pieces you need outside the event tag (ecommerce.value, ecommerce.currency, ecommerce.transaction_id) — mainly for feeding other platforms later.
  3. One GA4 event tag for the whole funnel: Tags → New → GA4 Event, Measurement ID, Event Name = the built-in {{Event}} variable, then under More Settings → Ecommerce tick Send Ecommerce data and choose Data Layer as the source. The tag forwards whatever the push named — view_item, add_to_cart, purchase — with the ecommerce object attached, so one tag serves every event instead of one tag per event.
  4. Trigger: one Custom Event trigger with regex matching enabled, listing the events you push:
view_item_list|view_item|add_to_cart|remove_from_cart|begin_checkout|add_shipping_info|add_payment_info|purchase

Keep Enhanced Measurement's duplicate-prone extras in mind in GA4 itself: if your data layer already pushes view_item and search events, you do not need GA4's own approximations of them.

GA4 Google tag in GTM on the All Pages trigger for a BigCommerce store GA4 event tag sending ecommerce data from the data layer Regex Custom Event trigger matching all BigCommerce ecommerce events

Test it: Preview and DebugView

  1. Click Preview in GTM and open the storefront in Tag Assistant. Browse a category, open a product, add it to the cart — the GA4 event tag should fire on each push with the right items.
  2. Start checkout and note honestly which steps you can see in Preview. If the checkout sits outside the container's coverage, begin_checkout may be the last checkout event before purchase — record that gap instead of discovering it in reports later.
  3. Complete a test order (a test payment or a 100%-off coupon) and land on the confirmation page: the purchase push and tag fire once, with transaction_id, value and the items array.
  4. Open the same confirmation page again from your order email. Purchase must not count a second time in DebugView.
  5. In GA4 DebugView, watch the same session: every event arrives with its parameters, and purchase shows items, value and currency — not "(not set)".
  6. Submit the GTM container only after the funnel above is clean end to end.
Add to cart firing the GA4 event tag in GTM Preview Purchase event with full parameters in GA4 DebugView Ecommerce purchases report in GA4 with product revenue for the BigCommerce store

BigCommerce-specific troubleshooting

Every event — and revenue — is roughly double. The native GA4 connection in Data Solutions is still on alongside GTM, or an old gtag.js script is still sitting in Script Manager. One sender survives: turn the native connection off and remove stray scripts, then confirm in DebugView that each event arrives once.

begin_checkout fires but the shipping and payment steps never appear. The checkout runs outside your container's coverage — usually the separate checkout domain. Either the checkout needs the container too (BigCommerce's checkout script options, or your checkout provider's settings), or you accept begin_checkout → purchase as your funnel and stop expecting the middle steps. What you cannot do is fix it from the storefront's Script Manager alone.

Purchase fires twice for one order. The shopper re-opened the confirmation page (order email link, browser history), or both the confirmation script and another tool (an app, the Affiliate Conversion Tracking field) pushed it. The push must run once per order — guard it by transaction_id, keep exactly one purchase source, and empty the legacy Affiliate field if it still holds code.

Purchase arrives with no items, or revenue but no products. The confirmation script sent only the placeholders (order ID and amount) without the items array, or fired before the order data was available on the page. GA4 then shows revenue with "(not set)" products — the fix is in the script's data, not in GTM.

The storefront tracks perfectly; orders from a second storefront never appear. Script Manager is per-channel. The second channel (regional storefront, B2B portal) has no container and no pushes. Install per channel, and keep a list of which channels carry which container version — this gap stays silent for months because the main store's data looks healthy.

Events fire in Preview but GA4 reports stay empty. The Google tag and the event tag must carry the same Measurement ID, and the container actually installed via Script Manager must be the one you published — a published workspace that never reached the store changes nothing. Also give standard reports their processing time and judge the setup in DebugView and Realtime first.

Next steps: the same data layer feeds ads with no new pushes — the BigCommerce + Google Ads hub and the BigCommerce + Meta hub build on it, and Consent Mode v2 keeps the whole layer consent-aware.

Frequently asked questions

Should I use BigCommerce's native GA4 connection or GTM?

One or the other for GA4 itself — never both, because both send the same pageviews and purchases. The native connection is faster to switch on; GTM wins the moment you also run Google Ads, Meta or TikTok, need custom events, or want one data layer feeding everything. Most stores that start native end up migrating to GTM and fighting the duplicates from the overlap period.

Does BigCommerce push a data layer automatically?

Not in GA4's format, no. The native connection sends its own events its own way, invisible to your GTM container. For GTM you need pushes: a data layer app maintains them for you, or Script Manager scripts push them page by page — plus the separate order-confirmation script for purchase either way.

Why is purchase set up separately from the other events?

Because the order only exists in one place: the confirmation page after payment. Product and cart data live on their pages while the shopper browses; the completed order — ID, totals, final items — exists only once checkout finishes. One script, scoped to that page alone, is what keeps purchase accurate and singular.

Will GTM cover my checkout?

Partly, and it depends on your checkout setup. BigCommerce's Optimized One-Page Checkout commonly runs apart from the storefront, so mid-checkout steps can sit outside a Script Manager install. Test in Preview with a real checkout session before assuming — begin_checkout and purchase are achievable in every setup; add_shipping_info and add_payment_info are the ones that may need checkout-side work.

I run two BigCommerce storefronts. Does one container cover both?

The container can be the same, but the install cannot: Script Manager belongs to each channel, so the snippet and the data layer pushes go onto every storefront separately. Keep both channels on the same container version, or the same event will behave differently per store.

Can this data layer also feed Meta and Google Ads?

Yes — that is the point of building it once. The purchase push that feeds GA4 carries the order ID and value that the Google Ads conversion tag and the Meta Purchase event both need. Build those from the ads hubs linked above; never install a second, platform-specific purchase script on the confirmation page.

Share with