---
title: Track a custom event
description: Count signups, purchases and other actions on your website.
aliases: [events, br-track, br-track-value, trackEvent]
---

Custom events need the [script](/docs/analytics/install) on the page. To send them from your backend instead, see [Send events from your server](/docs/analytics/server-events).

## From an element

Add `br-track` with the event name to anything people click:

```html
<button br-track="signup">Sign up</button>
```

Add `br-track-value` to send a number with it, such as an order total:

```html
<button br-track="purchase" br-track-value="49.90">Buy</button>
```

A click on anything inside the element counts too.

## From JavaScript

```js
blueradar.trackEvent("signup")
blueradar.trackEvent("purchase", 49.9)
```

`blueradar` exists once the script has loaded. If your code can run before that, guard the call:

```js
window.blueradar?.trackEvent?.("signup")
```


## Names and values

- A name is 1 to 64 letters, digits, `_`, `.`, `:` or `-`, and does not start with `__`. Events with any other name are dropped.
- A value is a number. [Custom charts](/docs/analytics/goals-and-charts) can sum or average it.
- Each event counts toward your monthly events, like a pageview. See [Billing](/docs/account/billing).

## See your events

Events appear in the **Events** block of the website's report. Pick one as the website's [goal](/docs/analytics/goals-and-charts), or chart it.
