Skip to content
Blue Radar

Track a custom event

Count signups, purchases and other actions on your website.

Custom events need the script on the page. To send them from your backend instead, see Send events from your server.

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 can sum or average it.
  • Each event counts toward your monthly events, like a pageview. See Billing.

See your events

Events appear in the Events block of the website's report. Pick one as the website's goal, or chart it.