# Send your own events

> Count things people do with one line of code, with details and revenue, and use them in goals.

Source: https://docs.bifrostorbit.com/insights/developers/send-events/

Once the script is on the page, `insights.track` sends an event:

```js
insights.track('Signed up', { plan: 'growth' });
```

- The **name** is how the event is shown and how goals find it, so use plain words, such as `Signed up` or `Brochure requested`. Up to 120 characters.
- The **details** are optional: up to 30, each named in up to 64 characters, with text of up to 500 characters, a number or true or false. A batch with an event over these limits is refused as a whole, so keep details short. Don't send names, email addresses or other personal data.

## Before the script has loaded

The script loads with `defer`, so `insights` may not exist yet when your code runs. Queue the call instead, and the script sends it once it loads:

```js
window.insights = window.insights || { q: [] };
window.insights.q.push(['track', 'Brochure requested', { trip: 'lofoten-ski-touring' }]);
```

Or call `window.insights?.track(…)` where losing an event before the script loads doesn't matter.

## From a server

For things that happen on a server, such as a payment confirmed by your payment provider, send the event to the [server API](https://docs.bifrostorbit.com/insights/developers/server-api/) instead. It needs no browser, so it also counts what an ad blocker would hide.

## Revenue

Add revenue and its currency as a third argument:

```js
insights.track('Order placed', { items: 3 }, { revenue: 49, currency: 'EUR' });
```

Goals that use the event then show the revenue as their value. Use the three-letter currency code, in capitals, of the money the visitor paid in. Revenue can't be negative and always needs its currency. Revenue is added up per currency and never converted, so a shop that sells in euros and pounds sees both totals.

## See your events

**Events** in Insights Orbit lists every event with how often it was sent, by how many visitors and in how many visits. Open one to see its details and how often each value came up.

Automatic events, such as **Outbound link** and **Form sent**, show up there too, marked **Automatic**.

## Turn an event into a goal

Under **Goals**, choose **Sends an event** and give the event's name, optionally with a detail that has to match. See [Set up goals](https://docs.bifrostorbit.com/insights/everyone/goals/).

## Signed-in people

On the Enterprise plan, a website where people sign in can attach its own user id to events with `insights.identify`. See [Send user ids for known users](https://docs.bifrostorbit.com/insights/developers/known-users/).
