If you are a Vimeo Business or Vimeo Premium member and you use Google Analytics, you can track events on all Vimeo players embedded on your site. Before you get started, you’ll want to make sure you have a Google Analytics account set up, and have the Analytics Script installed in your page. You can find instructions for installing Google Analytics via Google’s Tag Manager here.
To set up the integration with Google Analytics, go to the Marketing tab in your Vimeo Account Settings and copy the tracking code below the “Google Analytics” heading. You will need to paste this tracking code underneath the Google Analytics script wherever it appears in the HTML source code of your website. If you are unable to modify the code of your website, you can also insert the Vimeo tracking code with Tag Manager.
The tracking code triggers Google Analytic events for plays, impressions, email capture, and when the progress through a video embedded on your site hits 25%, 50%, 75%, or 100% complete.
A few more technical details to keep in mind about the integration with Google Analytics:
- The script will work with universal analytics, classic analytics, and Google Tag Manager only if the tracking libraries are defined as ga for universal, _gaq for classic, or dataLayer for Google Tag Manager.
- If you use the script, please do not add the Vimeo player API (https://player.vimeo.com/api/player.js). If you need functionality from that library, you should put the code after the Google Analytics tracking script.
- If you have a more advanced setup that adds new embeds to the page after the initial load (for example, if using a lightbox), you can call the function window.__vimeoRefresh() in the script used to load your iframe embeds. To start tracking events in the player, you’ll need to call this function after loading new embeds on the page. This does not include loading a new video into an existing iframe, which will already work without extra effort.