Revenue attribution
Send the amount with an event when a sale happens. Mayfly totals it per goal and lets you see which sources and campaigns the paying visits came from.
Send revenue with an event
Pass a third argument with revenue in minor units (cents, pence) and a three-letter currency. This records USD 49.00:
window.mayfly?.('purchase', { plan: 'pro' }, { revenue: 4900, currency: 'USD' });revenueis a whole number of minor units:4900, not49.00.- If you leave out
currency, the script sendsUSD. - Refunds and negative amounts can’t be sent.
Where it shows
- Overview shows total revenue for the period, beside visitors and pageviews.
- Goals shows revenue for each goal. Make a goal for your purchase event.
- All sites shows each website’s revenue side by side.
To see revenue by source, filter the Overview by a channel, source, referrer or campaign. A visit’s source is decided when the visit starts and carried by every event in it, so a purchase three pages in still counts towards the search engine or campaign that brought the visitor.
What it can’t tell you
- Attribution covers one visit. A visit ends after 30 minutes without activity, and the visitor identifier resets every UTC day, so a purchase on a later day is credited to that day’s visit, not to the one that first brought the person.
- Amounts are never converted. If a period mixes currencies, Mayfly shows “Mixed currencies” rather than adding them up.
- The amount is what the browser reported. It is not confirmed by your payment provider and can be blocked like any other event.
Stripe payment report
Separately, a site’s owner can connect a Stripe account on the Revenue page with a restricted, read-only key and a webhook endpoint that Mayfly generates. Mayfly then shows captured payments and successful refunds, by currency, for the last 7 or 30 days, in test or live mode.
This report is evidence of what Stripe recorded, not attribution: it doesn’t link payments to visits, pages or campaigns, and it starts from the day you connect. If the page says setup is not enabled, the Stripe connection isn’t available on your account yet; revenue sent with events works regardless.
Something here doesn’t match what you see? Write to kirylapps@gmail.com.