If you have a Vimeo video on your site then you would want to know, how many people are watching it and the video being tracked in real time.The problem is that these videos are hosted on another website, so technically you are just seeing your embedded video through a hole in your site with the video behind it.This means that you cannot track videos unless you have a script that communicates with Vimeo API. Luckily, Sander Heilbron has created a script that communicates with Vimeo API, so in this guide, I will walk you through this whole process.

Track Vimeo Videos with Google Analytics- Step by Step Process

 

1.Download Sander Heilbron script page and upload it to your site:

You can get the file from the link below.The javascript is minified to load as fast as possible:

https://github.com/sanderheilbron/vimeo.ga.js/releases/download/0.5.1/vimeo.ga.min.js

If you are using a WordPress file then simply click ‘Media‘ from the left menu of your dashboard, then click Add New. You will get directed to file upload page where you can upload the downloaded Sander Heilbron script page from your computer. Once you upload the file, you will see the File URL.

This File URL will be used in the script mentioned in step 2 to call the code.

Solution for Non-Wordpress Sites

If you are not using WordPress then there is another simpler way to upload the file without using the plugin.

Upload the file on your website root directory in your hosting Account. You should see a file manager in your Cpanel where you can upload the file. Please make sure the path to the file is correct, otherwise, the script will not work.

<script src=”http://www.example.com/folder-name/vimeo.ga.min.js”></script>

2.Call your code where your videos are embedded

Download ‘Header & Footer‘ plugin and then insert this code on all pages.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
<script src="path/to/your/uploaded/file/vimeo.ga.min.js" type="text/javascript"></script>

3.Find a page where you have your Vimeo video.

Paste your standard Vimeo default code:

<iframesrc="//player.vimeo.com/video/12345678"width="640"height="390"
frameborder="0"webkitAllowFullScreenmozallowfullscreenallowFullScreen></iframe>

Replace theVimeoVideo ID number: 122582838with your Vimeo video ID number.

Now edit the “src=” code that will inform Vimeo that you want to get information from Vimeo API. The code will look like this:

<iframesrc="//player.vimeo.com/video/12345678?api=1&player_id=vimeo-player-1"
id="vimeo-player-1"width="640"height="390"frameborder="0"
data-progress="true"data-seek="true"data-bounce="true"
webkitAllowFullScreenmozallowfullscreenallowFullScreen></iframe>

3.View yourVimeo Data in Google Analytics

Play the full video on your page and then go to Google Analytics. Below Real-time, click events and you should see your video being tracked in real time. To see the real-time video should be played simultaneously.

After you have played the video, you can go to Behavior tab under where you can see Events overview. In Events section, you can click on events action and see what percentage of videos are being played or you can click on event labels to see which videos are being played.