> ## Documentation Index
> Fetch the complete documentation index at: https://www.pagent.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Sending events

> Report events from your website with window._pgnt.push

Report an event wherever the action happens in your code:

```javascript theme={"dark"}
window._pgnt = window._pgnt || [];
window._pgnt.push({ kind: "event", label: "signup" });
```

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](/docs/guides/integration/sdk-integration) 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](/docs/guides/tracking/conversion-goals) on it.

## Event fields

| Field | Type | Required | Description |
| - | - | - | - |
| `kind` | `"event"` | Yes | Always `"event"`. |
| `label` | string | Yes | The event name, for example `purchase`. See [Labels](#labels). |
| `revenue` | integer | No | Monetary value in cents: `2499` is \$24.99. See [Tracking revenue](/docs/guides/tracking/revenue). |
| `properties` | object or array | No | Extra context, for example product or plan details. |

```javascript theme={"dark"}
window._pgnt = window._pgnt || [];
window._pgnt.push({
    kind: "event",
    label: "purchase",
    revenue: 2499, // $24.99
    properties: {
        order_id: "ORD-1042",
        plan: "annual",
        items: 3
    }
});
```

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`](/docs/guides/integration/flags) 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:

```javascript theme={"dark"}
window.pagent.emit("newsletter_signup", { position: "footer" });
```

We recommend `window._pgnt.push` because it also accepts `revenue` and works before the SDK has loaded without an extra check.

## Consent

Events follow the same consent rules as every other pagent event. In the [strict consent path](/docs/guides/integration/consent) 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](/docs/guides/tracking/event-listener) 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](/docs/guides/tracking/conversion-goals#migrating-from-programmatic-goals).

```javascript theme={"dark"}
// Deprecated
window._pgnt.push({ kind: "conversion", label: "purchase", revenue: 2499 });

// Recommended
window._pgnt.push({ kind: "event", label: "purchase", revenue: 2499 });
```
