To pass your Vidalytics watch data to Google Analytics or Google Tag Manager, you'll need to set up and modify the code below to match your specific video and preferences on what you'd like to track:

<script>

var _vidalyticsPlayerPlugin = {
"EMBED_ELEMENT_ID": {
"google-analytics": {
"id": "UA-XXXXXXXXXX-X", // Google Analytics ID
"videoTitle": "Video XYZ", // Video Title to Send to GA
"sendWatchedPercent": “0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100", // Which percents of video length should be sent to GA as "milestones"
"sendPlay": true, // Send Play Event to GA or not
"sendPause": true, // Send Pause Event to GA or not
"sendPausePercentage": true // Send at which time % user has paused
}
}
}
</script>

Elements to modify:

  • EMBED_ELEMENT_ID should match your Vidalytics embed ID. E.g.: vidalytics_embed_xxxxxxxx
  • "id": "'UA-XXXXXXXXXX-X'" should match your Google Analytics ID.
  • "videoTitle": "Video XYZ" -- Use here the title you want GA to display for this video on your reports.
  • "sendWatchedPercent": -- Add as many percentages of your video as you want to track in GA.

Make sure you place the Google Analytics tracking code above the Vidalytics embed code. It can go anywhere above our embed code, or even in head section.

Inside Google Analytics, you can see events immediately here:

And a totals report here (it takes one day to update the Total Events report):

To see more details, click on the "Video" category:

Track Goals in GA Based on Video Watch Time

To track goals inside of GA based on the watch data you're passing via the code above, follow these steps:

Set your Goal as 'Custom'.

Add a title and set the type as 'Event'.

Goal details will depend on what you're wanting to track with this code.

Category - video

Action - this could be 'Play' or 'Pause' or 'Pause Percentage' or "(number)% watched" e.g.: "10% watched" or "30% watched"

Label - The title of your video

Value - This is not required for play percentage, but you will need to add it if you're wanting to track 'Pause Percentage' e.g.: 35 (i.e. pause at 35%)

Save your goal and you're ready to go!

Did this answer your question?