Custom Events
Custom events allow you to fire tracking pixels in third-party platforms (Adobe, DV360, etc.) based on specific interactions within the creative. This is useful for measurement, attribution, and building audiences based on user responses.
Setting up custom events
There are two ways to add custom event tracking:
Per-component tracking
From the Flow canvas, open a component's context menu and select Tracking. Paste a tracking tag (pixel URL or script snippet) that fires when that component is displayed.
This is ideal for tracking specific moments — for example, firing a pixel when the user reaches a particular choice or goal component.
Script component
Add a Script component to the flow. This executes custom JavaScript at a specific point in the interaction, giving full control over when and how tracking fires.
This is ideal for complex tracking logic, conditional events, or integrations that require JavaScript execution rather than a simple pixel.
Additional metrics can be sent to Cavai using ANALYTICS.sendMetric(name, value, aggregator) inside custom script
name is name of metric. It can be whatever chosen, but must contain only letters, numbers, _ and be shorter than 64 letters value is a number, boolean, or string value for the given metric
aggregator is aggregation strategy. For example max, sum, or flag (alias to max). It defaults to flag for booleans and sum for numbers. For string values, aggregator is ignored (always sum).
String values count occurrences of each distinct value. For example, sendMetric('button_clicked', 'header') creates a counter named button_clicked__header that increments by 1 each time it is called. String values must contain only letters, numbers, and _, and be at most 64 characters.
WARNING
Pre-bucket high-cardinality sources (URLs, free text) into a fixed set of values before passing them as string metrics. Values that do not match the allowed characters are rejected.
Example usages:
ANALYTICS.sendMetric('video_1_click', true) // If video 1 was clicked on
ANALYTICS.sendMetric('video_1_click', true, 'sum') // Count video 1 clicks
ANALYTICS.sendMetric('total_clicks', 10) // Nr of clicks on creative itself
ANALYTICS.sendMetric('max_time_interactive', 15, 'max') // Maximum time creative has been interacted with
ANALYTICS.sendMetric('button_clicked', 'header') // Count clicks on "header" button (creates button_clicked__header counter)
ANALYTICS.sendMetric('selected_category', 'sports') // Count how many sessions selected "sports" categoryTagging checklist
- Create tracking tags according to your platform's specification (e.g. Adobe, DV360)
- Set up macros according to the SSP, DSP, or publisher specification
- Add tracking to the creative via component tracking or Script components
- Generate the tag from the Delivery tab
- Test the creative tag in a staging environment
- Go live
Impression pixels
For impression-level tracking (fires on every creative load, not tied to a specific interaction), use the impression pixel options in the Delivery tab instead.
TIP
For managed customers, Cavai handles everything from step 2 onwards.