- Ad attribution breaks in two places: the platform never receives the purchase, or receives it without the click id that ties it to the ad.
- The same three fixes work on every ad platform: keep the browser tag, send purchases server-side from your order data, and share one event id between the two.
- Save each platform's click id first-party when the visitor lands, because the server event needs it later.
- Platforms each credit their own ads, so compare channels with one model on your own order data, not by adding up platform numbers.
To fix ad attribution, make sure every ad platform receives every purchase, with the click id that ties it to the ad. In practice: keep each platform's browser tag, save its click id first-party when the visitor lands, send each paid order server-side from your order data with that click id and hashed customer details, and give the browser and server copies one event id so the platform counts them once. Then compare channels with one attribution model on your own order data.
Below are ten fixes, one per platform or tool, followed by how attribution works in ecommerce and how to put it into practice.
The ten fixes at a glance
| # | Platform or tool | Browser tag | Server route | Click id to save |
|---|---|---|---|---|
| 1 | Google Ads | Google tag with conversion linker | Conversions through Google's API, enhanced conversions | gclid, gbraid, wbraid |
| 2 | Meta | Meta pixel | Conversions API | fbclid as _fbc |
| 3 | X | X pixel | Conversions API | twclid |
| 4 | Snapchat | Snap pixel | Conversions API | ScCid |
| 5 | TikTok | TikTok pixel | Events API | ttclid |
| 6 | Microsoft Advertising | UET tag | Server-side conversions | msclkid |
| 7 | Pinterest tag | Conversions API | epik | |
| 8 | GA4 | Google tag | Measurement Protocol | The GA client id |
| 9 | Shopify | Built in | Order data | UTM tags on every link |
| 10 | One store-side layer | One first-party script | Every platform from one place | All of the above |
1. Google Ads conversion tracking
Create a purchase conversion action in Google Ads and keep auto-tagging on, so every ad click lands with a gclid (or gbraid and wbraid on some iPhone traffic). The Google tag's conversion linker stores that id in a first-party cookie, so the conversion can be credited when the shopper buys days later. Add enhanced conversions, which send the buyer's email hashed, so Google can match purchases without a click id. For orders the browser tag misses, send the conversion from your server with the stored click id or hashed customer data.
Google Ads credits conversions with data-driven or last click attribution, over Google ads only. When Google Ads and GA4 report different numbers, see Google Ads vs GA4.
2. Meta pixel and Conversions API
Install the Meta pixel on every page, including the order confirmation, and send the same purchases through the Conversions API from your order data. Give both copies the same event name and event id, so Meta keeps one. Send the fbc click value and the fbp browser id with the server event, and hash the email and phone. Check the result in Events Manager: purchases from both the browser and the server, and a healthy Event Match Quality. The Meta Conversions API covers the setup, and duplicate purchase events the event id.
3. X (Twitter) ads
X attributes conversions through its pixel and its Conversions API. Save the twclid click id when a visitor lands from an X ad, and send it with the server purchase, together with hashed customer data. Without the click id, X has little to match on, because X ads rarely bring a logged-in signal into your store.
4. Snapchat ads
Snapchat uses the Snap pixel in the browser and the Conversions API on the server. Save the ScCid click id on landing. For purchases, Snapchat deduplicates on the event id, and on the order id when the pixel sends it as transaction_id and the server sends it as order_id.
5. TikTok ecommerce attribution
TikTok traffic is mostly mobile, often in TikTok's in-app browser, where the pixel misses more events. Send purchases through the Events API from your order data, with the ttclid click id saved on landing, the _ttp browser id and the same event_id as the pixel. TikTok keeps the first copy it receives. The TikTok Events API on Shopify walks through it.
6. Microsoft Advertising (Bing) conversions
Microsoft Advertising tracks conversions with its UET tag. Turn on auto-tagging so clicks land with an msclkid, keep it first-party, and send purchases server-side with the click id for the orders the tag misses. Import your Google Ads campaigns only after the conversion goal is in place, so imported campaigns optimize on purchases from the start.
7. Pinterest tag for ecommerce
Install the Pinterest tag with its shopping events (page visit, view, add to cart, checkout) and send the same events through the Pinterest Conversions API with matching event ids and names. Save the epik click id on landing. Pinterest shows deduplication per event in its Ads Manager, which makes it easy to check. The Pinterest Conversions API on Shopify covers the details.
8. Google Analytics ecommerce tracking
GA4 needs the standard ecommerce events, above all purchase with a transaction_id, so a purchase counts once even when it is sent twice. When you also send purchases from your server through the Measurement Protocol, include the GA client id saved from the visitor's browser, or GA4 cannot join the purchase to the session and its campaign, and it lands under unassigned or direct. GA4 attributes across all channels, which makes it a useful second view next to the ad platforms.
9. Shopify marketing analytics
Shopify's marketing reports credit orders to channels with five models, last non-direct click by default. They work only as well as your links are tagged: put UTM tags on every ad, email and influencer link, in a consistent naming scheme, and keep auto-tagging on in Google Ads and Microsoft Advertising. Shopify cannot see ad views or clicks on other devices, so use it as the store-side reference, not as the only view. UTM parameters for Meta and TikTok shows a naming scheme.
10. One store-side tracking layer for every platform
Doing fixes 1 to 9 one by one means a tag, a server integration and a click id per platform, each maintained separately. A store-side layer does them from one place: one first-party script saves every platform's click id, the visitor id travels with the cart into the order, and every paid order goes to every connected platform with its own click id and the shared event id. The same data then feeds your own attribution report, which credits every order once across all channels. ROASaurus is such a layer; it is described at the end of this guide.
Understanding ad attribution in ecommerce
Ad attribution is assigning the credit for a sale to the ads and other marketing a customer touched before buying. It decides which campaigns look profitable, so it decides where budget goes. Two separate questions sit inside it:
- Measurement: did the platform receive the purchase, with the data to tie it to the ad? Fixes 1 to 9 are about this.
- Credit: when several ads and channels touched the order, which one gets how much? That is the choice of an attribution model: last click, first click, linear, time decay, position-based, data-driven or survey-based.
Every platform answers the second question for itself and credits every order its own ads touched. That is why adding up platform numbers always gives more sales than you had. Attribution models for ecommerce works one order through every model, and the glossary has the short definition.
Implementing effective ad attribution
- Tag every link
Auto-tagging on in Google Ads and Microsoft Advertising, UTM tags on everything else, one naming scheme for all channels.
- Save click ids first-party
Read every platform's click id on landing and store it on your own domain, then carry a visitor id into the cart.
- Send purchases from the order
Every paid order to every platform, server-side, with its click id, hashed email and phone, and the browser's event id.
- Check the deliveries
Compare the purchases each platform accepted with your orders, every week and before every peak.
- Pick one model to compare channels
Use the same model and lookback window for every channel, and switch models only to answer a different question.
- Judge on profit
A channel with a high ROAS on low-margin products can still lose money; compare gross profit against ad spend.
How ROASaurus fixes attribution in one place
ROASaurus sends paid orders server-side to 16 ad platforms, including Google Ads: Meta, Google Ads, TikTok, Snapchat, Pinterest, Reddit, X, Microsoft Advertising, Taboola, LinkedIn, OpenAI Ads, Spotify, AppLovin, Criteo, AdRoll and Outbrain, plus Klaviyo, GA4 and server-side GTM. Click ids and UTM tags are captured first-party, the visitor id is written to the cart and arrives with the order, and browser and server events share one event id. It is in production use today for Meta and Google Ads; the other destinations are built from each platform's documentation and have not carried a customer's traffic yet.
| In ROASaurus | Where | What you see |
|---|---|---|
| Attribution report | Marketing › Channels & campaigns › Attribution | Orders, revenue and ROAS per channel and campaign under twelve models, with a lookback of 1 to 90 days or unlimited, 7 days by default |
| Order journeys | Profit › Orders › Journeys | Per order: the ad clicks before it, time to convert, how it was matched and the credit under every model |
| Platform numbers | Marketing › Channels & campaigns › Platform numbers | What each ad platform reports itself, next to your own numbers |
| Deliveries | Data quality › Deliveries | Every server event per platform, with its status and the platform's response |
The twelve models are last click, first click, last non-direct click, linear, linear paid, position-based, time decay, data-driven Markov, data-driven Shapley, Total Impact (survey plus clicks), any click and clicks & views. View-through credit is modelled from the views each platform reports, not matched per impression. See attribution for the details and the Shopify setup guide to start.
Sources
- Google Ads Help: About attribution models
- Google for Developers: Send offline conversion events to Google Ads (Data Manager API)
- Meta for Developers: Handling Duplicate Pixel and Conversions API Events
- TikTok Ads Manager: About Event Deduplication
- Snap for Developers: Deduplication
- Pinterest Developers: Track conversion events in the API
- Shopify Help Center: Measuring marketing performance