How to set up a purchase goal

4 min read

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.

What is a goal in MIRA FIVE?

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.

Which event should mark the purchase?

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.

Where does the revenue come from?

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.

How long do people take to buy?

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.

How to do it in MIRA FIVE

  1. Send the purchase event, from the browser with track or from your server with the SDK.
  2. Open Goals and choose New goal.
  3. Under What counts, pick the event, for example order_paid. Add a condition if only some of those events count.
  4. Under Goal, choose Purchase. Leave Revenue property empty when your events send revenue; otherwise enter the property that holds the amount.
  5. Save the goal. It reads your history too, so every report counts from the new definition at once.
  6. Open the goal’s page to see who reached it, where they first came from and how long they took.
  7. Add a Conversion goal for sign-ups and an Intent goal for pricing views. Together they make a funnel from first visit to paid plan.

The Goals and revenue page shows what each screen answers.

What this leaves out

  • A project that collects only without consent counts conversions and visits. Who reached the goal, where they came from and how long it took need visitors who consented.
  • Revenue is the amount your events carry. Your shop or billing system stays the record for refunds and tax.

Questions and answers

What is the difference between a goal and an action?
A goal is an action with a role. An action names a set of events; the role, Purchase, Conversion or Intent, makes it an outcome that every report counts as a result.
Which property does MIRA FIVE read revenue from?
The event's revenue property, unless the goal names another one, such as value. After you change it, past events are read again within a minute or two.
What happens with orders in different currencies?
They stay apart. Revenue is shown per currency and never summed across currencies, so euros and dollars each keep their own total.
Can a project have more than one purchase goal?
No. A project has one purchase goal, and it decides who counts as a customer. Sign-ups, booked demos and trials become Conversion goals.

Read next

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.

How to find where buyers drop out

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 vs. last touch attribution

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.

Related terms

All guides

See which channel brings buyers

Free for 25,000 events a month. No card needed.