Skip to main content
Custom events let you track specific user actions that matter to your business — beyond what auto-tracking captures. You define the event name and the metadata, and the SDK sends it with full QR attribution attached automatically.

Syntax

  • event_name — a string that describes the action. Use snake_case.
  • metadata — an optional object with any key-value data relevant to the event. Max 10 KB.
You can call scanova('track', ...) at any point after scanova('init', ...) runs — from event listeners, async callbacks, or any other JavaScript context.

Examples

Button click

Track when a user clicks a specific call-to-action:

Sign-up completed

Send this after your sign-up form submission is confirmed (client-side):
For purchase or sign-up confirmations that happen server-side, use Server Events instead. Server events are more reliable and cannot be blocked by browser extensions.

Video engagement

Product interaction

Tab or accordion interaction

Choosing between custom events and auto-tracking

You can use both together — autoClicks: true plus selective custom events for high-value actions.

Event naming best practices

  • Use snake_case: cta_click, not ctaClick or CTAClick
  • Be specific enough to be self-explanatory in reports: signup_completed is better than completed
  • Be consistent: pick one name and stick to it. Changing event names later fragments your historical data
  • Do not include user-identifying information in the event name

Metadata best practices

  • Keep metadata flat where possible — deeply nested objects are harder to query
  • Max object size: 10 KB
  • Max nesting depth: 5 levels
  • Never include raw email addresses, phone numbers, or other PII — use server events with user_identifiers for that
  • Use stable keys — changing key names later fragments your data

When to use server events instead

Use Server-Side Events rather than custom browser events when:
  • The action happens on your server (payment confirmation, CRM creation, email verification)
  • You need to pass a conversion value (order total, subscription price)
  • You want to include hashed user identifiers for identity matching
  • You need guaranteed delivery (server events cannot be blocked by ad blockers)