In this informative webinar, you'll discover the proven strategies smart subscription businesses are using to counter fraudulent transactions and lower chargebacks.
tag
* 2) Place
* where you want the video to appear
* 3) Change XXXXXXXXXX in 2) to your YouTube video ID, from the YouTube URL
* 4) To track, use "click link on web page" and link name contains "domain.com/munchkinVideoTracker/"
*
***************************************************************************/
// Set options
var
playerEl= "yt-player", // id attribute of html element to be replaced with iframed video player
playbackMilestones= [ 25 , 50 , 75 ], // playback percentages, log action when reached
showRelatedVideos= 0, // set to 1 to show suggested videos when the video finishes
showControls= 1, // set to 1 to show player controls
showInfo= 0, // set to 1 to show video title and player actions
autoplay= 0, // set to 1 to begin playing video immediately
playerRelHeight= .5625 // player height relative to width; .5625 for 16:9 aspect ratio; .75 for 4:3
; // close statement
/*********************** DO NOT EDIT BELOW THIS LINE **********************/
// Accepts id (with hashtag) of iframe containing YT player
// Set the height of the YouTube player proportionately to width
function setPlayerHeight( playerEl ) {
var width = $(playerEl).parent().width();
$(playerEl).height( Math.round(width * playerRelHeight) + "px" );
}
// Returns current time code (minutes:seconds) of video
function getTimeCode() {
var minutes = Math.floor( player.getCurrentTime() / 60);
var seconds = Math.round( player.getCurrentTime() % 60);
if(minutes < 10) minutes = "0" + minutes;
if(seconds < 10) seconds = "0" + seconds;
return minutes + ":" + seconds;
}
// Returns current percentage of video that has been played
function getPlaybackPercentage() {
return Math.round( 100 * ( player.getCurrentTime() / player.getDuration() ) );
}
// Returns unique YouTube video ID
function getVideoId() {
return player.getVideoData()['video_id'];
}
// Log video playback milestones
function logPlaybackMilestones() {
// if video is playing...
if( player.getPlayerState() == 1 ) {
// then check to see whether we're at a playback milestone
for(i=0;i