Re: Munchkin API to record video player start and stop

Robb_Barrett
Marketo Employee

Munchkin API to record video player start and stop

In the Munchkin API reference, there are several claims made that the Munchkin API can be used to track video starts and stops but I don't see explicit instructions.

http://developers.marketo.com/javascript-api/lead-tracking/api-reference/

The closest I can see would be the clickLink, but that would only work if one has access to the video player itself. For example, if I'm using YouTube to host my video and I'm embedding it onto my site, I don't see where I have access to the start and stop button.  I know that the YouTube iFrame API will give me access to see a start and stop but I don't think I'm really clicking a link....I'm not going to a destination, I'm clicking a control.

Is the expectation that I'd use the Associate Lead and write the activity to a field in my Marketo DB?

Robb Barrett
Tags (3)
5 REPLIES 5
Grégoire_Miche2
Level 10

Re: Munchkin API to record video player start and stop

Sanford Whiteman​,

This one is for you

-Greg

Jenna_Molby10
Level 3 - Champion Alumni

Re: Munchkin API to record video player start and stop

Hi Robb,

There's a post on the Marketo Developer's blog that explains how to track YouTube video plays. Here's the link:  http://developers.marketo.com/blog/send-view-data-from-a-youtube-video-to-marketo/

SanfordWhiteman
Level 10 - Community Moderator

Re: Munchkin API to record video player start and stop

Robb, you can see more info on these posts and more and look at my simple demo​ from long, long ago (before the blog post).

You do need to use the IFrame API or the (unfortunately deprecated) JavaScript API.  With the IFrame API, you listen for special events in the YouTube custom event model (which itself uses the Web Messaging API) and then translating them into synthetic (that is, manual) Munchkin clickLink calls. You aren't listening directly for "clicks" on the YouTube control bar.

The advantage of the JS API is that you can build a totally custom control bar and catch events that the IFrame API can't. For example, this custom player I built can tell if the lead clicks the "Full Screen" and "Open in YouTube" links!

youtube_plyr_custom.png

Robb_Barrett
Marketo Employee

Re: Munchkin API to record video player start and stop

OK, thanks. That's cool to know. Looks like the issue here is that you have to view it as a "Click Link" and not a custom activity, and then when it's written as an activity it's a bit difficult to work with since you can't easily query the Activity log.

The approach I'm taking (to do the same thing) is to utilize the iFrame API along with a hidden form submission that doesn't just tell me that they clicked to watch, but every X number of seconds reports the amount of time watched, which can then be written (via Form API) to a Marketo field and put into a note or used for scoring purposes.

So, Sanford Whiteman​, do you make the argument that utilizing the activity is a better option? I really don't care as much that they went full screen with it as I do to know how much time they spent watching it.

Robb Barrett
SanfordWhiteman
Level 10 - Community Moderator

Re: Munchkin API to record video player start and stop

I'd be wary of auto-posting forms on a timer. There's still a limit of 1 form post every 2 second from each source IP. If multiple leads behind the same firewall (i.e. corporate NAT IP) are watching a video, collisions are quite possible. (While for a single form post per lead, going over the limit is extremely unlikely; the limit fits well in the real world of form submissions while discouraging abuse.)

So I would make the argument that Munchkin, which is infinitely more scalable by design, should be used instead. To send a value using the Munchkin API, use the method I describe here.