YouTube

  • Embed YouTube’s video player into your site to showcase your video content

  • Automatically collect YouTube video analytics data using Segment’s plugin

  • Send your video data to tools for analytics like Chartbeat and Adobe Heartbeat with just a few clicks

  • Analyze which videos drive down-funnel engagement, retention, and revenue by combining video data with other website interactions

  • (YouTube is available as a plugin for Javascript sources in Segment.)

YouTube

How YouTube Works

When you embed the YouTube video player in a webpage it will generate event data as customers interact with content, and maintain these events along with detailed properties about the interactions in the browser cache (e.g. video playing/paused, video length, current position).

In order to get access to the raw video event data through the YouTube Player API, you will need to write and deploy additional Javascript code to your web application that specifies each event or property you wish to collect. Additionally, the code would need to detail where any collected data should be routed, such as to supported analytics tools or data warehouses. The new code snippet needs to be inserted into each page where you have a video player. Your custom functions will then listen for YouTube Player events and carry out your conditional code logic.

YouTube

Get more out of YouTube with Segment

If you are already using Segment, getting started with YouTube Analytics is easy because analytics.js is able to collect and route video event data for you without the need for customization. When you initialize the YouTube plugin, which requires only three lines of code, the plugin will listen to your YouTube player for events and respond by firing the corresponding Segment Video Spec events on analytics.js.

Segment will automatically collect events and properties according to the Video Spec, which comes pre-configured to collect most data related to playback and content.  

Events

  • Video Playback Started

    • If playing a single video, this will fire when the video starts

    • If playing a playlist, this will fire when the first video in the playlist starts

  • Video Playback Completed

    • If playing a single video, this will fire when the video finishes

    • If playing a playlist, this event will fire when the final video in the playlist finishes

  • Video Playback Paused/Resumed

  • Video Playback Buffer Started/Completed

  • Video Playback Seek Started/Completed

  • Video Content Started/Completed

    • For playlists, these events get fired for each individual video

Events come with the following properties automatically populated:

For ‘Playback’ Events

  • Total Length

  • Position

  • Quality

  • Video Player

  • Sound

For ‘Content’ Events

  • Title

  • Description

  • Keywords

  • Channel

  • Airdate

  • Duration

Similar integrations

View all integrations

Integrate YouTube with Segment

Segment makes it easy to set up YouTube.