Send View Data from a YouTube Video to Marketo

February 2, 2015 | by

Let’s say you want to segment leads in Marketo based on if they have a started or finished a specific video. This is possible to do using Munchkin, YouTube’s Iframe API, and Smart Lists in Marketo.

The example code in this post will let you to send video started and video finished events into Marketo through Munchkin. For this to work, Munchkin must also be loaded on the page before you can start sending video view events into Marketo.

The video started and finished will show up on the lead’s activity log as shown in the first and second screenshot below.

Screen Shot 2015-02-02 at 5.30.30 PM

Screen Shot 2015-02-02 at 5.30.45 PM

After the data is in Marketo, you can then create a smart list and segment leads that have started or finished a video, as shown in the screenshot below.

Screen Shot 2015-02-02 at 5.37.51 PM

Step One: Get the id of the YouTube video you want to embed.
From the URL of the YouTube video you would like to use, note the id, which is the series of random characters after “v=”.

Screen Shot 2015-02-02 at 5.47.02 PM

Step Two: Place YouTube video id from Step One in the eighth line of this code sample. Then place the code before the </body> in the HTML of your page.

Step Three: Create a Smart List in Marketo with the URL of the video and the view event you are looking for as the value of “Querystring contains”.
Screen Shot 2015-02-02 at 5.37.51 PM

Here is a page with a working example of the implementation below.

For more information about YouTube Iframe API, please visit YouTube’s API documentation. For more information about Munchkin, please review the Marketo developer documentation.