Skip to content

Guide

Ecommerce revenue attribution: which visit gets the credit for a sale?

Attribution models and windows, why Shopify, GA4 and ad platforms show different revenue for the same orders, and a setup that you can check.

Updated

The basics

What is ecommerce revenue attribution?

Revenue attribution gives the money from each order to the marketing that led to it. A model decides which visit gets the credit, and a window decides how far back the tool looks.

A shopper often visits a store several times before they buy. They find a product in search, come back from an ad, and then order from an email. Each visit has a source: a channel, a referrer, a campaign and a landing page. Attribution answers one question for each order: which of these sources gets the revenue?

The answer changes with the rules. Two tools with different rules give different numbers for the same orders, and both can be correct. Learn the rules of each tool before you compare its reports.

What is the difference between first touch and last touch?

Last touch gives all the credit to the last visit before the order. First touch gives all the credit to the first visit of the shopper.

Last touch shows what closes sales. That is often email, a search for the brand name, or a direct visit. First touch shows what brings new shoppers to the store. That is often search, social posts or ads. Neither model is wrong. They answer different questions, so look at both before you cut a channel.

Some tools also offer last non-direct click. It skips direct visits and gives the credit to the last visit that had a source. Shopify's marketing reports use it by default for marketing activity data. They also offer last click, first click, any click and linear. The same Shopify page says that last click is selected by default when a report has a sales metric and a marketing dimension.

What is a multi-touch model?

A multi-touch model splits one order across several visits. A linear model gives each visit an equal part. A data-driven model uses the account's own data to set the parts.

Shopify offers a linear model in its marketing reports. GA4 uses data-driven attribution by default and also offers two last-click models. GA4 no longer offers the first click, linear, time decay and position-based models: Google removed them in November 2023.

Multi-touch models look fair, but the parts are estimates. A linear split does not know which visit made the shopper decide. A data-driven model needs a lot of data, and you cannot check its result by hand. A single-touch model is less complete, but you can trace each number back to one visit.

Worked example

How do the models credit one $120 order?

This is a made-up example store, not real data. The numbers only show how the models differ.

Each model gives out exactly $120, but each model picks a different channel. An example store sells tea. One shopper makes three visits before one order:

  1. Day 1: the shopper searches on Google and lands on a blog post about green tea. Channel: organic search.
  2. Day 9: the shopper clicks a Meta ad and looks at a product page. Channel: paid social.
  3. Day 12: the shopper opens the store's newsletter, clicks a link and orders. Channel: email. Order total: $120.
Example: how three attribution models credit one $120 order after three visits
ModelOrganic search, day 1Paid social, day 9Email, day 12
Last touch$0$0$120
First touch$120$0$0
Linear$40$40$40

Last touch says that email made the sale. First touch says that search found the customer. Linear says that all three visits helped equally. If the shopper had typed the store address on day 12 instead of clicking the email, last click would credit a direct visit, and last non-direct click would credit the paid social visit on day 9.

The ad platform can count the same order too. Meta's standard click-through setting counts events within 1 or 7 days after a link click on the ad. With the 7-day setting, the ad click on day 9 is 3 days before the order, so Meta can report the $120 as a result of the ad. If the email tool also counts the order, the reports together seem to show $240 or more from one $120 order. The store took $120.

Windows

What is an attribution window in ecommerce?

An attribution window is the time after a visit, a click or an ad view in which an order can still give it credit. An order after the window gives that touch no credit.

Default attribution models and windows, from each vendor's help pages
ToolDefault modelWindow
Google Analytics 4Data-driven attributionKey events: 90 days by default, or 30 or 60 days. first_visit and first_open: 30 days by default, or 7 days.
Shopify marketing reportsLast non-direct click for marketing activity dataNo window setting on the page. If a visitor does not buy within 30 days of a session, the first-interaction referrer resets.
Meta Ads, standard attributionChosen per ad setClick-through: 1 or 7 days after a link click. View-through: 1 day after an impression. Engage-through: 1 day after a non-link click.
twelvebitLast touch, with a first-touch switch on the revenue pageNo window setting. The visitor cookie sets the practical limit (see below).

A longer window gives more orders to a channel. A view-through window also gives credit when the shopper saw the ad but did not click it. So a report with a 7-day click and 1-day view window can show more ad revenue than a report that counts clicks only.

Compare two reports only when they use the same model and the same window. Meta's help page gives this advice for its own ad sets: each attribution model counts in a different way, and a comparison across models leads to wrong conclusions.

Different numbers

Why do Shopify and Google Analytics show different revenue?

They count the same orders with different models, windows and data. Shopify knows every order, but an analytics tool or an ad platform knows only the visits and conversions that it could see.

  • Different models. GA4 uses data-driven attribution by default. Shopify's marketing reports use last non-direct click by default for marketing activity data. In GA4, a change of the reporting model also applies to historical data, so an old report can show new numbers.
  • Different windows. GA4 looks back up to 90 days for key events. Meta counts 1 or 7 days after a link click and 1 day after an impression. Shopify resets the first-interaction referrer when a visitor does not buy within 30 days of a session.
  • View-through credit. Meta can count an order that came within 1 day after the shopper saw an ad, with no click. A web analytics tool sees only visits, so it cannot give that order to the ad.
  • Consent and cookies. Shopify says that when non-essential data is collected only after consent, less data is available for analytics, with lower session counts and conversion rates. In GA4, events from users who do not grant consent have no persistent user identifier. GA4 can estimate the missing data with behavioral modeling, but only when the property meets its thresholds, for example 1,000 events a day with analytics_storage denied for at least 7 days.
  • Devices and sessions. Shopify counts sessions and visitors with cookies, and a session ends after 30 minutes of inactivity. A tool that counts with browser cookies sees a phone and a laptop as two visitors, so a visit on one device does not join an order on the other.
  • Missing referrers. For direct sources, Shopify lists the name as N/A when it cannot find the referrer, for example when the browser has Do Not Track on, or a proxy or firewall blocks the referrer data.
  • Refunds, currency and time zone. A report can show gross or net revenue, convert to a different currency, or put a late-night order on a different day. Check these settings before you compare two totals.

So do not try to make the numbers match exactly. Use the store's own order total as the truth for revenue. Use one attribution tool with one fixed model to compare channels over time.

Setup

How do you set up revenue attribution for a store?

Join each paid order to a visit on the server, choose one model, and check the result against the store's own sales total.

  1. Tag your links

    Add UTM parameters to the links in ads, emails and social posts. Then each visit has a campaign, and the report does not depend on the referrer alone.

  2. Join the order to the visit

    Put the visitor ID on the cart or the order, so the paid order carries it to the analytics tool. A purchase event in the browser depends on the thank-you page loading; an order on the server does not.

  3. Count orders when they are paid

    Use the store's paid-order webhook, not a click on the buy button. Count each refund against the visit of the order that it reverses, so a channel with many returns does not look better than it is.

  4. Pick one model and keep it

    Use last touch to see what closes sales, and first touch to see where new customers come from. Write the model and the window next to each number that you share.

  5. Check the totals each month

    Compare the attributed revenue with the store's own sales report. A large gap means that orders do not reach a visit. Check the cart IDs, consent and cookieless traffic.

One option

How does twelvebit credit a Shopify or WooCommerce order?

twelvebit gives each paid order to one visit. The default is last touch: the visitor's latest visit before the order. The revenue page can switch to first touch.

From the store to the visit

A Shopify store connects with a custom app. twelvebit adds the script with a ScriptTag and registers the orders/paid and refunds/create webhooks. The script writes the visitor ID and the visit ID into the cart attributes, and each order carries them. A WooCommerce store installs the twelvebit plugin. It saves the IDs on each new order and sends the order when its status becomes Processing or Completed. twelvebit counts each order once. Each paid order becomes a payment: the order total in the store currency, with the first product as the plan.

Which visit gets the credit

For each payment, twelvebit picks the credited visit in this order:

  1. The session in the order or checkout data (the _tb_sid ID).
  2. The visitor's latest visit that started before the payment (the _tb_vid ID).
  3. A visitor who identified with the same email as the customer.
  4. An earlier attributed payment of the same customer. This is how renewals and refunds find a visit.

A refund counts against the visit of the order that it reverses. The revenue chart can show net revenue, new payments, renewals or refunds only.

Reports, funnels and filters

Channel, referrer, campaign, entry page, country and the other breakdowns use last touch. They count each payment once, so the rows add up to the attributed revenue. The revenue page has a switch to first touch: the person's first visit. It applies to every revenue card on that page. Funnels show, for each step, the payments that people made after they reached the step. The revenue page takes the same filters as the overview. With a filter, a payment counts only when its credited visit matches the filter.

Is there an attribution window?

No. twelvebit has no window setting. Last touch takes the visitor's latest visit that started before the payment, with no time limit. First touch takes the visitor's first visit. The practical limit is the visitor ID: the _tb_vid cookie lasts 1 year, and the script sets it again on each page load. If the shopper clears cookies or buys on another device, the order cannot reach the earlier visits. Analytics data stays while the site is in your account.

In cookieless mode, twelvebit sets no cookies. The visitor ID comes from a hash that changes every day, so the same person is a new visitor each day, and a journey over several days does not join. The script puts no IDs on the cart. An order then joins a visit only when its email matches a visitor who identified, or when the same customer has an earlier attributed payment. For the cookie and consent side of this choice, read Shopify analytics without cookie banners.

What twelvebit does not do

  • No multi-touch model. One order goes to one visit, not split across many visits.
  • No data-driven model and no view-through credit. twelvebit sees visits, not ad impressions.
  • No attribution window setting.
  • No join across devices. Each browser is its own visitor, and the same user_id on two visitors does not merge them.

Plans start at $9 a month for 10k events. See twelvebit for Shopify and WooCommerce, how the revenue attribution works, and the setup steps in the revenue docs.

More guides →

Paste one prompt. Watch the first events arrive.

Start free. Your agent does the setup, and you see revenue next to the traffic that brought it.

14-day free trial · cancel any time