Marketo munchkin does not (yet) have events like Google Analytics, so in order to track web events like video plays there are only two choices:
My preference is to use the clickLink as URL parameters are harder to segment inside Marketo. My scheme for storing events is to build a fake url as follows:
| Element | Description | Example |
|---|---|---|
| Base Path | just the page name, strip the URL of the domain and any parameters | /marketo-munchkin-event-tracking |
| Event Source | something to uniquely identify the content source such as the video name or id. You're going to use this name later as part of the segmenation and should be unqiue across all your creatives | /no-cookies |
| Event Type | One of a list of possible tracking events you would like to categorize. This is your created list, below are some suggestions:
| /youtube |
| Event Action | An action associated with to the particular event. You can choose your action names to suit your needs but I would suggest they make sense in the context the action names are used. For videos, you might choose:
| /play |
So a visitor on this page, playing a video in a youtube container would have an fake event url built up as follows:
/marketo-munchkin-event-tracking/no-cookies/youtube/play.
Note: for this tracking to work you must have already loaded and initialized Marketo's munckin tracking code before calling this function, otherwise the clickLink function will fail.
sample code for tracking callback function
<script type="text/javascript" language="Javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript" language="Javascript" src="/jQuery.tubeplayer-1.0.3.min.js"></script>
<script type="text/javascript" language="Javascript" src="http://munchkin.marketo.net/munchkin.js"></script>
<script type="text/javascript" language="Javascript">
// use no conflict mode for jQuery
if (typeof $jQ == 'undefined') { var $jQ = jQuery.noConflict();}
function mktoVidEventTrack(event, eventType) {
// clean up the pathname
if (window.location.pathname.search(/\?/) != -1) {
var refUrl = window.location.pathname.slice(sUrl.search(/\?/));
} else {
var refUrl = window.location.pathname;
}
// dynamically build the event url with the event name and event action
refUrl += '/' + event.videoID + '/' + eventType;
mktoMunchkinFunction('clickLink', { href: refUrl });
return;
}
...
$jQ('document').ready({
// make sure Munchkin is loaded and initalized
mktoMunchkin("999-AAA-999");
$jQ('#youtube-player-container').tubeplayer({
autoPlay: false,
initialVideo: 'ZJlkplvYdgA',
onPlayerPlaying: function(){mktoVidEventTrack(jQuery('#youtube-player-container').tubeplayer('data'), 'play');},
onPlayerEnded: function(){mktoVidEventTrack(jQuery('#youtube-player-container').tubeplayer('data'), 'stop');},
onPlayerPaused: function(){mktoVidEventTrack(jQuery('#youtube-player-container').tubeplayer('data'), 'paused');}
});
});
</script>
Inside Marketo, you should build a "listener" campaign for each of your assets or events and then take an appropriate action. If your choose your action names wisely and uniquely, then you could build generic event tracking, only look for the action names in any urls using the contains criteria. In the example below, its built for tracking a specific video and I have shorten the relative URL link in the flow steps for illustration purposes.
Campaign Smart List
Campaign Flowsteps
To be able to track events for various items, it must have some sort of API/callback mechanism. Most modern JavaScript video players provide a mechanism and YouTube has created one as well. You aren't only limited to just video, you could put a link tracker in an ROI calculator and capture the data each time your lead fill it out.
Video JavaScript API reference documentation
jQuery video plugins with event callbacks
Use the YouTube example below to demonstrate video play events that you might want recorded in Marketo. To get started, just play the video and look for your events to the right of the video player.
Event |
Connect with me on: