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.

analytics.js Vimeo Plugin


With the analytics.js Vimeo Plugin you can collect Vimeo player events into the Segment ecosystem.


Getting Started

getting-started page anchor

To use the Vimeo plugin:

  1. Generate an access token in Vimeo. The plugin uses this token to access metadata about the playing video content. Vimeo provides documentation to generate the access token(link takes you to an external page).

    • Note: Make sure to select the access scopes you need as the plugin only needs to read information about your video(s).
  2. Enable a new plugin by navigating to the settings for your Source and clicking Plugins. You can enable the Vimeo plugin from this menu:

    the plugins setting screen.
  3. Initialize the plugin by entering your Vimeo access token and granting it access to the Vimeo video player instance(s) running on the page. Use this initialize method:

1
<iframe src="https://player.vimeo.com/video/76979871" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
2
<script src="https://player.vimeo.com/api/player.js"></script>
3
<script>
4
var iframe = document.querySelector('iframe');
5
var player = new Vimeo.Player(iframe);
6
analytics.ready(function () {
7
var VimeoAnalytics = window.analytics.plugins.VimeoAnalytics
8
var vimeoAnalytics = new VimeoAnalytics(player, 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX0365')
9
vimeoAnalytics.initialize()
10
})
11
</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 plugin tracks the following Segment Video Spec events:

  • Video Playback Started
  • Video Playback Completed
  • Video Playback Paused/Resumed
  • Video Content Started/Completed

The plugin automatically attaches the following Segment Video Spec properties to the above events:

'Playback' Events

  • Total Length
  • Position
  • Video Player
  • Sound

'Content' Events

  • Title
  • Description
  • Publisher