Skip to content
BonicBD
← All articles

Server-Side Tracking for Shopify in Bangladesh (2026 Setup)

By Rubel Hasan Rokib · 2026-09-22 · Updated 2026-11-23 · 12 min read

Rubel Hasan Rokib — Web analytics consultant. Dhaka-based web analytics consultant working on conversion tracking for Bangladesh ecommerce. Writes the GTM and conversion-API guides on this blog.

Set up first-party server-side tracking on Shopify: Meta CAPI, GA4, click-ID capture, and how to check that events actually arrive.

Server-Side Tracking for Shopify in Bangladesh (2026 Setup)

Shopify is the most common storefront among Bangladesh brands running paid traffic, and it is also the one with the most fixed constraints on where you can put tracking code. That combination is why Shopify server-side tracking goes wrong in predictable ways.

What Shopify actually lets you control

Three surfaces, and the limits differ:

  • Theme — the storefront. You control the HTML, so theme-level script tags work.
  • Checkout — Shopify Plus gets checkout.liquid; other plans get the new extensibility surfaces. A stock Basic or Shopify plan cannot add arbitrary script to the checkout step.
  • Web pixels — a sandboxed app surface that can subscribe to customer events and emit them, without direct DOM access.

Most of the confusion comes from treating these as one surface. They are not.

Why the purchase event is the hard part

On a normal store, a thank-you page load is a purchase signal. On Shopify that page exists, but the checkout step around it is closed to custom code, and on a COD store the customer may never see it at all.

So there are exactly two viable purchase paths:

  1. Web pixel app subscription — fire from the checkout-completed event. Works on any plan. Delivers from the browser, so ad-blockers and ITP still apply.
  2. Order webhook — Shopify posts orders/paid or an order-status change to your endpoint, and your server sends the purchase. Not affected by browser restrictions, and it is the only path that survives a COD confirmation gap.

For a prepaid store, path 1 is fine. For a COD store, path 2 is the correct one — a purchase fired at checkout counts an order that may never ship.

The setup, in order

1. Create the container and point one CNAME

Sign up, pick a plan, paste your Google Tag Manager server container configuration. Then add a CNAME for the tracking subdomain at your DNS provider pointing at connect.bonicbd.com. Certificate issues automatically once it resolves.

2. Add the theme snippets

theme.liquid, inside <head>: the GTM loader pointed at your subdomain, and the tracker script. Both must load before any other analytics tag, or your click-ID capture runs after the URL has already been rewritten.

3. Verify capture before anything else

Click a real ad, land on the store, and check that fbclid was captured. Doing this before configuring destinations saves an afternoon of debugging a problem that is not there.

4. Configure destinations in the container

Meta Conversions API, GA4 Measurement Protocol, TikTok Events API — whichever you run. Tags and credentials live in your container, not in the theme.

5. Wire the purchase

Prepaid: subscribe the web pixel to checkout completion. COD: point an order webhook at your container and fire from the confirmation.

6. Deduplicate

If both paths can fire, they must share an event_id. For COD, the cleaner answer is to let only one path fire at all.

What Shopify will fight you on

  • checkout.liquid is Plus-only. Do not plan around it on another plan.
  • The web pixel sandbox has no DOM access. You cannot read a form field from it.
  • Consent API interacts with web pixels. A pixel that ignores the customer privacy settings will silently receive nothing.
  • Theme apps rewrite URLs. A currency or redirect app that strips query parameters will break click-ID capture, and it will look like a tracking bug.

Verifying it end to end

  1. Place a real order with a value you can recognise
  2. Confirm the order in Shopify admin
  3. Check the container log for the dispatched event and its identifier
  4. Check Events Manager for exactly one purchase
  5. Compare against your Shopify order list — that comparison is the only honest measure

What the theme change actually breaks

A Shopify theme replacement is the single most common cause of a store going silently dark. The snippets live in theme.liquid; a new theme does not carry them.

What makes it dangerous is that nothing visibly fails. The store still loads, orders still arrive, Shopify admin still shows everything. Only the tracking is gone, and you discover it a week later when the ad platform reports a conversion collapse.

Two habits prevent it:

  • after every theme publish, load the storefront and confirm the tracker script is in the page source
  • put the change in a checklist that runs before the theme goes live, not after

What the web pixel sandbox can and cannot do

The sandbox is deliberately limited, and knowing the limits saves a day of confusion:

Can: subscribe to standard customer events (page viewed, product viewed, cart viewed, checkout started, checkout completed, payment info submitted), read the event payload, emit a custom event to an allowed destination.

Cannot: read the DOM, access form field values, run arbitrary network calls to uncatalogued endpoints, or persist data the sandbox does not expose.

So a click identifier cannot be scraped from inside the sandbox — it has to be captured by your theme-level tracker on the landing page, before checkout. That is a design constraint, not a limitation of any one vendor.

Migration order from a browser-only setup

If you are currently running only the Meta pixel on Shopify:

  1. Install the theme snippets and verify click-ID capture on a real ad click
  2. Add the container and configure the Meta destination
  3. Turn on server purchase from the order webhook
  4. Keep the browser pixel's non-purchase events — PageView, ViewContent, AddToCart still belong in the browser
  5. Retire the browser purchase only after one clean test order shows a single event in Events Manager

Doing steps 3 and 5 out of order is where double-counting appears.

Measuring whether it worked

Three numbers, tracked weekly against a pre-migration baseline:

  • Meta-reported purchases vs Shopify orders — the gap should narrow, not vanish
  • matched event share — should rise as click IDs start surviving
  • reported ROAS — worth watching, but it moves for reasons unrelated to tracking

The gap narrowing is the honest signal. A gap that closes to zero usually means you are now under-reporting rather than over-reporting.

Cost of doing nothing

Worth stating plainly, because "we will fix tracking later" is the default. A store losing a third of its purchase signal is not saving money by waiting: the ad platform keeps optimising on incomplete data, which means it keeps buying traffic that resembles the wrong customer. The spend continues, the learning degrades.

Frequently asked questions

Does server-side tracking work on the Shopify Basic plan?

Yes. The tracking subdomain and storefront snippets work on every plan — the purchase event simply travels via order webhooks instead of checkout code.

Will this double-count purchases?

Not when deduplication is configured — browser and server events share the same event_id, so Meta merges them into one conversion.

Does it work for COD orders?

Yes — this is exactly where server-side wins, since the event fires from your confirmation step rather than a thank-you page the customer may never load.

Can I test on a development store first?

Yes. A Shopify development store and a trial container cover the whole path without touching a live catalogue.

How much does it cost?

BonicBD plans start at ৳1,000/month with every module included — Cookie Keeper, Click ID Restorer, Meta CAPI routing, and the conversion ledger. Pay via bKash, Nagad, or bank transfer.

What breaks when I change theme?

The snippets live in theme.liquid. A theme replacement removes them. Re-add and re-verify after any theme change — this is the single most common cause of a store going dark silently.


Practical next steps: COD order tracking · how the event path works · plans in BDT

Need help applying this article?

Compare the BonicBD feature set, review the setup guide, or contact the team if you want help with a live server-side GTM rollout.

Apply What You Just Read

Get a free tracking audit to see what your current setup is missing — or start a trial and test BonicBD on your own domain.