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.
Is Google ‘Search Plus Your World’ a Game Changer?
We Think So
You may not familiar with, it was only introduced on Jan 10th, it is the addition, some say bias, of Google+ information into the search results. In less than a week, and so far, only in the US, it has turned search engine marketing on its ear. For those who weren’t prepared it could be a disaster, for the early adpters it could be a real boon.
Read the rest of this entry »
Author: Michael Regan