At the CV Posse last Thursday the subject of using JW Player with HTML5 came up. I have asked about adding tracking code for analytics to to the script.
Turns out it is fairly easy. This is pretty much copy and paste from the API:
<div id="container">Loading the player ...</div>
<script type="text/javascript" src="/jwplayer/jwplayer.js"></script>
<script type="text/javascript">// <![CDATA[
jwplayer('container').setup({
flashplayer: '/jwplayer/player.swf',
file: 'http://youtu.be/3NmA04QgzaM',
height: 270,
width: 480,
events: {
onPlay: function(event) { _gaq.push(['_trackEvent', 'Videos', 'Play', 'My Video Title']);
} }
});
// ]]></script>
The only part I added was the call to the events. In this case the ‘onPlay’ event calls the ‘_trackEvent’ in Google Analytics.
events: {
onPlay: function(event) { _gaq.push(['_trackEvent', 'Videos', 'Play', 'My Video Title']);
} }
Note: You need to add the comma after the ‘width’ when adding items to the list.
There are a number of events to choose from. I will be adding the onReady and onComplete for tracking. The difference between onPlay and onComplete should give me the number of abandoned views.
Client or Customer?
I have just started reading Jay Abraham’s book “Getting Everything You Can Out Of All You’ve Got”. Near the beginning of the book he makes the distinction between ‘client’ and ‘customer’. In the first chapter he quotes Webster’s Dictionary:
Read the rest of this entry »
Author: Michael Regan