Documentation

Custom events

Pageviews only tell part of the story. Custom events let you track the actions that matter — signups, checkouts, clicks — and tie them to your traffic sources.

Track an event

Call track() with an event name and optional properties. Properties are string key/value pairs you can use to segment events later.

Track events

// The script tag exposes the tracker on window.__dtc
window.__dtc.track('signup_completed', { plan: 'pro' });

window.__dtc.track('button_click', { button: 'cta-hero' });

Event naming

Use short, consistent snake_case names like signup_completed or checkout_started. A stable naming scheme keeps your dashboard readable as you add more events.

Identify users

Call identify() to associate events with a user. All subsequent events in the session are attributed to that user ID, so you can follow a visitor across anonymous browsing and signed-in usage.

Identify users

window.__dtc.identify('user-42', { plan: 'pro' });

Privacy first

Pass your own internal user ID — never an email address or other personal data. Traits are optional string key/value pairs.