Guide · Tracking and data
Ecommerce ad tracking: the complete guide for Meta, Google and TikTok
How ad tracking works for a webshop: pixels, server events, Meta, TikTok and Google Ads setup, why numbers differ from your shop, and how to fix it.
- Ecommerce ad tracking tells each ad platform which clicks led to which orders, so it can report results and bid on the shoppers who buy.
- A browser pixel alone misses orders: ad blockers, privacy settings, consent and closed tabs stop it. Send the paid order from your server as well, with the same event id.
- Meta, TikTok and Google Ads each need their own pixel or tag and their own server connection; Google Tag Manager or an app can place them for you.
- When the platform reports fewer orders than your shop, check for missing events, duplicates, wrong values and consent loss, in that order.
- Tracking is never finished: compare platform orders with shop orders every week and check failed server events.
Every ad platform learns from the orders you report back to it. Meta, Google Ads and TikTok use those reports twice: to show you which campaigns worked, and to decide whom to show your ads to next. When orders go missing, the reports undercount and the bidding learns from a smaller, skewed sample of your buyers.
This guide explains how ecommerce ad tracking works, how to set up conversion tracking for Meta, TikTok and Google Ads, which numbers to watch, why the platforms rarely agree with your shop, and how to find and fix the gaps. Each platform has its own detailed guide on this site; this one shows how the pieces fit together.
What ecommerce ad tracking is
Ad tracking connects two events that happen in different places: a click on an ad, and an order in your shop. The ad platform knows about the click. Your shop knows about the order. Tracking passes the order back to the platform with enough information to match it to the click.
Two kinds of tools carry the order back:
- Conversion pixels (the Meta pixel, the TikTok pixel, the Google tag) are scripts that run in the shopper's browser. They read the platform's cookies and send events such as page views, adds to cart and purchases.
- Server-side connections (Meta's Conversions API, TikTok's Events API, Google Ads' offline and enhanced conversions) send the same events from a server. They do not depend on the shopper's browser, so they still arrive when a pixel is blocked. Our explainer on server-side tracking covers the idea.
How a conversion pixel works
A conversion pixel is a small script from the ad platform. Once it is on your pages, it does three things:
- It identifies the visitor
On the first visit it sets a browser cookie (for Meta, _fbp; for Google Ads, _gcl_aw when the visitor came from an ad) and keeps the click id from the landing page.
- It records events
Standard events describe what the shopper did: a page view, a product view, an add to cart, a started checkout, a purchase. Each event can carry a value, a currency, product ids and an order id.
- It sends them to the platform
The platform matches each event to a person or a click, counts conversions for your campaigns, and builds audiences such as "viewed a product in the last 14 days".
The purchase is the event that matters most, because campaigns optimise towards it and ROAS is calculated from its value. The other events help the platform learn earlier in the funnel and feed remarketing audiences.
The numbers ad tracking feeds
Ad tracking is not a goal in itself. It exists so that you can read these numbers and act on them:
| Number | What it tells you | What it needs from tracking |
|---|---|---|
| Conversions (purchases) | How many orders the platform credits to its ads | Every paid order, once |
| Conversion value and ROAS | Revenue per euro of ad spend | The right value per order, in the right currency, without tax and shipping if you choose so |
| Cost per acquisition (CPA) | What one order costs in ads | The same complete order count |
| New customer share | Whether ads bring new buyers or reach existing ones | A new or returning flag per order |
| Add-to-cart and checkout rates | Where shoppers drop out after the click | Funnel events with the same visitor id |
| Profit per campaign (POAS) | Whether the orders made money after costs | Order ids that can be joined to costs |
Swipe the table sideways to see every column.
For the definitions, see ROAS, CPA and POAS.
Setting up conversion tracking on each platform
The order of work is the same everywhere: create the pixel or tag in the ad platform, install it on the shop, send the standard events with the right parameters, add a server connection, and test. The details differ per platform.
Meta (Facebook and Instagram)
In Meta Events Manager, create a dataset (Meta's newer name for a pixel) and note its id. On Shopify, the Facebook & Instagram app can install the pixel and, at its higher data sharing levels, the Conversions API. A tracking app or your own server can send the Conversions API instead. Verify your domain in Business Manager, then test with the Test events tab. The full walk-through is in Meta pixel and Conversions API on Shopify.
TikTok
In TikTok Ads Manager, open Events and create a web pixel. TikTok's Shopify app can install it, or you can add the base code to your theme or through Google Tag Manager. Send ViewContent, AddToCart, InitiateCheckout and CompletePayment (TikTok's purchase event), and connect the Events API so purchases also arrive from a server. TikTok's Pixel Helper browser extension shows which events fire. Our post on the TikTok Events API on Shopify covers the server side.
Google Ads
In Google Ads, create a purchase conversion action under Goals › Conversions, choose to count every conversion, and use the order value. Install the Google tag on all pages and fire the conversion event with the order id and value on the order confirmation. On Shopify, the Google & YouTube app sets this up for you; a tracking app or Google Tag Manager are the alternatives. Turn on enhanced conversions so hashed customer details help match orders. Details are in Google Ads conversion tracking on Shopify.
Through Google Tag Manager
Google Tag Manager (GTM) is a container that loads other tags. Instead of pasting each pixel into the theme, you add GTM once and configure the Meta, TikTok and Google tags inside it, triggered by events that your shop pushes into a data layer. It keeps tags in one place, but it needs a data layer with the right values, and on Shopify's checkout it runs inside a sandbox with limits. See Google Tag Manager on Shopify.
Why the platforms report different numbers from your shop
Almost every store sees the ad platforms disagree with the shop. Some of the difference is normal: the platforms attribute an order to the ad within their own window (Meta by default within 7 days of a click or 1 day of a view), they count by click date or impression date, and they credit the same order to more than one platform. Our post on why Ads Manager and Shopify disagree explains the attribution side.
The rest is tracking loss or tracking error. The worked example shows how to tell them apart.
The fictional store compares shop orders with what each platform received, before any attribution.
| Paid orders in the shop | 400 |
|---|---|
| Orders from visitors who clicked a Meta ad | 150 |
| Purchase events Meta received (browser pixel only) | 108 |
| Share of Meta-clicked orders Meta saw | 72% |
| Purchase events Meta received after adding server events | 147 |
| Share Meta saw with server events | 98% |
How to fix common tracking issues, step by step
- Count orders on both sides
Take one week. Count paid orders in your shop and purchase events received in each platform's event overview (not the attributed conversions in campaign reports). The gap per platform is your starting point.
- Look for duplicates first
If a platform receives more purchases than you had orders, the pixel is installed twice or the browser and server events do not share an event id. Fix this before anything else, or every later number is inflated.
- Check the values
Compare the value of a few test orders with what the platform received: currency, tax, shipping and discounts. A wrong currency or a value in cents breaks ROAS even when the count is right.
- Find the missing events
Test a full order with an ad blocker on, in Safari, and with marketing cookies declined. The orders that disappear show which route is failing.
- Add the server route
Send each paid order from the server with the same event id as the browser event. This recovers orders the browser missed without counting them twice.
- Improve matching
Pass hashed email and phone, the click id, IP address and user agent with each server event, so the platform can tie it to the click.
Common setup mistakes
These mistakes come up again and again, on Google Ads more than anywhere else:
- Two purchase actions both set as primary. Google Ads counts both, so each order shows twice in the Conversions column and Smart Bidding chases inflated numbers. Keep one primary purchase action; set others as secondary.
- Counting "one" instead of "every". For purchases, every order is a conversion. "One" is for leads.
- A fixed value or no value. Without the real order value, Target ROAS has nothing to aim at.
- GA4 conversions imported next to the Google Ads tag. Importing GA4 purchases as primary alongside the tag doubles the count. Use one as primary.
- No order id. The transaction id lets Google drop a duplicate when the thank-you page is reloaded.
- Purchase fired on page load of the thank-you page only. Shoppers who close the tab before it loads are lost. The server route covers them.
- Old code left behind. Pixel snippets in the theme or in Shopify's old additional scripts keep firing next to the new setup.
- Test orders left in. Test orders and staff orders inflate conversions; exclude them or delete them from the platform where it allows.
Our post on Google Ads conversion tracking problems goes deeper into the Google side, and multiple Meta pixels on Shopify into the Meta side.
What reliable ad tracking needs beyond the pixel
A pixel on every page is the starting point. A setup that holds up under ad blockers, Safari's cookie limits and consent banners adds these parts:
| Part | What it solves | How |
|---|---|---|
| Server events | Orders the browser never reports | Send the paid order from the shop's order data to each platform's server API |
| One event id per order | Double counting between browser and server | Both copies of a purchase carry the same id, for example order- plus the order id |
| First-party click capture | Click ids lost when third-party scripts are blocked | Read fbclid, gclid and ttclid on your own domain and store them with the visitor |
| Click id on the order | Orders that cannot be tied to a visit | Save the visitor id and click ids on the cart, so they arrive with the order |
| Hashed customer details | Low match rates | Normalise and SHA-256 hash email, phone and address before sending |
| Consent handling | Tracking people who said no, or losing everyone | Read the visitor's choice and send only what it allows |
| Monitoring | Tracking that breaks silently | Compare platform events with shop orders daily and log every failed send |
Swipe the table sideways to see every column.
Our guides to server-side tracking on Shopify, duplicate purchase events and Consent Mode v2 cover these parts in depth.
Data layers, GTM containers and validation
Many tracking setups on Shopify are built around three tools. It helps to know what each does, whichever route you take.
- A data layer is a JavaScript list,
window.dataLayer, into which the shop pushes structured events: "product viewed, id 123, price 40". Tags read from it instead of scraping the page. A good data layer is accurate on add to cart and remove from cart, carries product, variant and price data, and runs without slowing the page. See the Shopify data layer. - A GTM container holds the tags, triggers and variables for each platform. Prepared containers save setup time, but every tag in them is one more script on your pages and one more thing to keep current when a platform changes its events.
- Validation checks that events arrive: in the browser with each platform's helper extension, in the platform's test views, and over time by comparing the platform's event counts with your orders. Automated checks catch the breaks that a one-off test misses.
Troubleshooting pixel issues
When a pixel misbehaves, find the symptom in the table, then confirm the cause with the platform's own tool: Meta Pixel Helper and Test events, TikTok Pixel Helper and Test events, Google Tag Assistant and the Google Ads conversion diagnostics.
| Symptom | Likely cause | Fix |
|---|---|---|
| No events at all | Pixel not installed, wrong id, or blocked until consent | Check the id in the page source or the helper extension; test with consent given |
| Purchases but no page views | Pixel only on the thank-you page | Load the base code on every page |
| Twice as many purchases as orders | Two senders for the same pixel, or no shared event id | Remove one sender; give browser and server the same event id |
| Purchases without value | Value parameter missing or sent as text | Send value as a number and a three-letter currency code |
| Events arrive, but campaigns show few conversions | Low match rate or events outside the attribution window | Add hashed email and phone, click ids, IP address and user agent |
| Pixel shows events in a test, none in production | A test code left in, or a test version of the tag published | Remove the test code and publish the live version |
| Sudden drop on one date | Theme change, new checkout, app removed, expired token | Check what changed that day; renew the server token |
Swipe the table sideways to see every column.
Keep checking after setup
Tracking breaks without warning: a theme update removes a snippet, an access token expires, a new app adds a second pixel, a consent banner starts blocking everything. Put three checks in your week:
- Purchase events received per platform against paid orders in the shop, for the same days.
- Failed or rejected server events, with the platform's error message.
- Event match quality (Meta) or enhanced conversions coverage (Google Ads), against last month.
- Before a big sale, a full test order on each platform. Our BFCM tracking checklist lists what to check.
The free tracking audit checks a store's pages for the pixels and tags it loads.
How ad tracking works in ROASaurus
ROASaurus sends each paid order server-side to 16 ad platforms, including Meta, Google Ads and TikTok, from the shop's order data. On Shopify, installing the ROASaurus Shopify app registers the order webhooks and the checkout pixel; the storefront script captures click ids and UTM tags first-party, through the Shopify app proxy on your own domain, and writes the visitor id to the cart so it arrives with the order. Browser pixels are optional and share one event id with the server events (order- plus the order id for a purchase), so each platform keeps one copy. The server sends the purchase 20 seconds after payment.
Connections › Tracking & destinations- Install the tracking: on Shopify, install the ROASaurus Shopify app; on other shops, paste the script and connect the order webhook.
- Add a destination per ad platform: for Meta, connect with Facebook or paste the dataset id and a Conversions API token; for Google Ads, the conversion id and purchase label; for TikTok, the pixel code and an Events API token.
- Tick "Also load the browser pixel" where you want the pixel next to the server events; both share one event id.
- Open Data quality › Overview to see, per platform, how many orders were expected and accepted, the match keys sent and Meta's event match quality.
- Open Data quality › Deliveries to see each server event with its status (queued, sent, skipped, failed), the reason and the platform's answer; failed events can be sent again.

ROASaurus is in production use for Meta and Google Ads today. The other destinations are built from each platform's documentation and have not carried a customer's traffic yet.
Start freeOpen the live demo14-day trial of every feature, no credit card.

Sources
- Meta for Developers: Conversions API
- Meta for Developers: Handling duplicate pixel and Conversions API events
- Google Ads Help: Set up conversion tracking with the Google & YouTube app on Shopify
- Google Ads Help: About enhanced conversions
- Google Ads Help: About primary and secondary conversion actions
- TikTok Business Help: About Events API
- Shopify Dev: Web pixels API standard events
Related pages
- Meta pixel and Conversions API on Shopify
- Google Ads conversion tracking on Shopify
- Google Tag Manager on Shopify
- Google Ads dynamic remarketing
- Google Ads conversion tracking problems
- BFCM tracking checklist
- Klaviyo tracking on Shopify
- Multiple Meta pixels on Shopify
- Ads Manager vs Shopify sales
- Server-side tracking
- Server-side tracking in ROASaurus
- Tracking audit