Web analytics

Custom events

Count the actions that matter, such as a sign-up or a played video, and break them down by properties in the Goals card.

Call track for the actions you want to count, such as signup_completed. To break an event down in the dashboard, pass a flat object of properties as the second argument.

Track an event

window.logdash?.track('video_played', {
  quality: '1080p',
  autoplay: true,
  chapter: 2,
});

Event names match [a-z][a-z0-9_]{0,63}: lowercase, starting with a letter, with underscores between words.

Properties

RuleLimit
Properties per eventAt most 10.
KeysMatch [a-z][a-z0-9_]{0,39}.
ValuesStrings, numbers or booleans. They are stored as strings, trimmed and cut to 100 characters, so 2 and true become "2" and "true".
Dropped valuesA value that contains @ or a control character is dropped, so an email address is never stored by mistake.
Distinct valuesEach property keeps up to 500 distinct values per site within your retention period. Later values are counted as (other).
Keys per siteUp to 50. Properties with further keys are dropped.
  • Invalid properties are dropped with one console warning per page load, and the event is still sent. The API checks every request against the same rules.
  • Only custom events carry properties. pageview, pageleave and browser_error never do.

Never put emails, names, user IDs, purchase details or other personal data in event names or properties. Properties describe what happened, such as a quality, a theme or a variant, never who did it. Use identify for the signed-in user.

Goals

Custom events are the goals you pick in the toolbar, and each one appears in the Goals card under Details. Click it to see its trend through the day, with completions, visits, people and a breakdown by each property.

Clicking a property value keeps only the events with that value, and narrows the other reports to the visitors who sent it. How goals are counted is described in Read the dashboard.

Events from servers and apps

The same events can come from your backend, a desktop app or a CLI. See Events from your apps.