Vimeo Tracking with Google Tag Manager | Cardinal Path Blog
Blog

Vimeo Tracking with Google Tag Manager

video-editing

Tracking how users are interacting with your embedded Vimeo videos is now easier than ever thanks to Google Tag Manager (GTM). After reading my colleague Nicky Yuen’s post about tracking user interaction with embedded YouTube videos, I felt inspired to write a similar post about Vimeo videos. So without further ado, here is the step by step guide to setting up Vimeo tracking using Google Tag Manager (GTM).

Step 1 – Create your variables

Google Analytics Tracking ID

This variable will hold the Google Analytics tracking ID. This is how Google
Tag Manager will know which property it should to send information to.

  • Variable Name
    • UA – Property ID
  • Variable Type
    • Constant
  • Variable Config
    • Value: UA-XXXXXX-X (replace with your property tracking ID)

UA_PropertyID

Vimeo Video Present

This variable will track whether or not a Vimeo video is embedded on the page. It will return TRUE if a video is embedded on the page, and FALSE if there is no video embedded. This is important because we do not want to to execute our script library and potentially delay the page load time unless we are sure that it is needed.

  • Variable Name
    • cj – Vimeo Video Present
  • Variable Type
    • Custom Javascript
  • Variable Config
    • Custom Javascript:
cutom_javaScript Configure_variable

Data Layer Category

We need to define a variable which will hold the event category that our tracking script will push into the dataLayer.

  • Variable name:
    • dL – eventCategory
  • Variable type:
    • Data Layer Variable
  • Variable configuration:
    • Data Layer Variable Name: eventCategory
    • Data Layer Version: Version 2
dl_EventCategory

Data Layer Action

We need to define a variable which will hold the event action that our tracking script will push into the dataLayer.

  • Variable name:
    • dL – eventAction
  • Variable type:
    • Data Layer Variable
  • Variable configuration:
    • Data Layer Variable Name: eventAction
    • Data Layer Version: Version 2
DL_EventAction

Data Layer Label

Now, we need to define a variable which will hold the event label that our tracking script will push into the dataLayer.

  • Variable name:
    • dL – eventLabel
  • Variable type:
    • Data Layer Variable
  • Variable configuration:
    • Data Layer Variable Name: eventLabel
    • Data Layer Version: Version 2
DL_Event_Label

Step 2 – Create Your Triggers

Vimeo Event Trigger

  • Trigger Name
    • Vimeo Video
  • Trigger Event Type
    • Custom Event
  • Trigger Fires On
    • Event Name: vimeo
VimeoVideo

Vimeo Present Trigger

This trigger will fire when the page is fully loaded (gtm.dom) and when our previously created variable detects an embedded Vimeo video and returns a value of “true”.

  • Trigger Name
    • Vimeo Present
  • Trigger Event Type
    • Custom Javascript
  • Trigger Fires On
    • “cJ – Vimeo Video Present”  >  equals  >  true
VimeoPresent

Step 3 – Configure Tag

Google Analytics Event Tag

This will be the tag that sends all of the wonderful information we are capturing with our listener script into our Google Analytics account.

  • Tag name
    • UA – Vimeo Event
  • Tag product
    • Google Analytics
  • Tag type
    • Universal Analytics
  • Tag config
    • Tracking ID: {{UA – Property ID}}
    • Track Type: Event
    • Category: {{dL – eventCategory}}
    • Action: {{dL – eventAction}}
    • Label: {{dL – eventLabel}}
  • Tag fires on
    • Vimeo Video
UA_VimeoEvent

Vimeo Listener Tag

This tag does all of the behind-the-scenes work to push valuable information about the video to the dataLayer. We will only want to fire this tag when there is a Vimeo video actually embedded on the page, which is why we created a special trigger for it in the previous step.

  • Tag name
    • Vimeo Listener
  • Tag product
    • Custom HTML
  • Tag Configuration
    • HTML: (found at bottom of page)
  • Tag fire on
    • Vimeo Present
Vimeo_listener

Step 4 (optional): Bonus Information About the Video

The Vimeo tracking code not only lets us listen in to play/pause/etc events, it also exposes some additional data points about the video which can be passed through to Google Analytics as custom dimensions enabling some more advanced reporting. The additional data points are as follows:

  • Author
  • Author profile URL on vimeo.com
  • Upload date
  • ID
  • Title

To capture these data points, we’ll need to create some variables to pull the information from the data layer, and also modify our Google Analytics event tag to pass these data points through as custom dimensions.

The variables

Since the above extra data points are stored in the data layer, we will need to create some “Data Layer Variables”. Here are the “keys” that can be used to capture this information:

  • vimeo_playerID
  • vimeo_playerTitle
  • vimeo_playerAuthor
  • vimeo_playerAuthorURL
  • vimeo_playerUploadDate

The Setup (you’ll need to create one for each “key” listed
above)

  • Variable name:
    • dL – vimeo_playerID
  • Variable type:
    • Data Layer Variable
  • Variable configuration:
    • Data Layer Variable Name: vimeo_playerID
    • Data Layer Version: Version 2
DL_vimeo_playerID

The Modified Google Analytics Tag

We will take the existing Google Analytics tag that we configured in Step 3, and simply pass through some additional information as custom dimensions. For this example, I will pass through all of the additional data points in order to show how that would be achieved.

Make sure that these custom dimensions are created within your Google Analytics Administrator settings before you start sending data into them, otherwise the data will not be captured. Google Analytics does not automatically create custom dimensions.

  • Tag name
    • UA – Vimeo Event
  • Tag product
    • Google Analytics
  • Tag type
    • Universal Analytics
  • Tag config
    • Tracking ID: {{UA – Property ID}}
    • Track Type: Event
    • Category: {{dL – eventCategory}}
    • Action: {{dL – eventAction}}
    • Label: {{dL – eventLabel}}
      • More settings
      • Custom Dimensions
        • Index 1: {{dL – vimeo_playerID}}
        • Index 2: {{dL – vimeo_playerTitle}}
        • Index 3: {{dL – vimeo_playerAuthor}}
        • Index 4: {{dL – vimeo_playerAuthorURL}}
        • Index 5: {{dL – vimeo_playerUploadDate}}
  • Tag fires on
    • Vimeo Video
UA_vimeo_event

The Code Snippet

Click here to get the custom Javascript markup required for Vimeo video tracking!

Copyright © 2016, All Rights Reserved. Privacy and Copyright Policies.