Home / Integrations / Woopra / Track YouTube video views in Woopra using GTM
Track YouTube video views in Woopra using GTM

Track YouTube video views in Woopra using GTM

In today’s Woopra tutorial we’re going to look at how to track YouTube video views in Woopra using GTM.

In order to gain a better understanding of how effective our videos are, we’re going to want to fire an event each time your embedded YouTube video is Played, Paused and Reached the end. This data can then be used to further segment our visitor data and see how each video has or hasn’t contributed to conversion.

Furthermore, there is also the possibility to track each percentage in which a video has been viewed – e.g 25%, 50%, 75%, 90%. Each extra tracking component will fire a new event, so it might not be wise to continue firing events and clutter your Woopra visitor data.

If you’re not sure what Woopra is, check out our Getting started with Woopra guide.

Create the Variables in GTM:

There are 2 DataLayer variables which need to be created – {{videoAction}} and {{videoUrl}}. Both of these are the variables which will record the actions each time the event is fired.

Create the videoAction variable:

In GTM navigate to Variables > Create new Variable

  • Variable Type: Data Layer Variable
  • Variable Name: videoAction
  • DataLayer Variable Name: attributes.videoAction

Track YouTube video views in Woopra using GTM

Create the videoUrl variable:

In GTM navigate to Variables > Create new Variable

  • Variable Type: Data Layer Variable
  • Variable Name: videoAction
  • DataLayer Variable Name: attributes.videoUrl

Track YouTube video views in Woopra using GTM

Create the Trigger in GTM:

The Trigger is the event in which the variable will fire upon. This is the Play, Pause, End of Video and Percentage of view (10%, 50% etc..)

In GTM navigate to Triggers > New Trigger

  • Trigger Type: Custom Event
  • Trigger Name: Youtube Video Track – Woopra
  • Fire On: youTubeTrack
  • Fire conditions: Video Action > Matches RegEx  > Play|Pause|Watch to End

(NOTE: If you wish to fire the percentage views, update the above to Play|Pause|Watch to End|25%|50%|75%|90%)

Track YouTube video views in Woopra using GTM

Create the Event tag in GTM:

This is the event which will fire each time the trigger conditions are equal to TRUE.

In GTM navigate to Tags > Create new Tag

  • Tag Name: Woopra – Video Play
  • Tag Type: Custom HTML Tag
  • Configure Tag: (Copy paste below script)
  • Fire On: Select tag > YouTube Video Track – Woopra (created in previous step)

Track YouTube video views in Woopra using GTM

Create the Script tag in GTM:

Finally we want everything to work, so we need to create one more custom HTML tag which will fire on all pages. This particular script is a modification of a Google Analytics YouTube Tracking script by Lunametrics. The script will detect and enable the tracking of YouTube videos.

If you wish to get specific, you can update your tag to only fire on those pages which have videos.

In GTM navigate to Tags > Create new Tag

  • Tag Name: Youtube Tracking Script
  • Tag Type: Custom HTML Tag
  • Configure Tag: (Copy paste below script)
  • Fire On: Select tag > All Pages (or create new custom trigger to only fire on certain pages)

Track YouTube video views in Woopra using GTM

Update your schema in Woopra:

In Woopra, navigate to Project Settings > Schema > Action Data Schema and create a new action schema with the event info for your video.

Track YouTube video views in Woopra using GTM

That’s it, you’re done! You should now be able to track YouTube video views in Woopra against a visitors activity. To test you can open up a page on your website, play a video and see if the new events appear within Woopra.

(NOTE: Don’t forget to publish your GTM container once all changes have been completed.)

Hope you enjoyed reading – please leave any questions or comments below 🙂

  • Was this Helpful ?
  • yes   no

About The Moo Master

As today's world moves towards more cloud based solutions, it's not always easy to find an all-in-one solution to a business problem. We focus on business development. finding new, creative and innovative ways to use different IT systems to enhance and automate business processes. We're happy to share our knowledge and solutions we've come up with over the years to some of those unique IT/Business problems.

Check Also

Identify users in Woopra using Forms

Identifying visitors in Woopra using GTM & Form Variables

Contents1 Identifying visitors using form variables:1.1 Update form ID’s:1.2 Create the Form Variable in GTM:1.3 ...

4 comments

  1. Hello It didn’t work and I think it is because I didn’t know how define the event template. Could you help me with this please?

    • Hi Andrea,

      It would be best to first test that the GTM tag is firing – you can do this by opening GTM and entering “Preview” mode. Once in preview mode, you can browse to a page on your website that has an embedded video to test if the play/pause and other events are being fired.

      Best,
      MooMaster

  2. Akshat Kharbanda

    Now we have inbuild Youtube tracking in GTM?

    What things need to change now?

    • Hi Akshat,

      You’re right, as it is already built in, this would no longer be required. Unless of course you wish to add some additional customization’s to the javascript used in the tracking itself.

      Best,
      MooMaster

Leave a Reply

Your email address will not be published. Required fields are marked *