Skip to content
🚀 Find us on Product Hunt

GTM Tracking Setup for BigCommerce

Configure GA4, Google Ads, Meta, TikTok and more for BigCommerce and generate a ready-to-import Google Tag Manager container.

Quick answer

To track a BigCommerce store with Google Tag Manager, install a GTM web container through BigCommerce's Script Manager (head snippet on All Pages, noscript in the Footer), then build tags around the store's ecommerce events: product views, add-to-cart, checkout steps and purchases, plus page views. The part most guides skip is that BigCommerce does not push purchase data into the dataLayer by itself — the order details have to be pushed from the order confirmation page, and the purchase event has to be guarded so a customer who reloads the confirmation page is not counted twice. The recipes on this page generate a container that does the GTM half for you: the Google tag plus GA4, Google Ads and Meta event tags, triggers and variables for those events, using the real IDs you type in. A BigCommerce setup built this way (GA4 + Google Ads + Meta, all 23 events) generates 37 tags, 23 triggers and 6 variables.

How BigCommerce tracking works — and why purchases go missing

BigCommerce is a hosted ecommerce platform with Stencil themes, and its tracking has one awkward truth at the centre: the platform gives you the storefront, the checkout and the order confirmation page, but it does not hand GTM a ready-made ecommerce dataLayer. Google Tag Manager does not track anything on its own. It is a delivery system: it loads tags (GA4, Google Ads, Meta Pixel and the rest) and decides when each one fires, based on triggers that listen to the dataLayer. The dataLayer is a small JavaScript object on the page that describes what just happened — which product was viewed, what was added to the cart, which order was just placed.

On a BigCommerce store that chain has four links, and the third one is where most setups break:

  1. The container loads. GTM is installed through Script Manager, so it loads on every storefront page and on the order confirmation page. The checkout itself is hosted on a separate domain, so Script Manager snippets do not run there — which is why the purchase is tracked on the confirmation page that follows checkout, not inside checkout.
  2. The page describes what happened. A product page, the cart page and the order confirmation page each need a dataLayer push carrying the real values — item ID, SKU, name, price, currency, order ID, order total, tax, shipping and line items. BigCommerce does not do this by default; the values come from the Stencil template (or, on newer headless builds, the Catalyst framework's dataLayer) and have to be pushed deliberately.
  3. GTM listens with triggers. A trigger fires when the dataLayer event name matches — view_item, add_to_cart, begin_checkout, purchase and the rest. A tag fires on that trigger and reads the values from dataLayer variables.
  4. The destination receives it. GA4 DebugView and its Monetization reports, Google Ads conversions, Meta Events Manager — each one confirms the same events from its own side.

If you see page views in GA4 but no purchases, the second link is usually the broken one: nothing ever pushed a purchase event with the order details, so the container has nothing to listen for. Check with GTM Preview mode on the order confirmation page after a test order — if no purchase event appears in the left-hand event list, nothing downstream can work. The second most common version of this failure is the opposite: the purchase fires, but it fires again every time the customer reloads the confirmation page, and your revenue doubles in GA4 while your real orders stay the same. That is covered in the errors table below.

Build your BigCommerce container with TagManagerBuilder

Building the container by hand means creating a Google tag, a GA4 event tag for every ecommerce event, dataLayer variables for the values each event needs, a trigger for each event name, plus the equivalent tags for Google Ads and Meta. It is repetitive work and one mistyped event name silently breaks an event.

The builder on this site generates that container for you:

Step 1. Choose BigCommerce as the platform and pick the tools you actually use — GA4 at minimum, then Google Ads and Meta if you run ads. TikTok, Pinterest, LinkedIn, Microsoft Advertising and X can be added in the same run.

TagManagerBuilder step 1 with BigCommerce selected as the website platform
Step 1 of the builder: BigCommerce selected as the website platform.
TagManagerBuilder step 2 with Google Analytics 4, Google Ads and Meta Pixel selected
Step 2: GA4, Google Ads and Meta Pixel selected — the three tools most BigCommerce stores need first. TikTok, Pinterest, LinkedIn, Microsoft Advertising and X can be added in the same run.

Step 2. Pick the events you want to track. The builder offers 23 for BigCommerce: 15 ecommerce events (page view, view item, view item list, add to cart, remove from cart, begin checkout, add shipping info, add payment info, purchase, refund, add to wishlist, coupon applied, search, login, sign up) and 8 engagement events (form submission, lead, phone click, WhatsApp click, email click, outbound click, scroll, file download). For a standard store setup, select all of them — an unused event costs nothing, and the funnel events are what make the reports useful later. The two names to watch: "Coupon Applied" is the machine event apply_coupon and "Add to Wishlist" is add_to_wishlist.

TagManagerBuilder step 3 showing the 23 BigCommerce tracking events selected
Step 3: the 23 events the builder offers for BigCommerce — 15 ecommerce (page view to sign up) and 8 engagement (form submission to file download), all selected here.

Step 3. Enter your real IDs — your GA4 Measurement ID, Google Ads conversion ID and label, Meta Pixel ID. The builder uses the IDs you type, not placeholders, so the container it generates is ready to import. Google Ads also has an optional Default Conversion Value field (0.00) — used when the dataLayer does not supply its own transaction value.

TagManagerBuilder step 4 with sample tracking IDs entered for GA4, Google Ads and Meta Pixel
Step 4: entering your tracking IDs. Sample IDs are shown here (G-XXXXXXXXXX, AW-000000000, 000000000000000) — the builder uses the real IDs you type, not placeholders.

Step 4. Check the Advanced options. Consent Mode v2, Enhanced Conversions, Debug Mode and Cross-Domain Tracking are off by default, and so is Server-Side Tracking. The one option that is on by default is "Generate Ecommerce DataLayer references", which creates the dataLayer variables the ecommerce tags read. Turn on Cross-Domain Tracking if your store and checkout live on different domains, or a visitor who clicks from one to the other looks like a new session with a lost source. Server-side tracking applies to GA4 only — Meta, TikTok, Pinterest, LinkedIn, Microsoft Advertising and X ship as Custom HTML and need their own server-side setup (for example Meta Conversions API) outside this builder.

TagManagerBuilder step 5 advanced options for a BigCommerce container
Step 5, Advanced: Consent Mode v2, Enhanced Conversions, Debug Mode and Cross-Domain Tracking are off by default in this run; 'Generate Ecommerce DataLayer references' is checked by default. Server-side tracking applies to GA4 only.

Step 5. Review and generate. The Review step shows the 23 machine event names — page_view, view_item, view_item_list, add_to_cart, remove_from_cart, begin_checkout, add_shipping_info, add_payment_info, purchase, refund, add_to_wishlist, apply_coupon, search, login, sign_up, form_submission, lead, phone_click, whatsapp_click, email_click, outbound_click, scroll, file_download — before you generate. A BigCommerce setup with GA4, Google Ads and Meta generates 37 tags, 23 triggers and 6 variables.

TagManagerBuilder step 6 review showing BigCommerce and the 23 event names
Step 6, Review: the builder confirms BigCommerce, the three tools, and the 23 machine event names — page_view through file_download — before generating. Demo details Jane / jane@example.com are shown here.

Step 6. Download the container JSON and import it into GTM (Admin → Import Container). Choose Merge and rename on conflict if the container already has tags; choose Overwrite only on a fresh, empty container.

TagManagerBuilder confirmation that a BigCommerce container with 37 tags, 23 triggers and 6 variables was generated
The generated container for this BigCommerce setup: 37 tags, 23 triggers and 6 variables. Meta Pixel tags are generated as Custom HTML because Meta has no native GTM tag type.

The recipe links below the builder take you to the same setup broken down per tool, so you can check exactly what each generated tag does before you import it.

Installing the container on BigCommerce: Script Manager

The builder gives you the container. Getting its two snippets onto every store page is a separate step, and on BigCommerce there is one clean route: Script Manager. Do not edit theme files for this — Script Manager exists precisely so tracking code survives theme updates.

Step Where What to do
Head snippet Storefront → Script Manager → Create a Script Name it "GTM head". Location on page: Header. Pages: All Pages. Script category: Essential (so a consent banner does not block the container itself — handle consent inside GTM with Consent Mode instead). Script type: Script. Paste the GTM <script> block. Save.
Noscript fallback Script Manager → Create a Script Name it "GTM noscript". Location on page: Footer (BigCommerce does not expose a spot immediately after the opening body tag, so the footer is the practical equivalent). Pages: All Pages. Category: Essential. Type: Script. Paste the GTM <noscript> block. Save.
Order confirmation Same two scripts The "All pages" setting already includes the order confirmation page on modern BigCommerce, so you usually need no separate script for it. Verify with a test order and GTM Preview on the confirmation page.

The consent-category trap: Script Manager asks for a script category, and that category is used by consent banners. If GTM is put in a category that is blocked by default, the whole container fails to load for most visitors and you spend a day wondering why nothing tracks. Set GTM itself to Essential so it loads, and handle consent inside GTM with Consent Mode v2. That is the correct division of labour.

What Script Manager cannot do: the checkout pages are hosted on a separate domain, so the snippets installed through Script Manager do not run inside checkout. That is expected, not a bug — the purchase is tracked on the order confirmation page that follows checkout, where the order details are available. Do not try to force GTM into the hosted checkout; on plans with checkout customisation there are more options, but the confirmation-page purchase is the standard, reliable route.

Tags list in the Tag Manager Builder GTM container showing a Google tag and GA4 event tags
The site's own live GTM container (Tag Manager Builder, GTM-5NF3RF2P): 11 tags, including a Google tag and GA4 event tags. It has no BigCommerce-specific tags — this shows what an imported container's tag list looks like in structure, not a BigCommerce container.
GA4 Configuration tag detail in GTM showing the Google Tag type and All Pages trigger
The Google tag in the site's own container reads its Measurement ID from the {{GA4 - Measurement ID}} constant and fires on All Pages, before the GA4 event tags.

Disconnect the built-in connectors first

Before you install anything, open Advanced Settings → Data Solutions in your BigCommerce control panel and look at what is already connected. BigCommerce ships built-in connectors for Google Analytics, Meta and others, and they are convenient — and they are the cause of most double counting on this platform. If the native GA4 connector is on and you also install GA4 through GTM, you get two GA4 tags on every page and every event counted twice.

Pick one route and stick to it. GTM is the better pick for most stores, because the native connectors give you no control over consent, deduplication or what gets sent. Disconnect anything you are about to rebuild through GTM, then install the container. The same rule applies to any direct gtag.js or Meta Pixel code already on the store: search Script Manager and the theme for gtag.js, fbq( and any older GTM- snippet before adding the new container. A store that has collected tracking snippets over the years almost always has at least one leftover.

Which BigCommerce events matter — and why

A store's events are its money trail. The ones that matter are the ones that prove a visitor moved one step closer to an order, and the ones that let you value that order.

The builder offers 23 events for BigCommerce, split into 15 ecommerce events and 8 engagement events. The table below covers the five that do the commercial work; the full list follows it.

Event Fires when What it tells you Key data
view_item A product page loads Which products get attention — the top of the funnel item id, SKU, name, price, currency
add_to_cart A product is added to the cart Buying intent, and which products convert views into carts items, value, currency
begin_checkout Checkout starts The funnel narrows — and where it leaks if purchase never follows items, value, currency
purchase The order confirmation page loads after a completed order Revenue, the one event every ad platform must optimise on transaction_id, value, currency, tax, shipping, items
page_view Any store page loads Traffic, landing pages, category and search behaviour page location, page title

Two events do most of the commercial work. purchase is the revenue event: it carries the order ID, the total and the line items, so it feeds GA4's Monetization reports and every ad platform's conversion bidding. add_to_cart is the intent event: a cart add is the strongest signal short of an order, and it is the event your retargeting audiences are built from.

begin_checkout deserves a note of its own. On its own it looks like a minor funnel step, but the gap between begin_checkout and purchase is the single most useful diagnostic on a store: if checkouts start and purchases never follow, the problem is in checkout itself — payment, shipping, or the confirmation page — not in your ads. Watch that gap before you change any campaign.

The rest of the builder's ecommerce events fill in the funnel around those five. view_item_list fires when a category or search-results page loads, so you can see which listings get seen; remove_from_cart is the counterweight to add_to_cart and the cleanest signal of price or shipping hesitation; add_shipping_info and add_payment_info mark the two steps inside checkout where buyers most often abandon; refund keeps GA4 revenue honest when an order is returned; add_to_wishlist captures intent that never reaches the cart; apply_coupon shows which promotions actually move buyers; search records what visitors look for on the store; and login and sign_up mark account creation, which is the moment a one-time buyer becomes a repeat customer.

The eight engagement events cover everything that is not a purchase but still matters. form_submission and lead track contact and quote forms; phone_click, whatsapp_click and email_click track the contact actions a store's header and footer exist for; outbound_click shows where visitors leave for; scroll measures how far down product and category pages people actually read; and file_download tracks size guides, catalogues and spec sheets. None of these is a conversion on its own, but together they explain what visitors do when they do not buy — which is most visits.

The dataLayer: what GTM actually reads

Every event above arrives as a dataLayer.push(). This is what a purchase push looks like — the shape the generated container expects:

dataLayer.push({
  event: 'purchase',
  ecommerce: {
    transaction_id: 'BC-10234',
    value: 129.99,
    currency: 'USD',
    tax: 10.40,
    shipping: 8.95,
    items: [
      {
        item_id: 'SKU-4821',
        item_name: 'Trail Running Shoes',
        price: 129.99,
        quantity: 1
      }
    ]
  }
});

The values must come from BigCommerce itself, not from text scraped off the page. Stencil themes use Handlebars templates, so the order confirmation template can print the real order ID, total, tax, shipping, currency and line items into the push. On product pages, push the item ID, SKU, name, category, price and currency; on the cart page, push the full cart contents and total. The generated container reads the same shared variables for every ecommerce event — ecommerce.currency, ecommerce.value, ecommerce.items and ecommerce.transaction_id — so the same values work across GA4, Google Ads and Meta without being mapped three times.

Two rules apply to every push. First, the event name must match the trigger exactly (purchase, not Purchase or order-complete) — triggers are case-sensitive and a mismatch means the tag never fires. Second, values must be plain numbers and strings, not formatted text: 129.99, not "$129.99". A formatted price shows up as undefined in GTM's variable preview and the event arrives with no value.

Where the push goes: create a Script Manager script set to the Order Confirmation page type specifically, so the purchase push only runs after a completed order and never on any other page. Product and cart pushes go on their own page types the same way.

Sending the same purchase to Google Ads and Meta

The same purchase event should feed every ad platform you use — that is the point of routing it through GTM rather than installing each platform's code separately.

Google Ads: add a Google Ads Conversion Tracking tag on the purchase trigger, with the conversion ID and label from your Google Ads account, and read the value and currency from the same dataLayer variables. Add the Conversion Linker tag on All Pages so clicks are attributed. Mark the purchase as a conversion in Google Ads so it feeds bidding. If you collect email or phone at checkout, Enhanced Conversions can match conversions that cookies miss — the values are already in the dataLayer push. Note that getting the user data for guest checkouts takes an extra step: the Stencil customer object carries it for logged-in customers, while guest checkouts need an API request for the cart data (for example a fetch to /api/storefront/order/%%ORDER_ID%% on the confirmation page).

Meta: add the Meta Pixel base code through GTM and a Purchase event on the same purchase trigger, with value, currency and content IDs from the same variables. Check it in Meta Events Manager with Test Events. Meta has no native GTM tag type, so its tags are generated as Custom HTML using the platform's official base code. If you later add server-side tracking, send the same eventID from browser and server so Meta deduplicates the pair instead of counting two purchases — a duplicated purchase is the fastest way to make reported return on ad spend fiction.

TikTok, Pinterest, LinkedIn and the others follow the same pattern in the generated container: one event tag per platform on the same trigger, reading the same dataLayer variables. Adding a platform later means adding its tag, not rebuilding the dataLayer.

Common BigCommerce GTM errors — and how to fix them

Problem What you see Usual cause Fix
Purchases missing in GA4 Page views flow, no purchase in DebugView BigCommerce never pushed the purchase event — no dataLayer push on the confirmation page Add the confirmation-page push (Script Manager, Order Confirmation page type) with transaction_id, value, currency and items; test with a real order in Preview
Purchase counted twice Revenue in GA4 is roughly double real orders Customer reloaded the confirmation page, or the native connector is still on alongside GTM Guard the purchase tag with a localStorage order-ID check (block the tag if the order ID was already recorded); disconnect the Data Solutions connectors
Every event doubled All events, not just purchase, appear twice GTM installed twice, or a direct gtag.js install running next to GTM Load GTM once; remove the direct install and keep the GTM route
Values blank or undefined Events fire but value and items are empty Keys mismatched (case-sensitive) or prices pushed as formatted text ("$129.99") Match the keys exactly (value, currency, items, transaction_id); push plain numbers
Checkout steps missing begin_checkout never fires Trying to track inside the hosted checkout, where Script Manager snippets do not run Track the funnel on the storefront and the purchase on the confirmation page; do not force GTM into hosted checkout
No data after consent changes GA4 goes quiet for EEA traffic GTM placed in a Script Manager category the banner blocks by default Set GTM to Essential and handle consent inside GTM with Consent Mode v2
Meta counts two purchases per order Meta reports double the orders GA4 shows Browser and server both send the purchase without a shared event ID Send the same eventID from both and let Meta deduplicate; check in Events Manager
Import fails "Invalid container" or missing tags on import Wrong file, or merging into a workspace with conflicting names Re-download from the builder, import into a fresh workspace first, then merge with rename on conflict

The double-fire guard is worth a note of its own. The order confirmation page can be reloaded and revisited — customers do it constantly, especially on mobile — and every reload re-fires a plain purchase tag. When the purchase fires, store the order ID in localStorage; on every subsequent load, check whether that order ID has already been recorded and block the tag if it has. Do it in GTM as a blocking trigger exception, so it applies to every purchase tag at once rather than being reimplemented for GA4, Google Ads and Meta separately. The abdulkayium guide's own advice is the same: verify with a test order and five reloads of the confirmation page.

How to test before you publish

  1. GTM Preview mode: connect to the storefront, view a product, add it to the cart, start checkout. Each event should appear in Preview and fire its GA4 event tag. Anything that fires on the wrong trigger is visible here before a single real visitor is affected.
  2. A test order: place a real test order and watch the confirmation page in Preview. The purchase event must appear with the right transaction_id, value, currency and items. Then reload the confirmation page and confirm the purchase tag does not fire a second time.
  3. GA4 DebugView: with Preview running, open DebugView and confirm the test purchase shows the order value and line items. An event without a transaction ID cannot be tied back to the order that sent it.
  4. Meta Test Events and Google Ads: confirm the Purchase event arrives in Events Manager with the right value, and that the Google Ads conversion registers.
  5. Tag Assistant or a tag debugger: confirm googletagmanager.com/gtm.js loads exactly once per page, and that no leftover gtag.js or fbq( snippet is still firing alongside it.
Triggers list in the Tag Manager Builder GTM container
Triggers in the site's own container: one Custom Event trigger per event name, plus All Pages. A BigCommerce container follows the same pattern, with triggers named for the ecommerce events.
Variables list in the Tag Manager Builder GTM container
Variables in the site's own container: Data Layer Variables for the values events carry, plus a GA4 Measurement ID constant. A BigCommerce container adds the variables its events need.

Frequently asked questions

Why are my BigCommerce purchases not showing in GA4?

Work backwards: is GTM installed through Script Manager on All Pages (check in Tag Assistant)? Is a purchase event pushed on the order confirmation page (check in GTM Preview after a test order)? Do the key names match exactly — transaction_id, value, currency, items? And is the native GA4 connector in Data Solutions still on, which would double-count rather than fix anything? If the push is missing, the fix is the confirmation-page script, not a new trigger.

Do I need to edit my Stencil theme to track purchases?

Only to print the order data into the dataLayer push — the values have to come from BigCommerce's own order object, not scraped from the page. The GTM install itself needs no theme edits: Script Manager handles it, and the container import happens in GTM. If editing Handlebars templates is not an option, apps such as Elevar, Littledata or Stape's Conversion Tracking app can push the ecommerce dataLayer for you.

What are the engagement events for on a store?

The builder offers eight engagement events alongside the ecommerce set: form_submission and lead for contact and quote forms, phone_click, whatsapp_click and email_click for the contact actions in the header and footer, outbound_click for links that leave the store, scroll for how far visitors read, and file_download for size guides and catalogues. They are not conversions on their own, but they explain what visitors do on the visits that do not end in an order — which is most visits. If you also run lead forms on a WordPress site, track those with the WordPress recipes and keep the two setups apart.

Can I track BigCommerce purchases as Google Ads conversions?

Yes. Fire a Google Ads Conversion Tracking tag on the purchase trigger and mark it as a conversion in Google Ads, with the value and currency read from the dataLayer. It is the highest-value conversion in the store, so once purchases are flowing it is the action your campaigns should optimise for. Add the email and phone from the checkout for Enhanced Conversions where you can collect them.

Should I use the builder's container or build the tags by hand?

Use the builder for the standard setup: it generates the Google tag, the event tags, the triggers and the variables in one container, with the event names already matched to the standard GA4 ecommerce schema. Build by hand only if you need custom fields or mapping the builder does not cover — and if you do, never run your hand-built tags alongside the generated container, or every event fires twice.

What about server-side tracking for BigCommerce?

The builder's server-side option applies to GA4, since it uses GTM's native tag type. Meta, TikTok, Pinterest, LinkedIn, Microsoft Advertising and X ship as Custom HTML and need their own server-side setup — for Meta that means the Conversions API, usually through a server container, and Stape's BigCommerce app can send purchase and refund webhooks to a server container. Start with the browser setup on this page, verify it, then add server-side as a second step.

Share with