Skip to content

Web

Custom events

Track button clicks, form submissions, sign-ups or any other action — with optional data.

Events & goals: event list and goals with conversion rate
Events and goals in the "Events & goals" view (demo data).

Sending events

The tracking script provides window.trackd:

// Button click
trackd.track('signup_click', { plan: 'pro' })

// Form submission
trackd.track('contact_form', { source: 'footer' })

// File download
trackd.track('download', { file: 'whitepaper.pdf' })

Events appear in the dashboard under Events. Each event can carry an object with key-value pairs.

The website script uses trackd.track(name, data) (alias trackd.event); the app SDKs use event(name, data).

Rules for event data

  • Name: max. 200 characters.
  • Data: flat object with strings, numbers or booleans, max. 4 KB. Nested values are dropped.
  • No personal data (names, email addresses, user ids) in event names or data.

Without your own JavaScript

If you do not want to touch any code, you can also define goals via pageviews (e.g. /thank-you). See goals.

Tracking searches

An event named search with the property query shows up in the dashboard under Pages → Search (websites and apps). Searches with the term in the URL (?q=, ?s= …) are detected by the web script without an event. See Internal search.

Events in funnels and goals

Any custom event can be a funnel step or the basis of a goal. An event named purchase with a numeric amount is also recorded as revenue.

Ready in minutes

Start the 7-day free trial (no credit card), add your website or app, copy the snippet.

Start free trial