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.Documentation Index
Fetch the complete documentation index at: https://docs.scanova.io/llms.txt
Use this file to discover all available pages before exploring further.
Syntax
event_name— a string that describes the action. Usesnake_case.metadata— an optional object with any key-value data relevant to the event. Max 10 KB.
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
Link click to external site
Choosing between custom events and auto-tracking
| Situation | Use |
|---|---|
| Track all link and button clicks with minimal setup | autoClicks: true |
| Track a specific button with custom metadata | scanova('track', ...) |
| Track all form submissions | autoForms: true |
| Track a specific form with field-level context (non-PII) | scanova('track', ...) |
| Any interaction the auto-tracker does not cover | scanova('track', ...) |
autoClicks: true plus selective custom events for high-value actions.
Event naming best practices
- Use
snake_case:cta_click, notctaClickorCTAClick - Be specific enough to be self-explanatory in reports:
signup_completedis better thancompleted - 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_identifiersfor 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)