Skip to main content
Report an event wherever the action happens in your code:
The first line makes the call safe before the SDK has loaded: events pushed early are queued and sent once the SDK starts. The SDK must be installed on the page. There is no setup step in pagent. The first time a label arrives, it shows up under Tracking → Sources → Events with the source Reported. From there you can build a conversion goal on it.

Event fields

An event with an empty label, a non-integer revenue, or properties that is neither an object nor an array is dropped. With ?pagent_debug=1 the SDK logs why in the console.

Labels

The label is the key goals and funnels are built on, so pick names you will keep.
  • pagent trims the label, lowercases it and replaces spaces with underscores: Add To Cart arrives as add_to_cart.
  • After that, only lowercase letters, digits and _ . : - are allowed, up to 120 characters. Events with other characters are dropped.
  • A website can have up to 200 distinct event labels. Events with new labels beyond that are dropped, so do not put IDs or other variable values into the label. Use properties for those.
  • A label cannot be renamed once recorded. You can give it a friendlier Display name under Tracking → Sources → Events → Edit definition.
Good labels describe the action, not the page or the test: signup, add_to_cart, checkout_started, demo_booked.

Shorthand

window.pagent.emit(label, properties) sends the same event without revenue:
We recommend window._pgnt.push because it also accepts revenue and works before the SDK has loaded without an extra check. Events follow the same consent rules as every other pagent event. In the strict consent path they are held in memory until the visitor opts in.

Checking your events

  1. Open your site with ?pagent_debug=1 and trigger the action. The console shows Pushing event (event).
  2. Listen on the pagent:event bus to see the enriched event, including its session and URL.
  3. In pagent, open Tracking → Sources → Events. The label appears with its source, the last 30 days of volume and when it was last seen.

Replacing programmatic conversions

If your site sends kind: "conversion", change the kind to "event" and keep the label. Then create an event goal on it. The full steps are in Migrating from programmatic goals.