Attribution

Ten ways to fix ad attribution on Google, Meta and TikTok

Ten fixes for ad attribution on Google Ads, Meta, TikTok, X, Snapchat, Microsoft, Pinterest, GA4 and Shopify: click ids, server events and one model.

·8 min read·By the ROASaurus team

Key takeaways
  • 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 toolBrowser tagServer routeClick id to save
1Google AdsGoogle tag with conversion linkerConversions through Google's API, enhanced conversionsgclid, gbraid, wbraid
2MetaMeta pixelConversions APIfbclid as _fbc
3XX pixelConversions APItwclid
4SnapchatSnap pixelConversions APIScCid
5TikTokTikTok pixelEvents APIttclid
6Microsoft AdvertisingUET tagServer-side conversionsmsclkid
7PinterestPinterest tagConversions APIepik
8GA4Google tagMeasurement ProtocolThe GA client id
9ShopifyBuilt inOrder dataUTM tags on every link
10One store-side layerOne first-party scriptEvery platform from one placeAll of the above
Every platform has a browser tag, a server route and a click id. Attribution works when all three are in place.

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

  1. Tag every link

    Auto-tagging on in Google Ads and Microsoft Advertising, UTM tags on everything else, one naming scheme for all channels.

  2. 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.

  3. 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.

  4. Check the deliveries

    Compare the purchases each platform accepted with your orders, every week and before every peak.

  5. 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.

  6. 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 ROASaurusWhereWhat you see
Attribution reportMarketing › Channels & campaigns › AttributionOrders, 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 journeysProfit › Orders › JourneysPer order: the ad clicks before it, time to convert, how it was matched and the credit under every model
Platform numbersMarketing › Channels & campaigns › Platform numbersWhat each ad platform reports itself, next to your own numbers
DeliveriesData quality › DeliveriesEvery server event per platform, with its status and the platform's response
One layer for the measurement fixes, one report for the credit.

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

  1. Google Ads Help: About attribution models
  2. Google for Developers: Send offline conversion events to Google Ads (Data Manager API)
  3. Meta for Developers: Handling Duplicate Pixel and Conversions API Events
  4. TikTok Ads Manager: About Event Deduplication
  5. Snap for Developers: Deduplication
  6. Pinterest Developers: Track conversion events in the API
  7. Shopify Help Center: Measuring marketing performance

In ROASaurus

Keep reading

TrackingWhy Google Ads and GA4 report different conversionsGoogle Ads and GA4 credit, date and count conversions differently, even with the same tag. The main causes of the mismatch and how to compare them fairly.AttributionAttribution models for ecommerce, and one order's journeyAttribution models for ecommerce compared on one customer journey: last click, first click, linear, data-driven and survey-based, and how to read an order.TrackingDuplicate purchase events: check pixel and server count onceHow Meta and other platforms decide two purchase events are one, what a matching pair looks like, and how to check pixel and server count each order once.

FAQ

Questions, answered

More answers in the FAQ and the help center.

How do I fix ad attribution?

Make sure each platform gets every purchase with its click id: keep the browser tag, save click ids first-party on landing, send paid orders server-side with hashed customer data, and use one event id for the browser and server copies.

How does ad attribution affect ecommerce marketing?

It decides which campaigns look profitable, so it decides where budget goes. Missing purchases make good campaigns look weak, and overlapping platform claims make the total look better than it is.

What is the difference between first-touch and multi-touch attribution?

First-touch gives all the credit to the first ad or channel in the journey. Multi-touch splits it over several touches, evenly or by weight, so channels that work together all get a share.

Which attribution model suits multi-channel ecommerce?

For comparing channels that work together, a multi-touch model such as linear, or a data-driven model on your own orders. Keep the same model and window for every channel you compare.

How does attribution handle cross-device journeys?

Only with a shared identifier. Platforms link devices through their own logins; your store can link them through a customer login, an email address or a hashed identifier the customer gave you.

What is an attribution window?

The period before a purchase in which a click or view can get credit. A longer window credits more early touches; platforms use their own defaults, so align windows before comparing numbers.

Can server-side tracking fix attribution on its own?

It fixes the measurement part: every purchase reaches each platform. It does not change how each platform credits its own ads, so you still need one model on your own data to compare channels.

Every sale, traced to the ad that earned it

Server-side tracking, profit and lifetime value in one app. Free plan, no credit card.