Sign inGet started
Tracking

Custom events

View as MarkdownOpen in ChatGPTOpen in Claude
Connect your agent
Add to CursorAdd to VS Code

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

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

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

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:

<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