Skip to content
Start free trial
BlogEvent tracking

Revenue tracking in web analytics: how to see which traffic pays

Visits tell you which channels are busy. Revenue tells you which ones pay. Here’s how to attach money to your events and read it without fooling yourself.

Say you run a Shopify store selling coffee equipment and haven’t set up revenue tracking in web analytics yet. Your reports say paid social sends twice as many visits as your newsletter. So paid social is winning, right?

Not necessarily. If newsletter readers buy grinders while social visitors browse and leave, the newsletter could be bringing in more money. Visits alone can’t tell you.

Revenue tracking in web analytics closes that gap. It means attaching the value of a sale to the event that records it, so every report can show revenue next to visits.

This post covers how to send revenue, how currency works, Shopify purchases, GA4 ecommerce values, and how to stop reloads from counting a sale twice.

Key takeaways

  • Revenue tracking attaches an amount and a currency to an event, so reports can show which sources, pages and campaigns lead to sales.
  • Each site reports revenue in one currency, set by its first revenue event, and events in other currencies are counted but left out of the total.
  • GA4 ecommerce pushes and the Shopify custom pixel send revenue with no extra code.
  • Send a transaction_id with every purchase, so a reloaded thank-you page doesn’t count the sale twice.
  • Analytics revenue is the browser’s view of the moment of purchase, so keep your payment system as the ledger.

What revenue tracking in web analytics can tell you

Revenue in your analytics answers comparison questions. Which source sends buyers? Which landing page leads to bigger orders? Did the campaign pay for itself?

In FunnelSights, revenue attaches to the visit. Once a purchase is recorded, its value shows against the source, campaign, pages and country of the visit it happened in.

It can also be split by event properties. If your Purchase event carries a plan or category property, you can read revenue by plan or by category.

And what it can’t

Analytics revenue is what the browser reported at the moment of purchase. It doesn’t see refunds, chargebacks, subscription renewals, invoices paid later or sales made by phone.

So treat your payment system as the ledger, and your analytics as the map of where buyers came from. The two will differ. What matters is that they move together.

Four ways revenue reaches your reports

There are four routes into FunnelSights. They all produce the same thing: an event with an amount and a currency.

Ways to send revenue
RouteWhat you addBest for
JavaScript callfunnelsights('Purchase', { revenue: { amount: 49, currency: 'USD' } })Custom checkouts and billing pages you control
CSS classesfs-revenue-amount=49 and fs-revenue-currency=USD on a tagged elementFixed-price buttons in a site builder
dataLayervalue and currency on any pushed event, top-level or in ecommerceSites already tagged for GA4 or Google Tag Manager
Shopify custom pixelNothing beyond pasting the pixelShopify stores, whose checkout your theme can’t see

Pick one route per sale. Sending the same purchase two ways counts it twice.

How to send revenue from your own code

If you control the page that confirms a purchase, call funnelsights with a revenue object. Do it once the payment has succeeded, not when the Pay button is pressed:

funnelsights('Purchase', {
  revenue: { amount: 129.99, currency: 'EUR' },
  props: { transaction_id: 'T-20931', plan: 'annual' }
})

A few rules keep the number clean:

  • amount can be a number or a numeric string. NaN and Infinity are rejected.
  • currency must be a three-letter code such as USD, EUR or GBP. It’s stored in upper case.
  • If the currency is missing or malformed, the event is still recorded, but without revenue. That fails quietly, so check it while testing.
  • Add a transaction_id property. It’s what lets ingest drop a duplicate, as explained below.

Sites without a developer can do something similar with classes. A button tagged fs-event-name=Purchase fs-revenue-amount=49 fs-revenue-currency=USD sends a Purchase worth 49 USD when clicked. That only suits a fixed price, and it fires on the click rather than on a confirmed payment, so use it with care. Tracking clicks, downloads and forms without code covers class tagging in full.

How currency works

Adding dollars to euros gives you a number that means nothing. So FunnelSights reports each site’s revenue in one currency: the currency of the first revenue event that site received.

Events in any other currency aren’t converted. They’re left out of the total and counted, and the dashboard tells you how many purchases it excluded, so the gap is visible.

Because the first revenue event sets the currency, make your first test purchase in the currency you report in. After that, stores that sell in several currencies have two sensible options:

  • Convert before you send. Send every purchase in your reporting currency, and keep the original currency in a property if you want it.
  • Accept the exclusion. If nearly all orders are in one currency, the excluded count tells you how much you’re missing.
funnelsights('Purchase', {
  revenue: { amount: 54.2, currency: 'USD' },
  props: { transaction_id: 'T-20932', original_currency: 'EUR' }
})

How GA4 ecommerce value capture works

If your site is tagged for GA4, your purchases probably already push value and currency into the dataLayer. FunnelSights reads those pushes, so the revenue arrives without new code.

It looks for value and currency at the top level of the event first (the gtag() style), then inside the ecommerce object (the shape most GTM ecommerce setups push). An ecommerce transaction_id is copied to a property, and the items array is dropped.

gtag('event', 'purchase', {
  transaction_id: 'T-20933',
  value: 72.5,
  currency: 'GBP'
})

That call is recorded as a purchase event worth 72.50 GBP. For every rule about which pushes count, see how to track GTM dataLayer events.

Two traps in an existing GA4 setup

Any captured event with value and currency adds to revenue, whatever it’s called. That causes two common surprises:

  • A sale pushed twice. If the thank-you page fires both a GA4 purchase and a separate ad-platform conversion event carrying the order value, the sale is counted twice.
  • Lead value counted as revenue. GA4 lets you put a value on a generate_lead event. With a currency attached, that value lands in your revenue total.

Goals & Events shows revenue for each event name, so both are easy to spot in the first week.

How to track Shopify purchases

Shopify stores have a specific problem. The FunnelSights tag lives in theme.liquid, and Shopify never renders theme.liquid on checkout, thank-you or order status pages. So the tag counts the storefront but can’t see a purchase.

The fix is a custom pixel, copied from the app and pasted into Shopify admin under Settings → Customer events → Add custom pixel. It records three events:

  • Add to Cart, with the product title as a property.
  • Checkout Started.
  • Purchase, with the order total and currency as revenue, and the order ID as its transaction_id.

The pixel also counts the checkout pages themselves, with checkout and order tokens stripped from the URL before anything is sent. Storefront pageviews stay with the theme tag, so no page is counted twice.

Shopify asks whether a custom pixel needs customer permission. If you set it to require permission, visitors who decline aren’t counted, so that choice belongs with whoever owns your store’s consent setup. To read these three events as a funnel, see the ecommerce checkout funnel.

How to stop reloads double counting a sale

Thank-you pages get reloaded, bookmarked and reopened from browser history. Without protection, each of those visits sends the purchase again.

FunnelSights handles this with the transaction_id property. When an event carries revenue and a transaction_id, ingest remembers it for 24 hours, and a second event with the same name, site and transaction ID in that window is dropped.

The Shopify pixel and GA4 ecommerce pushes send a transaction ID already. If you call funnelsights yourself, add one. And if the duplicate check ever can’t run, ingest records the event rather than risk losing a real sale.

From purchase to revenue report
  1. PurchaseThe payment succeeds and the confirmation page loads.
  2. SendYour code, the dataLayer or the Shopify pixel sends Purchase with an amount, a currency and a transaction ID.
  3. CheckIngest validates the amount and currency, and drops a repeat of the same transaction within 24 hours.
  4. AttachThe revenue joins the visit, along with its source, campaign, pages and country.
  5. ReportWithin 15 minutes, the rollup adds it to revenue by source, page, country and property.

Revenue in a currency other than the site’s is counted and reported as excluded, never converted.

How to read revenue in your reports

Once purchases arrive, revenue appears as a column next to visits across the reports. Back at the coffee store, this is where the answer shows up.

Revenue by channel in one month (GBP)
Newsletter4,180
Organic search3,240
Paid social1,950
Direct1,420

Illustrative numbers, not customer data. In this made-up month, paid social sent the most visits but the newsletter brought in the most revenue.

Revenue by source is often the report that changes a budget conversation. To make that source data trustworthy, tag your campaign links. The UTM parameters guide shows how.

A checklist before you trust the number

  • Make your first test purchase in your reporting currency, since the first revenue event sets the site’s currency.
  • Watch the Network tab during a test purchase: one request, with the amount and currency in $.
  • Reload the thank-you page and confirm the second purchase is dropped.
  • Check revenue by event name in Goals & Events. Only the events you expect should carry money.
  • Look for an excluded-currency note on the dashboard.
  • After a week, compare the total with your payment system. Expect a gap, and expect it to stay roughly steady.

Then make Purchase a goal, so its conversion rate sits beside the revenue. How to choose conversion goals covers that step, and the event tracking guide shows where revenue fits in the wider setup.

Frequently asked questions

How does revenue tracking work in web analytics?

A purchase is recorded as an event carrying an amount and a currency. The analytics tool then adds that revenue to the visit it happened in, so you can see revenue by source, campaign, page and country, alongside the visits that produced it.

Can I track revenue in more than one currency?

FunnelSights reports each site in one currency, set by its first revenue event. Events in other currencies are not converted; they are left out of the total and counted, so you can see how many were excluded. Converting before you send is the cleanest fix.

Why doesn’t my analytics revenue match my payment system?

Analytics records what the browser reported at the moment of purchase. It does not see refunds, renewals, invoices paid later, offline sales or purchases from browsers that never sent the event. Use your payment system for the books and analytics to compare sources.

Does FunnelSights track Shopify purchases?

Yes, through the custom pixel pasted into Shopify’s Customer events settings. It records Add to Cart, Checkout Started and Purchase, with the order total as revenue, on the checkout pages the theme tag cannot see.

How do I stop a reloaded thank-you page counting a sale twice?

Send a transaction_id property with the purchase. A second event with the same name and transaction ID on the same site within 24 hours is dropped at ingest. The Shopify pixel and GA4 ecommerce pushes already include one.

More in this series

This post is part of Website event tracking: a practical guide, our guide to event tracking.