Skip to contentSkip to navigationSkip to topbar
On this page
Looking for more inspiration?Visit the
(information)
You're in the right place! Segment documentation is now part of Twilio Docs. The content you are used to is still here—just in a new home with a refreshed look.

Youbora Destination


Destination Info
  • Accepts Track calls.
  • Refer to it as Youbora in the Integrations object
Connection Modes
Device-modeCloud-mode
Web Web
Mobile Mobile
Server Server

Web Destination

web-destination page anchor

When you enable Youbora in the Segment web app, your changes appear in the Segment CDN in about 45 minutes, and then Analytics.js starts asynchronously loading Youbora's JavaScript onto your page. (This means you should remove Youbora's snippet from your page.)

Youbora automatically starts recording data.


Segment can keep track of events occurring on any number of video players on your page. You must include the session_id property with every video event you want to send to Youbora so Segment can keep track of which player to attribute the events to.

Video Playback Started

video-playback-started page anchor

When a user starts playback of a video, use the Video Playback Started event. Segment maps the properties from the Video Playback Started event to the following Youbora video metadata fields:

Youbora ParameterSegment PropertyData Type
content.isLiveproperties.livestreamBoolean
Resourcecontext.page.urlString

When the video content actually begins playing, use the Video Content Started event. Segment maps the properties from the Video Playback Started event to the following Youbora video metadata fields:

Youbora ParameterSegment PropertyData Type
content.titleproperties.titleString
content.title2properties.programString
content.durationproperties.total_lengthInteger
content.metadata.content_idproperties.asset_idString
content.metadata.genreproperties.genreString
content.metadata.ownerproperties.publisherString

Youbora calculates the join time using the time difference between Video Playback Started and Video Content Started,

Video Playback Paused/Resumed

video-playback-pausedresumed page anchor

When a user pauses or resumes playback of a video, use the Video Playback Paused and Video Playback Resumed events.

If the user pauses during an ad, fill the properties.ad_asset_id field from the spec for both calls, as Segment uses its presence to determine whether the pause is occurring during an ad or not.

Example

1
analytics.track('Video Playback Paused', {
2
session_id: '1',
3
ad_asset_id: '12345'
4
});
5
6
analytics.track('Video Playback Resumed', {
7
session_id: '1',
8
ad_asset_id: '12345'
9
});

Video Playback Seek Started/Completed

video-playback-seek-startedcompleted page anchor

When the video content actually begins playing, use the Video Playback Seek Started and Video Playback Seek Completed events. Youbora internally calculates the duration of the seek but if you would prefer to provide this value yourself you can pass it as the integration-specific option duration.

Example

1
analytics.track('Video Playback Seek Started');
2
3
analytics.track('Video Playback Seek Completed');

Video Playback Buffer Started/Completed

video-playback-buffer-startedcompleted page anchor

When the video content buffers during playback, use the Video Playback Buffer Started and Video Playback Buffer Completed events. Segment maps the properties from these events to the following Youbora video metadata fields:

Example

1
analytics.track('Video Playback Buffer Started', { session_id: 1 });
2
3
analytics.track('Video Playback Buffer Completed', { session_id: 1 });

If the user pauses during an ad, fill the properties.ad_asset_id field from the spec for both calls, as Segment uses its presence to determine whether the pause is occurring during an ad or not.

Video Playback Interrupted

video-playback-interrupted page anchor

When playback of a video is interrupted, use the Video Playback Interrupted event.

Video Playback Completed

video-playback-completed page anchor

To track the completion of the video playback session, use the Video Playback Completed event.

Example

analytics.track('Video Playback Completed', { session_id: 1 });

When an ad begins to load, use the Video Ad Started event. Segment maps the properties from these events to the following Youbora video metadata fields:

Youbora ParameterSegment PropertyData Type
ad.titleproperties.titleString

Example

analytics.track('Video Ad Started', { session_id: 1, title: 'Test Ad Title', ad_asset_id: 1 });

To track the completion of an ad, use the Video Ad Completed event.

Example

analytics.track('Video Ad Completed', { session_id: 1, ad_asset_id: 1 });

To track an ad click, track an event with event name 'Video Ad Clicked'.

Example

analytics.track('Video Ad Clicked', { session_id: 1, ad_asset_id: 1 });

Automatic Video Player Tracking

automatic-video-player-tracking page anchor

Youbora supports automatic video tracking for the following video players:

  • DashJS
  • HTML5
  • JWPlayer
  • TheoPlayer
  • ThePlatform
  • VideoJS

However, relying solely on Youbora auto tracking will not send your video events to Segment downstream destinations, including a raw data warehouse. To track data to downstream tools, Segment recommends either manually implementing all video player events or manually implementing all events alongside Youbora.

If you employ the latter method, you should indicate explicitly that your Segment events should not flow to Youbora (because they've already been auto-tracked by the Youbora library).

1
analytics.track('Video Playback Started', { // empty properties object
2
}, {
3
integrations: {
4
'Youbora': false
5
}
6
});

Use the following steps to track a player that falls in one of the previous categories:

  1. Ensure you have the latest snippet on your page.
  2. If your snippet is in the head of your page, move it to the very bottom of your body, right before the </body> tag.
  3. Replace the load method in your snippet with the following (you can delete any of the categories you won't be using):
1
analytics.load(<YOUR WRITE KEY HERE>, {
2
integrations: {
3
Youbora: {
4
players: {
5
videojs: [],
6
html5: [],
7
jwplayer: [],
8
theoplayer: [],
9
theplatform: [],
10
videojs: []
11
}
12
}
13
}
14
});
  1. Add players inside the appropriate category in the following format:
1
{
2
player: video player object or video player id,
3
options: {
4
YOUBORA OPTIONS HERE
5
}
6
}

In the player field, pass the video player object, or the ID of the video player element in the case of HTML5.

In the options field, you can pass options the same way you would pass them natively to Youbora(link takes you to an external page).

The following example shows a working implementation:

1
<script>
2
var vplayer = videojs('html5player')
3
4
!function(){var i="analytics",analytics=window[i]=window[i]||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","screen","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId","addDestinationMiddleware","register"];analytics.factory=function(e){return function(){if(window[i].initialized)return window[i][e].apply(window[i],arguments);var n=Array.prototype.slice.call(arguments);if(["track","screen","alias","group","page","identify"].indexOf(e)>-1){var c=document.querySelector("link[rel='canonical']");n.push({__t:"bpc",c:c&&c.getAttribute("href")||void 0,p:location.pathname,u:location.href,s:location.search,t:document.title,r:document.referrer})}n.unshift(e);analytics.push(n);return analytics}};for(var n=0;n<analytics.methods.length;n++){var key=analytics.methods[n];analytics[key]=analytics.factory(key)}analytics.load=function(key,n){var t=document.createElement("script");t.type="text/javascript";t.async=!0;t.setAttribute("data-global-segment-analytics-key",i);t.src="https://cdn.segment.com/analytics.js/v1/" + key + "/analytics.min.js";var r=document.getElementsByTagName("script")[0];r.parentNode.insertBefore(t,r);analytics._loadOptions=n};analytics._writeKey="YOUR_WRITE_KEY";;analytics.SNIPPET_VERSION="5.2.1";
5
6
analytics.load("YOUR_WRITE_KEY", {
7
integrations: {
8
Youbora: {
9
players: {
10
videojs: [
11
{
12
player: vplayer,
13
options: {
14
'content.title': 'My Awesome Content'
15
}
16
}
17
],
18
html5: [
19
{
20
player: 'html5-player',
21
options: {}
22
]
23
}
24
}
25
}
26
});
27
analytics.page();
28
}}();
29
30
</script>

Segment lets you change these destination settings from the Segment app without having to touch any code.

Property nameTypeRequiredDescription
Account Codestring
required

Your Youbora account code