Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

DTM: Native support for YouTube API HowTo

Anonymous
Not applicable

Hello everbody,

regarding to this FAQ page article

http://www.searchdiscovery.com/satellite/adobedtm-faq/ (Does Adobe DTM support Multi-Media tags like video playback analysis?)

i want to track video events (started, play, pause, ended) for YouTube embedded videos.

 

But honestly i don't know what that means.

 

On implementing side i found an example on how to embed YouTube videos und recognizing the mentioned events above.

In this case i can call the _satellite.track("video_started") function and detect this within DTM by a direct call rule.

 

BUT i want to know if there is another way tracking YouTube videos natively. This is important because i don't have access for a page i want to implement the tracking logic.

 

So does anyone knows what that means "They have native support for HTML5, YouTube API, and Vimeo API." and how to treat it?

 

Thanks in advance

Axel

1 Accepted Solution
Josh_Du
Correct answer by
Level 9
Level 9

"Native support" means you should see options for it within the DTM interface (as opposed to writing your own custom code). 

DTM offers native support for html5 videos.  To set this up, create an Event based rule. Under Conditions > Event Type the dropdown has video events under HTML 5 Video.  If you need to grab information about the video (e.g. the video src url or other meta data in the video tag), the javascript this object is a reference to the video object for the given event. 

As far as I know, DTM has no documented native support for Youtube or Vimeo videos, and they are not listed in the Event Type dropdown. 

However, you can put Youtube and Vimeo event listener code into DTM by adding it as a Javascript / Third Party Tag in a page load rule. 

http://developer.vimeo.com/player/js-api

https://developers.google.com/youtube/js_api_reference#Playback_status

Basically, you'd setup the event listeners according to that documentation within the callback functions, you can use _satellite.setVar() to set data elements with information about the given event, and _satellite.track() to pop a direct call rule.  And then within the direct call rule, utilize the data elements you set.  

View solution in original post

8 Replies
Josh_Du
Correct answer by
Level 9
Level 9

"Native support" means you should see options for it within the DTM interface (as opposed to writing your own custom code). 

DTM offers native support for html5 videos.  To set this up, create an Event based rule. Under Conditions > Event Type the dropdown has video events under HTML 5 Video.  If you need to grab information about the video (e.g. the video src url or other meta data in the video tag), the javascript this object is a reference to the video object for the given event. 

As far as I know, DTM has no documented native support for Youtube or Vimeo videos, and they are not listed in the Event Type dropdown. 

However, you can put Youtube and Vimeo event listener code into DTM by adding it as a Javascript / Third Party Tag in a page load rule. 

http://developer.vimeo.com/player/js-api

https://developers.google.com/youtube/js_api_reference#Playback_status

Basically, you'd setup the event listeners according to that documentation within the callback functions, you can use _satellite.setVar() to set data elements with information about the given event, and _satellite.track() to pop a direct call rule.  And then within the direct call rule, utilize the data elements you set.  

View solution in original post

sidh19884490
Level 3
Level 3

Josh Donley wrote...

"Native support" means you should see options for it within the DTM interface (as opposed to writing your own custom code). 

DTM offers native support for html5 videos.  To set this up, create an Event based rule. Under Conditions > Event Type the dropdown has video events under HTML 5 Video.  If you need to grab information about the video (e.g. the video src url or other meta data in the video tag), the javascript this object is a reference to the video object for the given event. 

As far as I know, DTM has no documented native support for Youtube or Vimeo videos, and they are not listed in the Event Type dropdown. 

However, you can put Youtube and Vimeo event listener code into DTM by adding it as a Javascript / Third Party Tag in a page load rule. 

http://developer.vimeo.com/player/js-api

https://developers.google.com/youtube/js_api_reference#Playback_status

Basically, you'd setup the event listeners according to that documentation within the callback functions, you can use _satellite.setVar() to set data elements with information about the given event, and _satellite.track() to pop a direct call rule.  And then within the direct call rule, utilize the data elements you set.  

 

Hi Josh,

My dev is passing the youtube video events into the datalayer. Can I use the values in the datalayer as a condition for the rule? And what shall I use in the event type?

Rahsing
Level 8
Level 8

Hi Sid,

You can use the values in the datalayer as a condition. Here's how to do so:

1. When setting up the rule select the play event (unless you want something else). The reason I'm suggesting is that since you want the condition to be defined by the datalayer, the play event is the one that will best capture the info.

2. Under rule conditions, select 'Data Element value' as the criteria.

3. Depending on the data elements you've defined in your data layer, choose the relevant one and set the condition accordingly.

I hope this helps

please reach out if you have furher queries.

Regards

Rahul

sidh19884490
Level 3
Level 3

Hi Rahul,

It isn't using html5, it is just passing the YT video events values in the datalayer. So, can't use html5 'play' event.

Regards

Syed

Rahsing
Level 8
Level 8

Hi Sid,

Since your YT events are already being passed into the datalayer, you can implement this using a direct call rule.

In case you require the YT video tracking plugin, please contact client care to help you out.

Kind Regards

Rahul    

sidh19884490
Level 3
Level 3

Hi Rahul,

Thanks for the quick reply. Can I fire the direct call rule from the DTM based on these datalayer values without using the developers?

Regards,

Syed

Rahsing
Level 8
Level 8

Hi Syed,

I'm not very clear on what you mean by 'using the developers' could you please elaborate?

Also, yes. you can fire a direct call rule from DTM using the datalayer values. Basically the datalayer value would need to passed as the argument for _satellite.track().

You can find some documentation on it here

Also, some useful blog posts on using direct call rules: post 1 post 2 post 3

Kind Regards

Rahul

sidh19884490
Level 3
Level 3

Hi Rahul,

For this, I assume I need to first check the change in values in the datalayer and then set the direct call rules based on the desired value in datalayer / window. Is there a function that can check for the change in values in the datalayer / window after the page load?

Regards

Sid