Which channel brings the customers who pay?
Rank marketing channels by the buyers they bring instead of visits, with first or last touch, revenue per channel, campaigns and Google Ads cost per buyer.
Short answer
Create a goal under Goals, choose the event that marks a purchase, and give it the Purchase role. MIRA FIVE then counts buyers, revenue per currency and the time from a person's first visit to their first purchase.
You want to know who paid, how much, and how long it took them to decide. That is conversion tracking, and in MIRA FIVE it starts with a goal: an event you already send, marked as the outcome that counts. Set it up once, and buyers, revenue and time to purchase appear across every screen.
A goal is an action with a role. An action gives a name to a set of events, such as every order_paid
event. The role says what reaching it means:
| Role | What it means | Example |
|---|---|---|
| Purchase | Someone bought. It makes them a customer and carries the revenue. | Order paid, paid plan started |
| Conversion | A result that counts. | Signed up, booked a demo |
| Intent | A sign that someone is close to buying. | Viewed pricing |
A project has one purchase goal. It decides who counts as a buyer on the Overview, in Acquisition and in People. An intent goal fills the High intent list in People: people who showed intent in the last 14 days and have not bought yet.
Pick the event that fires when money moves: the paid order, the first paid invoice, the started subscription. Send it from your server where you can. A server event arrives even when a browser blocks scripts, and retries are de-duplicated, so a purchase counts once.
With the Node.js SDK, @mirafive/sdk-server, and the secret key of a server source, it looks like this:
import { Mira } from '@mirafive/sdk-server'
const mira = new Mira({ key: process.env.MIRAFIVE_SECRET_KEY })
mira.track('order_paid', {
userId: order.customerId,
properties: { revenue: 328, currency: 'EUR' },
})The user id is your own id for the customer. When the browser linked a signed-in visitor to the same id,
the purchase lands on that person, together with their first visit and the channel that brought them.
For a payment webhook that may arrive twice, send(events, { idempotencyKey }) makes it count once.
Laravel sends the same event with Mira::track('order_paid', userId: …, properties: [...]); the
Next.js, Nuxt and Laravel setups show each framework. The
server-side guide covers PHP and plain HTTP too.
MIRA FIVE reads revenue from the event’s revenue property. If your events carry the amount somewhere
else, such as value, name that property in the goal. After a change, past events are read again within
a minute or two.
Send a currency with every amount, as a three-letter code like EUR. Revenue is kept per currency and
never summed across currencies, so a shop that sells in euros and francs sees two totals.
Time to purchase runs from a person’s first visit to their first purchase. The goal’s page groups buyers into under 1 hour, 1 hour to 1 day, 1 to 7 days, 1 week to 1 month and over 1 month, and shows the median.
In the sample shop, the goal “Order paid” has 138 buyers, €21,582 in revenue and a 13% conversion rate. The median buyer took 10 days from first visit to purchase. Half of them took that long or longer, so they paid on a later visit than the one that brought them. That is why the funnel guide counts by person.
track or from your server with the SDK.order_paid. Add a condition if only some of those
events count.revenue;
otherwise enter the property that holds the amount.The Goals and revenue page shows what each screen answers.
Rank marketing channels by the buyers they bring instead of visits, with first or last touch, revenue per channel, campaigns and Google Ads cost per buyer.
Build a conversion funnel of two to six steps, see where buyers drop out between them, and open the people who stopped. Counted by person or by visit.
First touch credits the channel that found a customer, last touch the one that brought them back. When to use which, with one worked example.