> AI agents: this is one page of nextanalytica's docs. The full index for agents: https://nextanalytica.app/llms.txt

# Custom events

> Send your own events and orders, such as sign-ups, demo requests and purchases, with one line of JavaScript each, so revenue ties to the visit.

Updated: 2026-11-17

A custom event is something only your site knows happened: a sign-up, a demo request, a purchase. The tag can't guess these, so you tell it. Send events with `track`, and orders with `order`, so revenue ties to the visit it came from.

## Send an event

```js
window.nextanalytica.track("signup_completed", { plan: "team" });
```

- Name events in `snake_case`, after what happened: `demo_requested`, `trial_started`.
- Add up to **10** properties. Never put an email, a name or other personal details in them.
- Give it a value when it's worth money: `track("lead", {}, { value: 50, currency: "EUR" })`.

## Record an order

```js
window.nextanalytica.order({ ref: "A-10492", value: 129.9, currency: "EUR" });
```

`ref` is your order's reference; the same order sent twice counts once.

## Can you count a click without code?

Yes. Mark any element with `data-na-event`, and a click on it counts as that event:

```html
<button data-na-event="pricing_cta">Start free</button>
```

## How does an event become a conversion?

A conversion is an event that counts as a win for the site. Ask your agent ("Count signup_completed and a sent contact form as conversions"); it calls `set_conversions` after you agree. Owners and admins can set them.

## Next steps

- [Identify people](/docs/tracking/identify-people)
- [Tag JavaScript API](/docs/reference/tag-api): every method and argument.

Canonical address: https://nextanalytica.app/docs/tracking/custom-events
