Skip to content

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 number or boolean value of 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

Example usages:

ts
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

Tagging checklist

  1. Create tracking tags according to your platform's specification (e.g. Adobe, DV360)
  2. Set up macros according to the SSP, DSP, or publisher specification
  3. Add tracking to the creative via component tracking or Script components
  4. Generate the tag from the Delivery tab
  5. Test the creative tag in a staging environment
  6. 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.