LogoLogo
  • Contributing to RudderStack
  • Destination_Name
  • LICENSE
  • RudderStack Docs
  • docs
    • FAQ
    • Identity Resolution
    • Home
    • cloud-extract-sources
      • ActiveCampaign Source
      • Bing Ads
      • Chargebee
      • Common Settings
      • Facebook Ads
      • Freshdesk
      • Google Ads Source
      • Google Analytics
      • Google Search Console
      • Google Sheets
      • Cloud Extract Sources
      • Intercom v2
      • Intercom
      • Mailchimp
      • Marketo
      • Mixpanel
      • NetSuite
      • Pipedrive
      • QuickBooks
      • Salesforce Pardot
      • Sendgrid Source
      • Stripe Source
      • Xero
      • Zendesk Chat
      • Zendesk
      • hubspot
        • HubSpot Data Model and Schema Information
        • HubSpot
      • salesforce
        • Salesforce
        • Schema Comparison: RudderStack vs. Segment
    • connections
      • Connection Modes: Cloud Mode vs. Device Mode
    • data-governance
      • Data Governance
      • RudderTyper
      • Data Governance API
      • RudderTyper
      • tracking-plans
        • Tracking Plans
        • Tracking Plan Spreadsheet
    • data-warehouse-integrations
      • Amazon Redshift
      • Azure Data Lake
      • Azure Synapse
      • ClickHouse
      • Databricks Delta Lake
      • Google Cloud Storage Data Lake
      • Google BigQuery
      • Identity Resolution
      • Warehouse Destinations
      • Microsoft SQL Server
      • PostgreSQL
      • Amazon S3 Data Lake
      • Snowflake
      • FAQ
      • Warehouse Schema
    • destinations
      • Destinations
      • Webhooks
      • advertising
        • Bing Ads
        • Criteo
        • DCM Floodlight
        • Facebook App Events
        • Facebook Custom Audience
        • Facebook Pixel
        • Google Ads (gtag.js)
        • Google AdWords Enhanced Conversions
        • Google Adwords Remarketing Lists (Customer Match)
        • Advertising
        • LinkedIn Insight Tag
        • Lotame
        • Pinterest Tag
        • Reddit Pixel
        • Snap Pixel
        • TikTok Ads
      • analytics
        • Amplitude
        • AWS Personalize
        • Chartbeat
        • Firebase
        • FullStory
        • Google Analytics 360
        • Google Analytics
        • Heap.io
        • Hotjar
        • Analytics
        • Indicative
        • Keen
        • Kissmetrics
        • Kubit
        • Lytics
        • Mixpanel
        • Pendo
        • PostHog
        • Quantum Metric
        • Singular
        • adobe-analytics
          • Adobe Analytics Heartbeat Measurement
          • Mobile Device Mode Settings
          • Web Device Mode Settings
          • E-commerce Events
          • Adobe Analytics
          • Setting Up Adobe Analytics in RudderStack
        • google-analytics-4
          • Cloud Mode
          • Device Mode
          • Google Analytics 4
          • Setting up Google Analytics 4
        • profitwell
          • ProfitWell
          • Cloud Mode
          • Device Mode
      • attribution
        • Adjust
        • AppsFlyer
        • Branch
        • Attribution
        • Kochava
        • TVSquared
      • business-messaging
        • Business Messaging
        • Intercom
        • Kustomer
        • Slack
        • Trengo
      • continuous-integration
        • Visual Studio App Center
        • Continuous Integration
      • crm
        • Delighted
        • HubSpot
        • CRM
        • Salesforce
        • Variance
        • Zendesk
      • customer-data-platform
        • Customer Data Platform
        • Segment
      • error-reporting
        • Bugsnag
        • Error Reporting
        • Sentry
      • marketing
        • ActiveCampaign
        • AdRoll
        • Airship
        • Appcues
        • Autopilot
        • Blueshift
        • Braze
        • CleverTap
        • Customer.io
        • Gainsight PX
        • Gainsight
        • Marketing
        • Iterable
        • Klaviyo
        • Leanplum
        • Mailchimp
        • Marketo Lead Import
        • Marketo
        • MoEngage
        • Ometria
        • Pardot
        • Post Affiliate Pro
        • Qualtrics
        • SendGrid
        • Salesforce Marketing Cloud
        • Userlist
        • drip
          • Cloud Mode
          • Device Mode
          • Drip
          • Setting Up Drip in RudderStack
      • productivity
        • Google Sheets
        • Productivity
      • storage-platforms
        • Amazon S3
        • DigitalOcean Spaces
        • Google Cloud Storage
        • Storage Platforms
        • Azure Blob Storage
        • MinIO
        • Redis
      • streaming-platforms
        • Amazon EventBridge
        • Amazon Kinesis Firehose
        • Amazon Kinesis
        • Azure Event Hubs
        • BigQuery Stream
        • Confluent Cloud
        • Google Pub/Sub
        • Streaming Platforms
        • Apache Kafka
      • tag-managers
        • Google Tag Manager
        • Tag Managers
      • testing-and-personalization
        • Algolia Insights
        • Candu
        • Google Optimize
        • A/B Testing & Personalization
        • LaunchDarkly
        • Monetate
        • Optimizely Full Stack
        • Optimizely Web
        • Split.io
        • Statsig
        • VWO (Visual Website Optimizer)
    • get-started
      • RudderStack Cloud vs. RudderStack Open Source
      • Glossary
      • Get Started
      • RudderStack Architecture
    • reverse-etl
      • Amazon Redshift
      • Amazon S3
      • ClickHouse
      • FAQ
      • Google BigQuery
      • Reverse ETL
      • PostgreSQL
      • Snowflake
      • common-settings
        • Importing Data using Models
        • Importing Data using Tables
        • Common Settings
        • Sync Modes
        • Sync Schedule
      • features
        • Airflow Provider
        • Features
        • Models
        • Visual Data Mapper
    • rudderstack-api
      • Data Regulation API
      • HTTP API
      • RudderStack API
      • Personal Access Tokens
      • Pixel API
      • Test API
      • api-specification
        • Application Lifecycle Events Specification
        • API Specification
        • Video Events Specification
        • rudderstack-ecommerce-events-specification
          • Browsing
          • Coupons
          • E-Commerce Events Specification
          • Ordering
          • Promotions
          • Reviewing
          • Sharing
          • Wishlist
        • rudderstack-spec
          • Alias
          • Common Fields
          • Group
          • Identify
          • RudderStack Event Specification
          • Page
          • Screen
          • Track
    • rudderstack-cloud
      • Audit Logs
      • Dashboard Overview
      • Destinations
      • RudderStack Cloud
      • Live Events
      • Connection Modes: Cloud Mode vs. Device Mode
      • Sources
      • Teammates (User Management)
      • connections
        • Adding a Destination
        • Connections
    • rudderstack-open-source
      • Control Plane Setup
      • RudderStack Open Source
      • installing-and-setting-up-rudderstack
        • Developer Machine Setup
        • Docker
        • Data Plane Setup
        • Kubernetes
        • Sending Test Events
    • stream-sources
      • App Center
      • AppsFlyer
      • Auth0
      • Braze
      • Customer.io
      • Extole
      • Event Stream Sources
      • Iterable
      • Looker
      • PostHog
      • Segment
      • Shopify
      • Webhook Source
      • rudderstack-sdk-integration-guides
        • Client-side Event Filtering
        • SDKs
        • AMP Analytics
        • Cordova
        • .NET
        • Go
        • Java
        • Node.js
        • PHP
        • Python
        • React Native
        • Ruby
        • Rust
        • Unity
        • SDK FAQs
        • rudderstack-android-sdk
          • Adding Application Class
          • Flushing Events Periodically
          • Android
        • rudderstack-flutter-sdk
          • Flutter SDK v1
          • Flutter v2
          • Flutter
        • rudderstack-ios-sdk
          • iOS
          • tvOS
          • watchOS
        • rudderstack-javascript-sdk
          • Data Storage in Cookies
          • Detecting Ad-blocked Pages
          • JavaScript
          • JavaScript SDK Enhancements
          • JavaScript SDK FAQs
          • Querystring API
          • Quick Start Guide
          • Version Migration Guide
          • consent-managers
            • Consent Managers
            • OneTrust
    • transformations
      • Access Token
      • FAQ
      • Transformations
      • Transformations API
    • user-guides
      • User Guides
      • administrators-guide
        • Troubleshooting Guide
        • Alerting Guide
        • Bucket Configuration Settings for Event Backups
        • Configuration Parameters
        • Event Replay
        • High Availability
        • Horizontal Scaling
        • Administrator's Guides
        • Infrastructure Provisioning
        • Monitoring and Metrics
        • Okta SSO Setup
        • OneLogin SSO Setup
        • RudderStack Grafana Dashboard
        • Software Releases
      • how-to-guides
        • How to Use Custom Domains
        • How to Develop Integrations for RudderStack
        • How to Configure a Destination via the Event Payload
        • How to Filter Events using Different Methods
        • How to Filter Selective Destinations
        • How to Submit a Pull Request for a New Integration
        • How-to Guides
        • How to Debug Live Destination Events
        • How to Use AWS Lambda Functions with RudderStack
        • create-a-new-destination-transformer-for-rudder
          • Best Practices for Coding Transformation Functions in JavaScript
          • How to Create a New Destination Transformation for RudderStack
        • implement-native-js-sdk-integration
          • How to Add a Device Mode SDK to RudderStack JavaScript SDK
          • How to Implement a Native JavaScript SDK Integration
        • rudderstack-jamstack-integration
          • How to Integrate RudderStack with Your JAMstack Site
          • How to Integrate Rudderstack with Your Angular App
          • How to Integrate Rudderstack with Your Astro Site
          • How to Integrate Rudderstack with Your Eleventy Site
          • How to Integrate Rudderstack with Your Ember.js App
          • How to Integrate Rudderstack with a Gatsby Website
          • How to Integrate Rudderstack with a Hugo Site
          • How to Integrate Rudderstack with Your Jekyll Site
          • How to Integrate Rudderstack with Your Next.js App
          • How to Integrate Rudderstack with Your Nuxt.js App
          • How to Integrate Rudderstack with Your Svelte App
          • How to Integrate Rudderstack with Your Vue App
      • migration-guides
        • Migrating from Blendo to RudderStack
        • Migrating Your Warehouse Destination from Segment to RudderStack
        • Migration Guides
        • Migrating from Segment to RudderStack
  • src
    • @rocketseat
      • gatsby-theme-docs
        • text
          • Home
Powered by GitBook
On this page
  • Playback
  • Playback Events
  • Playback Event Properties
  • Content
  • Content Events
  • Content Event Properties
  • Ads
  • Ad Events
  • Ad Event Properties
  • Resuming Playback
  • Video Quality
  • Events Lifecycle
  • FAQs
  • Contact Us

Was this helpful?

  1. docs
  2. rudderstack-api
  3. api-specification

Video Events Specification

Detailed technical description of the syntax and general conventions for sending events when tracking videos.

RudderStack's video specification lets you define how a customer engages with your videos and the related ad content.

This documentation lists the conventions and best practices for sending events in case of video tracking videos. It will also clarify the overall structure and classification of these events.

Not all RudderStack destinations support video tracking. Refer to the individual destination's documentation to check if it supports this feature.

This guide is organized into the following three event categories:

  • Playback

  • Content

  • Ads

Playback

The playback events are associated with the actual playback of the video content and track the information about the video player.

For example, when a customer plays a video on your app, a Video Playback Started event is sent along with a unique session_id. All subsequent events generated from this session are tied to this same session_id.

Suppose if you have a web page with two video players, you would have two separate sessions and session_id associated with them. On the other hand, two separate videos played on the same video player would still constitute a single session with two contents associated with it.

All the playback events are tracked and recorded at the session level.

Playback Events

This section details all the video playback events.

For more information on each of the properties associated with these events, refer to the Playback Event Properties section.

Video Playback Started

This event is associated with the user action of pressing the play button on the video player to initiate the video playback.

A sample event is as shown below:

{
    "action": "track",
    "event": "Video Playback Started",
    "userId": "user12345",
    "properties": {
      "session_id": "12345",
      "content_asset_ids": ["0129370"],
      "content_pod_ids": ["RudderA", "RudderB"],
      "ad_asset_id": ["ad1", "ad0"],
      "ad_pod_id": ["adRudderA", "adRudderB"],
      "ad_type": ["mid-roll", "post-roll"],
      "position": 0,
      "total_length": 300,
      "bitrate": 128,
      "framerate": 30.00,
      "video_player": "youtube",
      "sound": 68,
      "full_screen": true,
      "ad_enabled": true,
      "quality": "hd1080",
      "livestream": false
    }
}

Video Playback Paused

This event corresponds to the user action of pausing the video playback.

A sample event is as shown:

{
    "action": "track",
    "event": "Video Playback Paused",
    "userId": "user12345",
    "properties": {
      "session_id": "12345",
      "content_asset_ids": ["0129370"],
      "content_pod_ids": ["RudderA", "RudderB"],
      "position": 0,
      "total_length": 300,
      "bitrate": 128,
      "framerate": 30.00,
      "video_player": "youtube",
      "sound": 68,
      "full_screen": true,
      "ad_enabled": true,
      "quality": "hd1080",
      "livestream": false
    }
}

Video Playback Interrupted

This event is sent when the video playback stops unintentionally. Network loss, user closing the browser, redirect, etc. are some of the common reasons. You can pass the cause within the property method.

A sample event is as shown:

{
    "action": "track",
    "event": "Video Playback Interrupted",
    "userId": "user12345",
    "properties": {
      "session_id": "12345",
      "content_asset_ids": ["0129370"],
      "content_pod_ids": ["RudderA", "RudderB"],
      "position": 0,
      "total_length": 300,
      "bitrate": 128,
      "framerate": 30.00,
      "video_player": "youtube",
      "sound": 68,
      "full_screen": true,
      "ad_enabled": true,
      "quality": "hd1080",
      "livestream": false,
      "method":"network loss"
    }
}

Video Playback Buffer Started

This corresponds to the event of buffering content or an advertisement.

A sample event is as shown:

{
    "action": "track",
    "event": "Video Playback Buffer Started",
    "userId": "user12345",
    "properties": {
      "session_id": "12345",
      "content_asset_ids": ["0129370"],
      "content_pod_ids": ["RudderA", "RudderB"],
      "position": 0,
      "total_length": 300,
      "bitrate": 128,
      "framerate": 30.00,
      "video_player": "youtube",
      "sound": 68,
      "full_screen": true,
      "ad_enabled": true,
      "quality": "hd1080",
      "livestream": false
    }
}

Video Playback Buffer Completed

This corresponds to the event when the playback finishes buffering the content or an advertisement.

A sample event is as shown:

{
    "action": "track",
    "event": "Video Playback Buffer Completed",
    "userId": "user12345",
    "properties": {
      "session_id": "12345",
      "content_asset_ids": ["0129370"],
      "content_pod_ids": ["RudderA", "RudderB"],
      "position": 0,
      "total_length": 300,
      "bitrate": 128,
      "framerate": 30.00,
      "video_player": "youtube",
      "sound": 68,
      "full_screen": true,
      "ad_enabled": true,
      "quality": "hd1080",
      "livestream": false
    }
}

Video Playback Seek Started

This event is sent when a user manually seeks a certain position of the video content or an advertisement in the playback. The position property indicates where the user is seeking from (time in seconds) and the seek_position indicates the position in the playback where the user is seeking to.

A sample event is as shown:

{
    "action": "track",
    "event": "Video Playback Seek Started",
    "userId": "user12345",
    "properties": {
      "session_id": "12345",
      "content_asset_ids": ["0129370"],
      "content_pod_ids": ["RudderA", "RudderB"],
      "position": 47,
      "seek_position": 120,
      "total_length": 300,
      "bitrate": 128,
      "framerate": 30.00,
      "video_player": "youtube",
      "sound": 68,
      "full_screen": true,
      "ad_enabled": true,
      "quality": "hd1080",
      "livestream": false
    }
}

Video Playback Seek Completed

This event is sent after a user manually seeks to a certain position of the video or ad in the playback. The position property indicates where the user resumes the playback.

A sample event is as shown:

{
    "action": "track",
    "event": "Video Playback Seek Completed",
    "userId": "user12345",
    "properties": {
      "session_id": "12345",
      "content_asset_ids": ["0129370"],
      "content_pod_ids": ["RudderA", "RudderB"],
      "position": 120,
      "total_length": 300,
      "bitrate": 128,
      "framerate": 30.00,
      "video_player": "youtube",
      "sound": 68,
      "full_screen": true,
      "ad_enabled": true,
      "quality": "hd1080",
      "livestream": false
    }
}

Video Playback Resumed

This event is sent after the user resumes the video playback after it was paused.

A sample event is as shown:

{
    "action": "track",
    "event": "Video Playback Resumed",
    "userId": "user12345",
    "properties": {
      "session_id": "12345",
      "content_asset_ids": ["0129370"],
      "content_pod_ids": ["RudderA", "RudderB"],
      "position": 120,
      "total_length": 300,
      "bitrate": 128,
      "framerate": 30.00,
      "video_player": "youtube",
      "sound": 68,
      "full_screen": true,
      "ad_enabled": true,
      "quality": "hd1080",
      "livestream": false
    }
}

Video Playback Completed

This event is sent after the playback is complete and when the session is finished. Note that the position property has the same value as the total_length property.

A sample event is as shown:

{
    "action": "track",
    "event": "Video Playback Resumed",
    "userId": "user12345",
    "properties": {
      "session_id": "12345",
      "content_asset_ids": ["0129370"],
      "content_pod_ids": ["RudderA", "RudderB"],
      "position": 300,
      "total_length": 300,
      "bitrate": 128,
      "framerate": 30.00,
      "video_player": "youtube",
      "sound": 68,
      "full_screen": true,
      "ad_enabled": true,
      "quality": "hd1080",
      "livestream": false
    }
}

Playback Event Properties

All the playback events share the same properties that describe the current state of the video player.

The following table lists all the properties of this playback event object in detail:

Property

Type

Description

session_id

String

A unique ID that ties all the events generated from a specific playback session. These events include playback, content, and ad events.

content_asset_id

content_asset_ids

String

Array [String]

Content asset ID/s of the video/s playing or

about to be played.

For Video Playback Started events, an array

of unique asset IDs should be sent. For other

playback events, a singular content asset ID at the time of the event should be sent.

content_pod_id

content_pod_ids

String

Array [String]

Content pod ID/s of the video/s playing or

about to be played.

For Video Playback Started events, an array

of unique pod IDs should be sent. For other

playback events, a singular content pod ID associated with the current content pod at the time of the event should be sent.

ad_asset_id

String

Array [String]

Ad asset ID/s of the video/s playing or

about to be played.

For Video Playback Started events, an array

of unique ad asset IDs should be sent. For other

playback events, a singular ad asset ID at the time of the event should be sent.

ad_pod_id

String

Array [String]

Ad pod ID/s of the video/s playing or

about to be played.

For Video Playback Started events, an array

of unique ad pod IDs should be sent. For other

playback events, a singular content pod ID associated with the current ad pod at the time of the event should be sent.

ad_type

Enum

Denotes the type of ad playing at the time of the

event. The values can be 'pre-roll', ' mid-roll', and

'post-roll'.

position

Integer

Denotes the current index position of the playhead in seconds. It includes the duration of any seen ads. If the playback is a livestream, refer to the documentation of the relevant destination for steps on correctly passing the playhead position.

seek_position

Integer

Denotes the index position of the playhead where the

user is seeking to.

Only applicable on the Video Playback Seek Started events. On Video Playback Seek Completed events,

the seek_position should be equal to position.

total_length

Integer

Denotes the total duration of the video playback

in seconds. Includes the whole duration of all

the content and ads included in the session.

Set to null in case of a livestream playback.

bitrate

Integer

Bit rate of the video playback, denoted in kbps

framerate

Float

Denotes the average frame rate of the video playback in fps.

video_player

String

Denotes the name of the video player used for

playback. Example: youtube, vimeo, etc.

sound

Integer

Denotes the sound level of the video playback.

Range is from 0-100, where 0 represents mute

and 100 is full volume.

full_screen

Boolean

Set to true if the playback is in fullscreen mode.

ad_enabled

Boolean

Set to false if the user has any ad blockers.

If the user can view your video ads, it is set to

true.

quality

String

Specifies the quality of the video. Examples: 'hd1080', 'highres'

method

String

For the Video Playback Interrupted events, you can send this property denoting how the

playback was interrupted.

Some examples include 'device lock', 'call', and

'browser redirect'.

livestream

Boolean

Set to true in case the playback is a live stream, else set to false.

Content

A content pod refers to a part / group / segment of the video content or the advertisement within the playback.

Suppose a video playback session has a video and one mid-roll advertisement. This means that the mid-roll ad splits the playback in two separate content pods. The mid-roll ad is included within a single ad pod.

The flow is as follows:

  • User starts and completes the first content pod

  • User starts and completes the ad

  • User starts and completes the second content pod

All of these events within the flow happen within one video playback.

Content Events

This section details all the video content events.

For more information on each of the properties associated with these events, refer to the Content Event Properties section.

Video Content Started

This event is sent once the user starts playing video content segment within a playback.

A sample event is as shown:

{
    "action": "track",
    "event": "Video Content Started",
    "userId": "user12345",
    "properties": {
      "session_id": "12345",
      "asset_id": "123",
      "pod_id": "RudderA",
      "program": "Planet of the Apes",
      "title": "Introduction",
      "description": "Sample description",
      "season": "3",
      "position": 0,
      "total_length": 300,
      "genre": "Fantasy",
      "publisher": "Amazon",
      "full_episode": true,
      "keywords": ["apes", "forests", "zoo"]
    }
}

Video Content Playing

These events are sent as heartbeats every after a set interval to indicate the length of video viewed by the user, determined by the position property.

A sample event is as shown:

{
    "action": "track",
    "event": "Video Content Playing",
    "userId": "user12345",
    "properties": {
      "session_id": "12345",
      "asset_id": "123",
      "pod_id": "RudderA",
      "program": "Planet of the Apes",
      "title": "Introduction",
      "description": "Sample description",
      "season": "3",
      "position": 234,
      "total_length": 300,
      "genre": "Fantasy",
      "publisher": "Amazon",
      "full_episode": true,
      "keywords": ["apes", "forests", "zoo"]
    }
}

Video Content Completed

This event is sent once the video segment within the playback is completed. Note that the position property has the same value as the total_length property.

A sample event is as shown:

{
    "action": "track",
    "event": "Video Content Completed",
    "userId": "user12345",
    "properties": {
      "session_id": "12345",
      "asset_id": "123",
      "pod_id": "RudderA",
      "program": "Planet of the Apes",
      "title": "Introduction",
      "description": "Sample description",
      "season": "3",
      "position": 300,
      "total_length": 300,
      "genre": "Fantasy",
      "publisher": "Amazon",
      "full_episode": true,
      "keywords": ["apes", "forests", "zoo"]
    }
}

Content Event Properties

All the content events share the same properties that describe the current state of the video content that is viewed by the user during the playback.

The following table lists all the properties of this playback event object in detail:

Property

Type

Description

session_id

String

A unique ID that ties all the events generated from a specific playback session. These events include playback, content, and ad events.

asset_id

String

Denotes the unique ID of the video content asset.

pod_id

String

Denotes the unique ID of the video content pod.

title

String

Denotes the title of the video content.

description

String

Describes the video content asset in short.

keywords

Array [String]

Denotes the relevant keywords associated with the

categorizing the video content

season

String

Denotes the season number, if applicable.

episode

String

Denotes the episode number, if applicable.

genre

String

Denotes the genre of the video content asset.

program

String

Denotes the name of the program / show of which

the video content is a part.

publisher

String

Denotes the publisher / creator / author of the

video content asset.

channel

String

Denotes the channel in which the video content

is playing.

full_episode

Boolean

Set to true the video content asset is a full episode.

livestream

Boolean

If the video content is a live stream, this is set to

true.

airdate

ISO 8601

Date String

Denotes the original date of airing / publishing

the video content.

position

Integer

Denotes the current playhead position into the

video content in seconds. This does not include

any ads played in this duration.

In case of live streams, refer to the relevant destination's documentation for details on how to pass this property.

total_length

Integer

The total duration of the video content in

seconds. This does not include any ads included

in the playback of this content asset.

For livestream playback, this should be set to null.

bitrate

Integer

Denotes the current bit rate in kbps.

framerate

Float

Denotes the frame rate in fps.

Ads

Ad Events

This section details all the ad events.

For more information on each of the properties associated with these events, refer to the Ad Event Properties section.

Video Ad Started

This event is sent when an advertisement starts playing within the video playback.

A sample event is as shown:

{
    "action": "track",
    "event": "Video Ad Started",
    "userId": "user12345",
    "properties": {
      "session_id": "12345",
      "asset_id": "123",
      "pod_id": "RudderA",
      "type": "mid-roll",
      "title": "Raw is War!",
      "position": 0,
      "total_length": 25,
      "publisher": "WWE",
      "load_type": "linear"
    }
}

Video Ad Playing

This event is sent between set intervals when the video ad is playing and is determined by the position property.

A sample event is as shown:

{
    "action": "track",
    "event": "Video Ad Playing",
    "userId": "user12345",
    "properties": {
      "session_id": "12345",
      "asset_id": "123",
      "pod_id": "RudderA",
      "type": "pre-roll",
      "title": "Raw is War!",
      "position": 3,
      "total_length": 25,
      "publisher": "WWE",
      "load_type": "linear"
    }
}

Video Ad Completed

This event is sent after the user has viewed the video ad completely. Note that the position property has the same value as the total_length property.

{
    "action": "track",
    "event": "Video Ad Completed",
    "userId": "user12345",
    "properties": {
      "session_id": "12345",
      "asset_id": "123",
      "pod_id": "RudderA",
      "type": "pre-roll",
      "title": "Raw is War!",
      "position": 25,
      "total_length": 25,
      "publisher": "WWE",
      "load_type": "linear"
    }
}

Ad Event Properties

All the ad events share the same properties that describe the current state of the video ad content that a user is interacting with during the playback.

The following table lists all the properties of this playback event object in detail:

Property
Type
Description

session_id

String

A unique ID that ties all the events generated from a specific playback session. These events include playback, content, and ad events.

asset_id

String

Denotes the unique ID of the ad asset.

pod_id

String

Denotes the unique ID of the ad pod.

pod_position

Integer

Denotes the position of the ad asset relative

to other ads in the same pod.

pod_length

Integer

Denotes the number of ad assets in the current

ad pod.

type

Enum

Denotes the type of ad. Values can be either of

'pre-roll', 'mid-roll', or 'post-roll'.

title

String

Denotes the title of the ad.

publisher

String

Denotes the author/ creator/ publisher of the ad.

position

Integer

The current playhead position in relation to the

total length of the ad, in seconds.

total_length

Integer

Denotes the total length of the ad asset in seconds.

load_type

Enum

Denotes if the ads are loaded dynamically or if

they are the same for all the users. Values can be either 'dynamic' or ' linear '.

content

Object

Some destinations require the content metadata

to be sent with the ad events.

You can send all the metadata as a Content Event Object under this property.

quartile

Integer

For the Video Ad Playing event, this property

can be used to indicate when a specific ad quartile

is reached.

If you are using a client-side library to track your

video events, this property is optional as RudderStack

automatically tracks the ad quartiles.

Resuming Playback

Every Video Playback Resumed the event should be followed by a heartbeat event (Video Content Playing or a Video Ad Playing event, depending on what asset the playback resumes to.

Video Quality

RudderStack also lets you track and analyze the performance and quality of your video content during the playback.

Whenever a user changes the video quality during playback, you can track a Video Quality Updated event along with the following properties:

  • bitrate: Denotes the updated bit rate in kbps.

  • framerate: Denotes the updated frame rate in fps.

  • startupTime: Denotes the time when the video quality was changed by the user.

  • droppedFrames: Indicates if any frames were dropped during the video quality change.

Events Lifecycle

The following event flow demonstrates how you can implement the RudderStack video specification:

1. User presses play on a video player

rudderanalytics.track("Video Playback Started", {
  session_id: "12345",
  content_asset_ids: ["123"],
  content_pod_ids: ["RudderA"],
  ad_asset_ids: ["ad1"],
  ad_pod_ids: ["adRudderA"],
  ad_types: ["mid-roll"],
  position: 0,
  total_length: 300,
  bitrate: 128,
  video_player: "youtube",
  sound: 66,
  full_screen: true,
  ad_enabled: false,
  quality: "hd1080",
})

2. Video playback starts playing the content

rudderanalytics.track("Video Content Started", {
  session_id: "12345",
  asset_id: "123",
  pod_id: "RudderA",
  title: "Raw is War!!",
  description: "Sample description",
  keywords: ["wrestling", "entertainment"],
  season: "1",
  episode: "90",
  genre: "entertainment",
  program: "WWE",
  publisher: "WWE",
  position: 0,
  total_length: 300,
  channel: "ten",
  full_episode: true,
  livestream: false,
  airdate: "2020-04-23",
})

3. User views the content for 10 seconds followed by a 10 second heartbeat

rudderanalytics.track("Video Content Playing", {
  session_id: "12345",
  asset_id: "123",
  pod_id: "RudderA",
  title: "Raw is War!!",
  description: "Sample description",
  keywords: ["wrestling", "entertainment"],
  season: "1",
  episode: "90",
  genre: "entertainment",
  program: "WWE",
  publisher: "WWE",
  position: 10,
  total_length: 300,
  channel: "ten",
  full_episode: true,
  livestream: false,
  airdate: "2020-04-23",
})

4. Video playback is paused

rudderanalytics.track("Video Playback Paused", {
  session_id: "12345",
  content_asset_id: "123",
  content_pod_id: "RudderA",
  ad_asset_id: null,
  ad_pod_id: null,
  ad_type: null,
  position: 11,
  total_length: 300,
  video_player: "youtube",
  sound: 66,
  bitrate: 128,
  full_screen: true,
  ad_enabled: false,
  quality: "hd1080",
})

5. User resumes the video playback.

rudderanalytics.track("Video Playback Resumed", {
  session_id: "12345",
  content_asset_id: "123",
  content_pod_id: "RudderA",
  ad_asset_id: null,
  ad_pod_id: null,
  ad_type: null,
  position: 11,
  total_length: 300,
  video_player: "youtube",
  sound: 66,
  bitrate: 128,
  full_screen: true,
  ad_enabled: false,
  quality: "hd1080",
})

6. Ad (mid-roll) starts playing after user resumes playback

rudderanalytics.track("Video Ad Started", {
  session_id: "12345",
  asset_id: "ad1",
  pod_id: "adRudderA",
  type: "mid-roll",
  title: "Thums Up",
  publisher: "Coca Cola",
  position: 0,
  total_length: 15,
  load_type: "linear",
})

7. User watches the complete 15 second advertisement. RudderStack also tracks the 10 second heartbeats.

rudderanalytics.track("Video Ad Playing", {
  session_id: "12345",
  asset_id: "ad1",
  pod_id: "adRudderA",
  type: "mid-roll",
  title: "Thums Up",
  publisher: "Coca Cola",
  position: 10,
  total_length: 15,
  load_type: "linear",
})

8. Video ad plays completely.

rudderanalytics.track("Video Ad Completed", {
  session_id: "12345",
  asset_id: "ad1",
  pod_id: "adRudderA",
  type: "mid-roll",
  title: "Thums Up",
  publisher: "Coca Cola",
  position: 15,
  total_length: 15,
  load_type: "linear",
})

9. Video content resumes playing. Heartbeats are sent every 10 seconds.

rudderanalytics.track("Video Content Playing", {
  session_id: "12345",
  asset_id: "123",
  pod_id: "RudderA",
  title: "Raw is War!!",
  description: "Sample description",
  keywords: ["wrestling", "entertainment"],
  season: "1",
  episode: "90",
  genre: "entertainment",
  program: "WWE",
  publisher: "WWE",
  position: 11,
  total_length: 300,
  channel: "ten",
  full_episode: true,
  livestream: false,
  airdate: "2020-04-23",
})

10. User finishes watching the entire video content.

rudderanalytics.track("Video Content Completed", {
  session_id: "12345",
  asset_id: "123",
  pod_id: "RudderA",
  title: "Raw is War!!",
  description: "Sample description",
  keywords: ["wrestling", "entertainment"],
  season: "1",
  episode: "90",
  genre: "entertainment",
  program: "WWE",
  publisher: "WWE",
  position: 300,
  total_length: 300,
  channel: "ten",
  full_episode: true,
  livestream: false,
  airdate: "2020-04-23",
})

11. Video playback finishes.

rudderanalytics.track("Video Playback Completed", {
  session_id: "12345",
  content_asset_id: null,
  content_pod_id: null,
  ad_asset_id: "ad1",
  ad_pod_id: "adRudderA",
  ad_type: null,
  position: 300,
  total_length: 300,
  sound: 66,
  bitrate: 128,
  full_screen: true,
  video_player: "youtube",
  ad_enabled: false,
  quality: "hd1080",
})

FAQs

What are pre-roll, mid-roll, and post-roll ads?

  • Ads that appear before the start of the video playback are called pre-roll ads.

  • Ads that appear in the middle of the playback are mid-roll ads.

  • Ads that appear after the video playback are called post-roll ads.

These ads can be a promotional video by the sponsors or a piece of content offered by the content provider.

Contact Us

PreviousAPI SpecificationNextrudderstack-ecommerce-events-specification

Last updated 3 years ago

Was this helpful?

For more information on the RudderStack video spec, feel free to . You can also start a conversation in our community.

contact us
Slack