Skip to content

Metrics and events

The facts your site reports. Metrics are kinds of facts; events are single reports of them.

Everything in Luk Quest starts with something a user did. Your site reports it, and Luk Quest takes it from there.

Metrics: what you can report

A metric is a kind of fact, named the way your team talks about it: purchase.amount, lesson.completed, workout.minutes. You define each metric once in the studio, with three choices:

  • Value type: a count (whole numbers), a decimal (amounts like 42.50) or text (like a product category).
  • How values add up: the sum, the number of events, the number of distinct values, the highest value, or the latest one.
  • Accept from browsers: off by default. Turn it on only for facts a user may report about themselves, like "watched the intro video".

Metrics are data. Players never see them.

Events: one report each

An event is one report of a metric for one player: player 42 · purchase.amount · 30 · order-981. Besides the value, an event can carry a target (which product or lesson it was about) and a few attributes (like category: shoes) that tasks can filter on.

{ "player": "user-42", "metric": "purchase.amount", "value": "30.00", "id": "order-981" }

Safe to send twice

Give each event your own id, like the order number. If your server sends the same event again after a timeout, Luk Quest recognises it and answers as before, so nothing is counted or paid twice. If a refund or a mistake changes the facts, send a correction: Luk Quest takes back what the original event earned.

Where events come from

Most events come from your server, signed with a secret key, because your server knows what really happened. Metrics marked accept from browsers can also come from the browser snippet, for the signed-in player only.

Tip: start with the few metrics your product already tracks for analytics. You can add more at any time; quests only use what they need.

Next: tasks turn metrics into steps players understand.

Your first quest takes minutes

Create an account and a project, add the example setup, and send a test event. No credit card, no SDK to install first.

Start free