Skip to main content

Vimeo media tracking on web

This plugin enables the automatic tracking of a Vimeo video. It uses the Snowplow Media plugin under the hood.

Vimeo media events and entities are automatically tracked once configured.

Install plugin

Tracker DistributionIncluded
sp.js
sp.lite.js

Download:

Download from GitHub Releases (Recommended)Github Releases (plugins.umd.zip)
Available on jsDelivrjsDelivr (latest)
Available on unpkgunpkg (latest)
javascript
window.snowplow(
'addPlugin',
'https://cdn.jsdelivr.net/npm/@snowplow/browser-plugin-vimeo-tracking@latest/dist/index.umd.min.js',
['snowplowVimeoTracking', 'VimeoTrackingPlugin']
);

Quick Start

The snippets below show how to get started with the plugin, after setting up your tracker.

Using an iFrame:

html
<iframe
id='vimeo-iframe'
src='https://player.vimeo.com/video/535907279?h=db7ea8b89c'
></iframe>
javascript
const id = 'XXXXX'; // randomly generated ID
const video = document.getElementById('vimeo-iframe')

window.snowplow('startVimeoTracking', { id, video });

// Vimeo events are tracked...

window.snowplow('endVimeoTracking', id);

Using Vimeo.Player:

html
<div id='vimeo-player'></div>
javascript
const id = 'XXXXX'; // randomly generated ID
const video = new Vimeo.Player('vimeo-player', {
videoId: 'zSM4ZyVe8xs'
});

window.snowplow('startVimeoTracking', { id, video });

// Vimeo events are tracked...

window.snowplow('endVimeoTracking', id);

Start tracking

Use the startVimeoTracking function to begin tracking Vimeo media events. You must provide a unique id for the media session, along with the video element or Vimeo.Player instance.

ParameterTypeDescriptionDefault / Required
idstringA unique session UUID for each media element, used to identify and end tracking.Required
videoHTMLIFrameElement or PlayerAn iframe element, or an instance of Vimeo.Player created with the Vimeo Player SDK.Required
labelstringA custom human-readable label for the media element.undefined
captureEventsVimeoEvent[]A list of media events to track.All events tracked by default
boundariesnumber[]Percentage thresholds (0-100) to trigger progress events.[10, 25, 50, 75]
contextDynamicContextDynamic contexts attached to each tracking event.undefined
updatePageActivityWhilePlayingbooleanWhether to update page activity while media is playing.true
filterOutRepeatedEventsFilterOutRepeatedEventsWhether to suppress consecutive identical events.Enabled by default
filterOutRepeatedEvents .seekEventsbooleanWhether to filter out seek start and end events tracked after each other.true
filterOutRepeatedEvents .volumeChangeEventsbooleanWhether to filter out volume change events tracked after each other.true
filterOutRepeatedEvents .flushTimeoutMsnumberTimeout in milliseconds after which to send the events that are queued for filtering.5000 (milliseconds)
pings.pingIntervalnumberInterval (in seconds) for sending ping events.30 (seconds)
pings.maxPausedPingsnumberMaximum number of ping events sent while playback is paused.1
sessionboolean or objectWhether to track the media session entity for playback statistics, or set a custom start time.true

Stop tracking

It's important to call endVimeoTracking when you finish tracking. This will end any recurring ping events, clear all listeners set by the Vimeo plugin, along with resetting statistics counters used by the Snowplow Media plugin.

Events

The plugin provides automatic tracking of the following events. Note that some events are specific to this plugin, and not part of the standard Snowplow Media events.

Vimeo Event NameDescriptionVimeo only
ReadySent when the media tracking is successfully attached to the player and can track events.
PlaySent when the player changes state to playing from previously being paused.
PauseSent when the user pauses the playback.
EndSent when playback stops when end of the media is reached or because no further data is available.
SeekStartSent when a seek operation begins.
SeekEndSent when a seek operation completes.
PlaybackRateChangeSent when the playback rate has changed.
VolumeChangeSent when the volume has changed.
FullscreenChangeSent immediately after the browser switches into or out of full-screen mode.
PictureInPictureChangeSent immediately after the browser switches into or out of picture-in-picture mode.
BufferStartSent when the player goes into the buffering state and begins to buffer content.
BufferEndSent when the player finishes buffering content and resumes playback.
QualityChangeSent when the video playback quality changes automatically.
ErrorSent when the Vimeo player encounters an error
PingFires periodically during playback
PercentProgressFires at progress milestones defined by boundaries option
CuePointSent when a cue point is reached.
ChapterChangeSent when the chapter changes.
TextTrackChangeSent when the text track changes.
InteractiveHotspotClickedSent when an interactive hotspot is clicked.
InteractiveOverlayPanelClickedSent when an interactive overlay panel is clicked.

If you wish to track only a subset of these events, pass an array of VimeoEvents to the startVimeoTracking function:

javascript
window.snowplow('startVimeoTracking',  {
id,
video,
captureEvents: ['play', 'pause'],
})

Track events manually

For event types provided by the Snowplow Media plugin but not automatically tracked by the Vimeo plugin, such as advertising events, you can use the corresponding track*Event functions from the Snowplow Media plugin.

javascript
const id = 'XXXXX'; // randomly generated ID

const video = new Player('vimeo-player', {
videoId: 'zSM4ZyVe8xs'
});

window.snowplow('startVimeoTracking', { id, video });

...

// When your ad break starts
window.snowplow('trackMediaAdBreakStart', { id });

// When your ad break ends
window.snowplow('trackMediaAdBreakEnd', { id });

...

window.snowplow('endVimeoTracking', id);;

Vimeo-specific event schemas

The CuePoint, ChapterChange, TextTrackChange, InteractiveHotspotClicked, and InteractiveOverlayPanelClicked events are specific to the Vimeo plugin, and not provided by the Snowplow Media plugin.

They're not used by the Media Player dbt package, but you can use them for your own analysis.

Cue point

Fired when a cue point added via addCuePoint() is reached during playback.

cue_point_event

Event
Schema for a Vimeo cue point event, fired when a cue point is reached in a video.
Schema URIiglu:com.vimeo/cue_point_event/jsonschema/1-0-0
Example
json
{
"id": "fb819c48-5760-4d94-9c5b-4fa52f61a998",
"cuePointTime": 30.5,
"data": {
"label": "Chapter 1"
}
}
Properties and schema
PropertyDescription
id
string
Required. The ID of the cue point.
cuePointTime
number
Required. The location of the cue point in seconds.
data
object
Optional. The custom data from the addCuePoint() call, or an empty object.
Warehouse query
sql
select
unstruct_event_com_vimeo_cue_point_event_1_0_0
from
PIPELINE_NAME.events events
where
events.collector_tstamp > timestamp_sub(current_timestamp(), interval 1 hour)
and events.event = 'unstruct'
and events.event_name = 'cue_point_event'
and events.event_vendor = 'com.vimeo'

Chapter change

Fired when the current chapter changes during playback.

chapter_change_event

Event
Schema for a Vimeo chapter change event fired when the current chapter changes.
Schema URIiglu:com.vimeo/chapter_change_event/jsonschema/1-0-0
Example
json
{
"index": 2,
"startTime": 120,
"title": "Getting Started"
}
Properties and schema
PropertyDescription
index
integer
Optional. The chapter number.
startTime
integer
Optional. The time in seconds when the chapter begins.
title
string
Optional. The chapter title.
Warehouse query
sql
select
unstruct_event_com_vimeo_chapter_change_event_1_0_0
from
PIPELINE_NAME.events events
where
events.collector_tstamp > timestamp_sub(current_timestamp(), interval 1 hour)
and events.event = 'unstruct'
and events.event_name = 'chapter_change_event'
and events.event_vendor = 'com.vimeo'

Text track change

Fired when the active text track (captions or subtitles) changes.

text_track_change_event

Event
Schema for a Vimeo text track event, fired when the active text track of the captions or subtitle kind changes.
Schema URIiglu:com.vimeo/text_track_change_event/jsonschema/1-0-0
Example
json
{
"kind": "captions",
"language": "en",
"label": "English",
"mode": "showing"
}
Properties and schema
PropertyDescription
kind
string
Optional. The kind of the text track: 'captions' or 'subtitles'.
language
string
Optional. The ISO code of the text track's language.
label
string
Optional. The human-readable label of the text track for identification purposes.
mode
string
Optional. The mode of the text track
Warehouse query
sql
select
unstruct_event_com_vimeo_text_track_change_event_1_0_0
from
PIPELINE_NAME.events events
where
events.collector_tstamp > timestamp_sub(current_timestamp(), interval 1 hour)
and events.event = 'unstruct'
and events.event_name = 'text_track_change_event'
and events.event_vendor = 'com.vimeo'

Interactive hotspot clicked

Fired when a user clicks an interactive hotspot in a Vimeo interactive video. The interaction details are provided in the interaction entity.

interactive_hotspot_click_event

Event
Schema for a Vimeo interactive video hotspot click
Schema URIiglu:com.vimeo/interactive_hotspot_click_event/jsonschema/1-0-0
Properties and schema

This schema has no properties.

Warehouse query
sql
select
unstruct_event_com_vimeo_interactive_hotspot_click_event_1_0_0
from
PIPELINE_NAME.events events
where
events.collector_tstamp > timestamp_sub(current_timestamp(), interval 1 hour)
and events.event = 'unstruct'
and events.event_name = 'interactive_hotspot_click_event'
and events.event_vendor = 'com.vimeo'

Interactive overlay panel clicked

Fired when a user clicks an interactive overlay panel in a Vimeo interactive video. The interaction details are provided in the interaction entity.

interactive_overlay_panel_click_event

Event
Schema for a Vimeo interactive overlay panel click
Schema URIiglu:com.vimeo/interactive_overlay_panel_click_event/jsonschema/1-0-0
Properties and schema

This schema has no properties.

Warehouse query
sql
select
unstruct_event_com_vimeo_interactive_overlay_panel_click_event_1_0_0
from
PIPELINE_NAME.events events
where
events.collector_tstamp > timestamp_sub(current_timestamp(), interval 1 hour)
and events.event = 'unstruct'
and events.event_name = 'interactive_overlay_panel_click_event'
and events.event_vendor = 'com.vimeo'

Vimeo entities

The event and entity schemas are the same as for the Snowplow Media plugin, plus the Vimeo-specific events detailed above.

Along with the standard Snowplow media entities, the Vimeo media plugin also tracks two Vimeo media-specific entities, meta and interaction. They're not used by the Media Player dbt package, but you can use them for your own analysis.

Video metadata

The meta entity provides additional metadata about the video. It's added to the Ready event only.

meta

Entity
Schema for a Vimeo video metadata.
Schema URIiglu:com.vimeo/meta/jsonschema/1-0-0
Example
json
{
"videoId": 535907279,
"videoTitle": "Introduction to Analytics",
"videoUrl": "https://vimeo.com/535907279",
"videoWidth": 1920,
"videoHeight": 1080
}
Properties and schema
PropertyDescription
videoId
number
Required. The Vimeo ID of the video.
videoTitle
string
Required. The title of the video.
videoUrl
string
Optional. The URL of the video on vimeo.com.
videoWidth
number
Required. The native width of the video as the width of the video's highest available resolution.
videoHeight
number
Required. The native height of the video as the height of the video's highest available resolution.

Interaction

The interaction entity provides details of user interactions for InteractiveHotspotClicked and InteractiveOverlayPanelClicked events.

interaction

Entity
Context Schema attached to interactive_hotspot_click_event and interactive_overlay_panel_click_event.
Schema URIiglu:com.vimeo/interaction/jsonschema/1-0-0
Example
json
{
"action": "clickthrough",
"actionPreference": {
"pauseOnAction": true,
"url": "https://example.com/product"
},
"hotspotId": "hs-product-link",
"currentTime": 45.2
}
Properties and schema
PropertyDescription
action
string
Required. The action type of the hotspot.
actionPreference
object
Required. The user's preferred action type for the hotspot.
customPayloadData
object
Optional. The custom payload data of the interactive hotspot
currentTime
number
Optional. The current time of the video when the interaction occurs is clicked.
hotspotId
string
Optional. The unique ID for the hotspot.
panelId
string
Optional. The unique ID for a panel within the overlay.
overlayId
string
Optional. When action is overlay, the displayed unique ID for the overlay when the hotspot is clicked.

Advanced usage

As the Vimeo plugin uses Snowplow Media internally, for more granular control over events, you can utilise any of the functions provided by the Snowplow Media plugin.

For example, if you wish to include additional behavior when a video is paused, you can create callback on the pause event of an instance of a Vimeo player.

note

In the following example, ensure you aren't passing the pause event to the startVimeoTracking function, as this will result in the event being tracked twice.

javascript
const id = 'XXXXX'; // randomly generated ID

const video = new Vimeo.Player('vimeo-player', {
videoId: 'zSM4ZyVe8xs'
});

window.snowplow('startVimeoTracking', { id, video, captureEvents: ['play']});

video.on('pause', () => {
// Do something when the video is paused
window.snowplow('trackPauseEvent', { id });
});

You can also provide player configuration when calling startVimeoTracking, to set options on the underlying Vimeo player instance.