With the analytics.js Vimeo Plugin you can easily collect Vimeo player events into the Segment ecosystem.
To use the plugin you must first generate an Access Token in Vimeo. The plugin uses this token to access metadata about the video content being played.
Vimeo provides documentation outlining this process here. Please ensure you are carefully selecting your access scopes! The plugin only needs to read information about your video(s).
Enable a new plugin by navigating to the settings for your Source and clicking Plugins. You can enable the Vimeo plugin from this menu.
Initialize the plugin by giving it your Vimeo Access Token, and granting it access to the Vimeo video player instance(s) running on the page. Do this using the initialize method:
<iframe src="https://player.vimeo.com/video/76979871" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> <script src="https://player.vimeo.com/api/player.js"></script> <script> var iframe = document.querySelector('iframe'); var player = new Vimeo.Player(iframe); var VimeoAnalytics = window.analyticsPlugins.VimeoAnalytics var vimeoAnalytics = new VimeoAnalytics(player, 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX0365') vimeoAnalytics.initialize() </script>
That’s it! The plugin listens to the Vimeo player for events, and responds by firing the corresponding Segment Video Spec events on Analytics.js.
The following Segment Video Spec events are tracked by this plugin:
- Video Playback Started
- Video Playback Completed
- Video Playback Paused/Resumed
- Video Content Started/Completed
The following Segment Video Spec properties are automatically attached to the above events:
- Total Length
- Video Player
If you have any questions, or see anywhere we can improve our documentation, please let us know!