Skip to main content
pagent tracking has two layers:
  1. Events are facts your website reports: purchase, signup, add_to_cart. An event is just a label, with optional revenue and properties. Nothing has to be configured in pagent before you send one.
  2. Conversion goals decide which events count as success. You create them in the dashboard on top of events that already arrive, and attach them to tests.
Keeping the two apart means your code only describes what happened on your site. Deciding what to measure happens in pagent, and you can change it without touching your site again.
Then, in pagent, open Tracking, click New goal, choose Event goal, and pick purchase. That’s the whole setup.

Why events

  • Retroactive. An event goal is computed over every event already recorded with that label. Create a goal today on an event you have been sending for a month, and it counts from day one.
  • No coupling to the dashboard. Events are sent by label. Renaming a goal, adding a new one or archiving an old one never requires a code change on your site.
  • One event, many goals. The same purchase event can back a conversion goal, a revenue goal and a funnel step.
  • Counted in every test arm. Events are recorded for control and variants alike, so any test can measure them.

Ways to get events into pagent

Click goals and page view goals need no events at all. See Conversion goals.

Deprecated: sending conversions directly

Sending conversions for a specific goal from your code is deprecated. This covers window._pgnt.push({ kind: "conversion" }), window.pagent.track(), Programmatic goals in the dashboard, and the /v1/conversions and /v2/conversions server endpoints. They keep working, but new integrations should send events and build event goals on top of them.
The old flow required a Programmatic goal with a matching label to exist and be published before any conversion counted, and only counted from that point on. Events remove that ordering problem. See Migrating from programmatic goals for the switch.