Expand my Community achievements bar.

Creating a Frankenstein Solution to track YouTube Videos Reliably

Avatar

Community Advisor

10/5/22

Company Name: Torstar

Company URL: https://www.thestar.com

Your Name: Jennifer Dungan

Your Title: Optimization Manager Analytics

 

Describe your company, the customer experience and business challenge(s) you set out to solve with Adobe Experience Cloud products, and how long your company/organization has been using Adobe Experience Cloud products.

 

Torstar is one of Canada's largest media companies, focusing mostly on news publishing and many different vertical products. We have been an Adobe Analytics client since before 2007 when I joined the company.

 

YouTube videos have long been a challenge tracking, the API is pretty unstable and solutions that work today easily break the next, or a few days from now. While Adobe does have two plugins in Adobe Experience Platform Data Collection (or Launch), these solutions still seem to miss the triggers most of the time... leaving the data in a state that can't fully be trusted.

 

Describe how you have integrated and used multiple Adobe Experience Cloud products to solve these challenges to improve and personalize the customer experience/journey. Please provide information that will be helpful in understanding your integration (e.g. architecture diagram, step by step process integration flow, etc.).

 

My solution, which is a bit odd, is a "Frankenstein" mix between GTM and Adobe.

 

I use GTM's YouTube Video trigger and built-in Video Variables to drive a custom html script tag. In this tag I set a window level object to hold the information about the video.. things like the title, id, status, % completed, etc. Then here is where I trigger a custom JS event.

 

 

 

<script>
  // initiate the custom event if not already present
  if (!videoTrackEventShared){
    var videoTrackEventShared;
    videoTrackEventShared = new Event('videoTrackEventShared');
  }

  // set variables based on build in vars (probably overkill, but I like to be able to easily swap out or manipulate things here, rather than in-line where I set the data
  var videoStatus = {{Video Status}};
  var videoTitle = {{Video Title}};
  var videoPercent = {{Video Percent}};
  var videoURL = {{Video URL}};
  var videoId = videoURL.substring(videoURL.indexOf("v=") + 2);

  // Set Window Object
  window.sharedVideoData = {"title":videoTitle, "videoId":videoId, "videoEvent":videoStatus, "videoPosition":videoPercent+"%"};

  // Dispatch Custom Event
    window.document.dispatchEvent(videoTrackEventShared);
</script>

 

 

 

GTM Trigger:

Jennifer_Dungan_0-1665031688083.png

 

In Adobe, I created a rule to listed for that JS event, then read the object and set my Adobe Analytics tracking that way. You could also in theory try and leverage the GTM data layer (I was having issues with that and for expedience reasons I just did my own thing).

 

Adobe Custom Code Event:

 

 

document.addEventListener('videoTrackEventShared', function (e) {
  trigger();
}, false);

 

 

 

Then I just pick up the values from the window.sharedVideoData with my Data Elements, and use them as I need in my Adobe tracking.

 

 

Based on your successful use and integration of multiple Adobe Experience Cloud products, describe how it has transformed the customer experience/journey, and the value, business impact, and results your company/organization has realized. Please cite both qualitative and quantitative results as applicable.

 

I have found this solution to be the most reliable solution for us.... though as I said, it's a bit of an odd solution... I just felt like the GTM YouTube trigger (with both YouTube and GTM being Google products) might be more apt to stay up-to-date and functional (though.. I don't have 100% faith in that), but since the YouTube API seems to constantly change which was causing me a lot of headaches before, and this solution has now been in place for over a year and is still working, I think it's pretty solid....

Aspire Analytics Experience Platform