Track video ad events to measure ad engagement and enable ad-based cohort qualification.Documentation Index
Fetch the complete documentation index at: https://docs.permutive.com/llms.txt
Use this file to discover all available pages before exploring further.
Tracking Ad Events
IMA Integration
Overview
The three schema events for ad tracking are:| Event | When to emit |
|---|---|
VideoAdView | Ad playback begins |
VideoAdCompletion | Ad finishes playing |
VideoAdClicked | User clicks the ad |
ad.* properties (and optionally a video.* parent for the content the ad ran against). See the schema reference below.
Tracking Ad Events
VideoAdView
Emit when the ad begins playback:VideoAdCompletion
Emit when the ad finishes:VideoAdClicked
Emit when the user clicks through:Skipped or errored ads: the schema defines only
VideoAdView, VideoAdCompletion, and VideoAdClicked. Treat a skip as no completion event (no VideoAdCompletion). If you need to capture skip/error signals for your own analytics, use a custom event name and document it in your workspace schema.Combining with Content Tracking
Pause the content video tracker during ad breaks so engagement time isn’t counted twice:Google IMA Integration
HookIMAAdsManagerDelegate events to emit Permutive ad events:
IMA’s
adId is the line-item / ad reference. Map it to whichever Permutive schema field reflects your taxonomy (campaign_id shown here, but use creative_id if that’s a closer match).Schema Reference
The canonical schema for ad events is defined in CTV Video Tracking. Summary:| Property | Type | Description |
|---|---|---|
ad.title | String | Ad title |
ad.duration | Int | Ad duration in seconds |
ad.muted | Bool | Whether the ad was muted |
ad.campaign_id | String | Campaign identifier |
ad.creative_id | String | Creative identifier |
VideoAdCompletion, the SDK does not auto-aggregate engagement on iOS (no native ad tracker means no aggregations.VideoAdEngagement.* enrichment) — emit only the ad.* properties.
tvOS Considerations
tvOS Note: Ad tracking on tvOS uses the same
Permutive.shared.track(event:properties:) API. Use it from your TVMLKit or UIKit video player.Best Practices
- Do
- Don't
- Emit
VideoAdViewonly when the ad is actually visible / playing - Nest all ad properties under an
adparent (e.g.,ad.title, not flatad_title) - Use the canonical event names —
VideoAdView,VideoAdCompletion,VideoAdClicked - Pause the content
MediaTrackerduring ad breaks so content engagement isn’t inflated - Pass duration in seconds (Int), not milliseconds
Troubleshooting
Ad events not appearing
Ad events not appearing
Problem: Ad events do not show in the Permutive dashboard.Solutions:
- Confirm
Permutive.configure(...)ran beforetrack(...)is called - Verify event names match:
VideoAdView,VideoAdCompletion,VideoAdClicked - Check that
ad.*property nesting matches your workspace schema - Enable debug logging and watch for schema validation errors
Events rejected for schema mismatch
Events rejected for schema mismatch
Problem: Logs show events being rejected.Solutions:
- Ensure all properties are nested under
ad(not at the top level) - Check property types —
durationmust be Int,mutedmust be Bool - Verify the event name spelling exactly matches the schema
Targeting not applied to ad requests
Targeting not applied to ad requests
Problem: Permutive targeting does not appear on GAM ad requests.Solutions:
- Call
googleCustomTargeting(adTargetable:)before the ad request - Pass an active
MediaTrackerorPageTrackerasadTargetableso targeting reflects the current session - Confirm the targeting dictionary is applied to the
GAMRequest
Related Documentation
Video Tracking
Track video content
CTV Video Schema
Canonical event and property reference
Google Ad Manager
GAM integration
Event Tracking
Custom event tracking