Custom Events
Custom events let you track specific user interactions beyond pageviews - signups, purchases, downloads, button clicks, and anything else that matters to your product.
Tracking events
Script tag API
The tracking script exposes a global moneat object:
moneat.track('Signup', { plan: 'pro' })
moneat.track('Download', { file: 'whitepaper.pdf' })
moneat.track('Purchase', { amount: '49.99', currency: 'USD' })NPM package API
import { trackEvent } from '@moneat/analytics'
trackEvent('Signup', { plan: 'pro' })
trackEvent('Download', { file: 'whitepaper.pdf' })
trackEvent('Purchase', { amount: '49.99', currency: 'USD' })Event structure
Each custom event consists of:
| Field | Type | Required | Description |
|---|---|---|---|
| Event name | string | Yes | A descriptive name for the action (e.g., Signup, Purchase) |
| Properties | Record<string, string> | No | Key-value pairs providing additional context |
Naming conventions
Choose clear, consistent event names:
// Good - descriptive, consistent casing
moneat.track('Signup')
moneat.track('Add to Cart')
moneat.track('Purchase')
moneat.track('Download Whitepaper')
// Avoid - inconsistent, too generic
moneat.track('click')
moneat.track('btn_click_signup_v2')
moneat.track('event1')Custom properties
Properties let you attach metadata to events for richer analysis:
moneat.track('Signup', {
plan: 'pro',
source: 'pricing-page',
})
moneat.track('Purchase', {
amount: '49.99',
currency: 'USD',
plan: 'enterprise',
})
moneat.track('Feature Used', {
feature: 'dark-mode',
context: 'settings',
})Property values are always strings. Properties are stored as a Map<String, String> in ClickHouse and can be used in filters.
Viewing events in the dashboard
Custom events appear in the Events tab of the analytics breakdown tables. Each event shows:
- Event name - The name passed to
track() - Visitors - Unique visitors who triggered this event
- Occurrences - Total number of times the event was triggered
Click any event name to filter the dashboard to sessions that included that event.
Use cases
Conversion tracking
Track key business actions to measure conversion rates:
// Landing page
moneat.track('View Pricing')
// Signup flow
moneat.track('Start Signup')
moneat.track('Complete Signup', { plan: 'pro' })
// Purchase
moneat.track('Start Checkout')
moneat.track('Complete Purchase', { amount: '99', plan: 'pro' })Combine with Funnel Analysis to measure drop-off between steps.
Feature adoption
Track which features users engage with:
moneat.track('Feature Used', { feature: 'export-csv' })
moneat.track('Feature Used', { feature: 'dark-mode' })
moneat.track('Feature Used', { feature: 'team-invite' })Content engagement
Measure how users interact with content:
moneat.track('Download', { file: 'whitepaper.pdf', category: 'resources' })
moneat.track('Video Play', { title: 'Product Demo', duration: '120' })
moneat.track('Scroll Depth', { depth: '75' })A/B testing events
Track variant exposure and conversion. If the variant is served by a feature flag, send the same variant name here so exposure and outcome line up on one event:
moneat.track('Experiment Viewed', {
experiment: 'pricing-redesign',
variant: 'B',
})
moneat.track('Experiment Converted', {
experiment: 'pricing-redesign',
variant: 'B',
})Limits
- Event name: Maximum 200 characters
- Property keys: Maximum 100 characters each
- Property values: Maximum 500 characters each
- Properties per event: Maximum 20 key-value pairs
- Analytics usage is governed by the pageview and budget limits on your plan. See Billing & Plans for current limits.