Ecommerce tracking and attribution: how to make your pixel match your sales
Pixel, Conversions API and server-side tracking that match your real sales.

Tracking and attribution guides
Start here

Server-side tracking: what it is and why your pixel misses sales
Browser pixels miss purchases because of ad blockers, short-lived cookies and payments that confirm later. Here's how sending events from your server closes the gap without counting a sale twice.

Meta Conversions API (CAPI): a complete guide for ecommerce stores
The Conversions API sends your store's sales from the server straight to Meta. Here are the ecommerce events, required fields, hashing rules and how deduplication with the pixel works.
Ecommerce tracking is recording what each visitor does in your store (views a product, adds to cart, pays) and sending those events to your ad platforms. Attribution is deciding which ad gets credit for the sale. Both match your sales when the purchase fires on confirmed payment, from the browser and the server, with no duplicates.
This is the pillar guide for the topic on the Horsee blog. It covers the whole problem, from the pixel that misses sales to ROAS calculated on paid orders. The in-depth guides are listed at the end, and each section points to what to read next.
Are tracking and attribution the same thing?
No, and mixing them up explains a lot of the arguments between whoever runs the ads and whoever runs the books.
- Tracking is collection. It's the pixel logging a PageView, the server reporting a Purchase, the ad link carrying a
utm_campaignparameter. Either the event arrived or it didn't. - Attribution is interpretation. Meta received the purchase; now it has to decide whether it came from the ad the person clicked yesterday, the video they watched last week, or neither. Each platform has its own rules, windows and models.
When Ads Manager doesn't match your store, the first question is: is the problem in collection or interpretation? If Meta is receiving fewer purchases than you sold, it's tracking. If it's receiving all of them but crediting itself with sales that came from another channel, it's attribution. The fixes are different.
Why doesn't Ads Manager match your store's sales?
The most common causes, from the most frequent to the most subtle:
- Events lost in the browser. Ad blockers, cleared cookies, a tab closed before the thank-you page loads. The purchase exists in your store and not on the platform.
- Payments that confirm later. Bank transfers and some local methods (Brazil's Pix and boleto, for example) are paid outside your store. If the purchase only fires on the thank-you page, it disappears.
- Purchases counted when the order is created. The opposite problem: the store fires Purchase as soon as an order exists, paid or not. The platform sees more purchases than money you received.
- Duplication. Two tracking apps, or browser and server events with different IDs. Every sale becomes two.
- Window and date. The platform credits the sale to the click date, within a window of days; your store counts by payment date. A Monday campaign can collect sales paid on Thursday.
- View-through sales. Depending on your attribution setting, the platform may credit a sale to someone who only saw the ad. The same sale can show up in Meta and in Google.
- Time zone and currency. An ad account in one time zone and a store in another, or a Purchase sent in the wrong currency.
- Refunds and cancellations. The sale was refunded, but the platform still counts it.
Items 1 to 4 are tracking issues with a technical fix. Items 5 to 8 are about attribution and definitions: they don't go away, but you can measure in parallel with a source you control.
What are the pieces of tracking that works?
| Piece | What it does | Where it breaks |
|---|---|---|
| Browser pixel (Meta, TikTok, Google) | Logs events on the page and reads cookies and the ad click | Blockers, short cookies, pages that don't load |
| Meta Conversions API | Receives events sent from your store's server | Expired token, event ID that differs from the pixel's |
| TikTok Events API | TikTok's equivalent for server-side events | Same as Meta's API |
| GA4 Measurement Protocol | Sends server events to Google Analytics | Missing API secret, event disconnected from the session |
| Google Ads conversions | Counts each conversion action in Google Ads | An action without a conversion label doesn't count |
| UTM parameters | Tag the source of the click in the ad link | Inconsistent naming, links without UTMs |
| Your store's paid orders | The financial truth: money that came in | Don't say on their own which ad drove them |
No single piece solves it. The setup that works combines pixel and server with deduplication to feed the platforms, and UTMs with paid orders so you can measure what actually sold.
What can't the browser pixel record?
A pixel is a script running on the shopper's device. It only records what happens while the page is open and the script can load. That leaves out:
- visitors with ad blockers or browsers with tracking protection;
- people who come back after the cookie expired (Safari caps cookies set by scripts at seven days, as WebKit explains);
- payments confirmed off the page;
- purchases where the thank-you page never loads, because of a bad connection or a payment redirect.
Each case is a real sale the platform doesn't see. With fewer purchases, the bidding algorithm learns slowly, reported cost per purchase goes up, and profitable campaigns look bad.
What changes with server-side tracking?
With server-side tracking, your store's server sends the event straight to the platform's API. The store already knows when an order is paid, because the payment processor tells it, so Purchase fires at the right time and with the right value, even if the shopper never returns to the page. The pixel keeps running in the browser, because it brings the cookies and click identifier that help match the event to a person. The server guarantees delivery.
The full explanation, with the setup options (your own tagging server, a third-party tool, or native sending from your store platform) and a validation checklist, is in our guide server-side tracking: what it is and why your pixel misses sales.
Where does the Meta Conversions API fit in?
The Conversions API is Meta's entry point for server events. In its best practices, Meta recommends using the API in addition to the pixel and sharing the same events through both. For a store, what matters is:
- sending the ecommerce events (ViewContent, AddToCart, InitiateCheckout, Purchase) with value, currency and items;
- including customer data hashed with SHA-256 (email, and phone with the country code) and, unhashed, the
fbpandfbccookies, IP address and user agent; - using the same
event_idas the pixel so Meta can deduplicate; - sending in real time: Meta accepts events up to 7 days old.
Field by field, with setup steps and tests, it's all in our Meta Conversions API guide for ecommerce.
How do you avoid counting the same sale twice?
Deduplication is what lets you send the same event from the browser and the server without inflating your reports. At Meta, the rule in the deduplication docs is: same event name and same event ID, received within 48 hours, count as one. TikTok follows similar logic with the event ID.
Three practical rules:
- Derive the ID from the order. An ID based on the order is the same in the browser and on the server without either side having to tell the other.
- Keep one sender per event. If an old tracking app is still installed next to native sending, you have two senders with different IDs. Remove one.
- Compare purchases with paid orders. If the platform shows close to double the purchases your store got paid for, deduplication is broken.
How should you structure your store's UTMs?
UTMs are your independent record of where each visit came from. The ad platform has its report; the UTMs stored with the session and carried to the order are yours. A simple, consistent convention beats a clever one that everyone fills in differently.
| Parameter | What it's for | Example |
|---|---|---|
utm_source | The platform | facebook, tiktok, google |
utm_medium | The traffic type | paid, email, sms |
utm_campaign | The campaign | The campaign name, no spaces |
utm_content | The ad or creative | The ad name |
utm_term | The ad set or keyword | The ad set name |
utm_id | The campaign ID on the platform | On Meta, the {{campaign.id}} macro |
Rules that prevent most of the mess: all lowercase, no spaces (use hyphens), the same utm_source value for the same platform across every campaign, and the platform's dynamic macros instead of typing names by hand. The campaign ID in utm_id saves you when a campaign gets renamed mid-month.
Platform ROAS or real ROAS: which one should you use?
Both, for different questions.
- Platform ROAS is what Meta or TikTok calculate under their attribution rules. It's the number the algorithm optimizes on. Use it to compare campaigns within the same platform.
- Real ROAS is revenue from paid orders divided by ad spend over the same period, attributed by your store's UTMs. It's the number that pays the bills. Use it to decide how much to invest in each channel.
When the two diverge a lot, go back to the list of causes. A platform number far below your store usually means tracking (lost events). Far above usually means duplication, purchases fired on order creation, or view-through attribution.
A simple way to calculate real ROAS per campaign:
- Export spend per campaign for a period (for example, the last 7 complete days).
- Add up revenue from paid orders in the same period whose
utm_campaignorutm_idbelongs to that campaign. - Divide revenue by spend. A real ROAS of 2 means each dollar spent came back as two dollars of paid revenue, before product cost, shipping and fees.
- Compare it with the break-even ROAS for your margin. Below that, the campaign loses money even if Ads Manager shows a nice number.
Why does the same sale show up in Meta and in Google?
Because each platform only sees its own ads. Picture a shopper who watched a video on Instagram on Monday, searched your brand on Google on Wednesday, clicked a search ad and bought. Meta may credit the sale to the video, if its attribution setting counts the view or click within the window. Google credits the search click. In your store, there's one order.
That isn't a tracking error: it's each platform applying its own model. That's why adding up the sales each platform reports almost always gives you more than the store sold. Three habits help:
- Use the platform's number for decisions inside it. Which creative, which audience, which ad set gets more budget.
- Use your store's number for decisions across channels. How much to put into Meta, TikTok and Google next month.
- Write down each account's attribution setting. Changing the window changes history; comparing months without knowing that leads to wrong conclusions.
How do you measure email, SMS, WhatsApp and affiliates?
Your owned channels need UTMs too, or their sales show up as "direct" or get absorbed into some ad's credit. A few practical rules:
- Email:
utm_medium=emailand the campaign or flow name inutm_campaign. Cart recovery should have its own name, separate from launch campaigns. - SMS and WhatsApp: their own
utm_mediumon every link you send, including automated recovery messages. - Affiliates and creators: a dedicated link or coupon per partner. The coupon covers people who heard about you in a video and typed your store address.
- Organic and search: don't tag it. Visits with no UTMs coming from a search engine are your organic traffic.
With that in place, "how much did email sell this month?" gets an answer in paid orders, not impressions. Recovery is covered in our guide to abandoned cart recovery.
Tracking and privacy: what do GDPR and US state laws change?
Pixels and server events process personal data such as email, phone and IP address. In the EU, the GDPR requires a legal basis for that processing, and in the US several states have their own privacy laws, such as California's CCPA. Which rules apply to you and how to comply is a decision for your store and your legal counsel. On the technical side:
- if your store relies on consent, server events must respect the same choice as the banner, not just the pixel;
- identifying data goes to the platform hashed, as Meta requires;
- your privacy policy should say which platforms receive data and why.
A 10-step tracking audit checklist
- List every event sender installed: native pixel, apps, scripts pasted into the theme, tag managers. There should be one per platform.
- Check that each platform receives events from both the browser and the server.
- Open the platform's test events tool and browse your store from product to checkout.
- Place a real order, close the tab right after paying, and confirm the Purchase still arrives.
- Compare the Purchase value, currency and items with the order.
- Verify deduplication: the purchase arrives through both channels and counts once.
- Review Event Match Quality and diagnostics warnings in Events Manager.
- Check the UTMs on every active campaign against the convention above.
- For one complete week, compare each platform's purchases with your store's paid orders.
- Put it on the calendar: repeat steps 7 to 9 weekly, and the full checklist after any theme, checkout or payment processor change.
Who should own tracking on a small team?
One person, by name. Tracking breaks quietly: a token expires, someone installs an app that adds a second pixel, a new checkout skips the purchase event. When it's everyone's job, nobody notices until the cost per purchase doubles. On a small team, the owner is usually whoever manages the ad accounts, because they feel the problem first. Their weekly routine is short:
- check each platform's diagnostics for failures and expired tokens;
- compare last week's platform purchases with paid orders;
- review the UTMs on any campaign launched that week;
- write down any change to the store (new app, new payment processor, new checkout) so a drop in numbers can be traced to a cause.
How does Horsee handle tracking and attribution?
In Horsee, tracking is part of the platform, not a separate app. Under Tracking in the sidebar, you connect:
- Meta: pixel and Conversions API;
- TikTok: pixel and Events API;
- Google Analytics 4: reports and Measurement Protocol;
- Google Ads: conversions per action, one label per action;
- Taboola: conversions on its discovery network, from the browser.
For Meta, TikTok and Google, the store sends from the browser and the server with the same event ID, so the same purchase counts once. The ecommerce events (PageView, ViewContent, AddToCart, InitiateCheckout and Purchase) go out with no extra setup. The server-side purchase fires when the order is marked as paid, with any connected processor, including Stripe and PayPal, and a background job resends paid purchases that didn't get through. Diagnostics show, per platform, total events sent, failure rate, deduplications and how often events carry email, phone and cookies.
On the attribution side, the store saves UTMs with the session and carries them to the order, so you can see the journey by source, medium, campaign, term and content, with real revenue and paid orders, and ROAS when utm_id matches the campaign. Step-by-step setup is in the Horsee Help Center, and the full pillar, with automation and CRM, is on the Horsee operations page: tracking, automation and CRM.
Quick glossary
- Event: an action recorded in your store, such as PageView, AddToCart or Purchase.
- Pixel: the platform's script that records events in the visitor's browser.
- Conversions API (CAPI): Meta's interface for events sent from a server.
- Events API: TikTok's equivalent.
- Deduplication: the rule that makes the same event, received from the browser and the server, count once.
- event_id: the event identifier used for deduplication.
- Attribution window: the period after a click or view during which the platform credits a sale to the ad.
- Real ROAS: revenue from paid orders divided by ad spend, using your store's own attribution.
Guides in this hub
- Meta Conversions API (CAPI): a complete guide for ecommerce stores: events, required fields, customer data hashing, deduplication and testing.
- Server-side tracking: what it is and why your pixel misses sales: why events get lost, the setup options and a validation checklist.
Related topics
Tracking starts at checkout: a purchase is only reliable if the confirmed payment reaches your store right away. Our hub on checkout and payments covers cards, wallets and local methods without losing conversions. And once your numbers are reliable, the next step is improving how your store converts: the hub on conversion and A/B testing shows how to test with a method, measured on paid orders.
From the guide to a live store.
Build your store with AI in minutes, with checkout, payments and server-side tracking ready.
