Skip to content

How to configure AVReloaded to work with Longtail's JW Player Google Analytics Pro plugin

Allvideos Reloaded (AVReloaded) is a really nice piece of software engineering from Fritz Elfert. Rather than hardcode for all the individual players out there, Fritz created a macro system that allows you describe the parameters for any player, so it can be configured and updated.

Click for screenshot of Google Analytics Event categories, generated by the Longtail GA Pro plugin
Like the Allvideos plugin, AVReloaded comes bundled with the ubiquitous JW Player for Flash. If you are streaming flash movies from your website, one worthwhile plugin is longtail's Google Analytics Pro. The current license price for the plugin is $19 from longtail's site. If you're already using Google Analytics, the plugin feeds "Content" events from the player to Google Analytics which will show up under the "Event Tracking" menu. Ever have questions like: "I wonder what videos people are actually watching on my site" or "for this new video, how many seconds do they watch before they get bored and close it?" If so, then this plugin is for you. The player will generate events that GA groups into 3 categories: "Video Plays", "Percentage Played" and "Seconds Played". Drilling down you get a nice list of the Videos on your site. For example, finding out that people only watch on average 10% of that promotional video for your product is probably a sign that you may need some better material.

Configuring AVReloaded


I won't go into the specifics of why this works -- you can read the GA Pro plugin manual to understand it more fully, as well as options the plugin provides. I think most people will want to go with the defaults illustrated here. From the AV Reloaded standpoint, what you need to do is replace the default player macro with one that includes the hardwired flashvars parameter which invokes the GA Pro plugin and a second parameter that passes in your GA account id.

This capability is actually built into the licensed JW Player, and the player fetches the plugin from Longtail's Amazon S3 storage. The player then handles the necessary network communication with GA. There's really nothing to install other than to replace the bundled free JW Player with the licensed one you receive from Longtail. You will need to copy it into the /plugins/content/avreloaded directory, and replace the mediaplayer.swf file that comes with AVReloaded with your licensed copy from Longtail.

Then it's a matter of configuring AV Reloaded to turn the feature on by supplying the needed parameters.

From the Joomla admin, components menu, choose AV Reloaded -- Manage Players. You'll get a list of the players that have already been installed. Find the entry for "flv" which you'll see is associated with the JW Player and click on it. This brings up an edit screen with parameters and the "Code" edit box. Select all the code and copy it to a text editor.

The code relies on the swobject and its api, which has 3 sections to it. The first will look something like this:


swfobject.embedSWF('RLOCmediaplayer.swf','DIVID','WIDTH','HEIGHT','FLASHVER',@XPINST@,
{file:'MURL',width:'WIDTH',height:'HEIGHT',@IF(ENABLEJS)@javascriptid:'p_DIVID',
 


After that you'll see a slew of @/IF@ and @/IFS@ statements which act as switches to include the parameters when they have been configured inside AV Reloaded.

Then you'll see a section that looks like this:


lightcolor:'PHICOLOR',screencolor:'PSCCOLOR',overstretch:'STRETCH'}
,{allowscriptaccess:'always',seamlesstabbing:'true',allowfullscreen:'true',wmode:'WMODE...


It is at this point you will want to extend this section so that it includes your Google Analytics Pro plugin call. This comes in the form of a flashvar: plugins=qapro-1, and the gapro.accountid= parameter where you provide your Google Analytics account number.

CODE:
flashvars:'plugins=gapro-1&gapro.accountid=XX-XXXXXXX-X'},


So in summary the full code you need for the flv player that is calling back to Google Analytics when people view videos from your site using JW's Player:


<script type="text/javascript">
swfobject.embedSWF('RLOCmediaplayer.swf','DIVID','WIDTH','HEIGHT','FLASHVER',@XPINST@,
{file:'MURL',width:'WIDTH',height:'HEIGHT',@IF(ENABLEJS)@javascriptid:'p_DIVID',
@/IF@@IFS(PLTHUMBS)@thumbsinplaylist:'PLTHUMBS',
@/IFS@@IF(AUTOSCROLL)@autoscroll:'AUTOSCROLL',
@/IF@@IFS(TYPE)@type:'TYPE',
@/IFS@@IFS(VOLUME)@volume:'VOLUME',
@/IFS@@IFS(CFG)@config:'CFG',
@/IFS@@IFS(LINK)@link:'LINK',
@/IFS@@IFS(IMG)@image:'IMG',
@/IFS@@IFS(LINK)@linkfromdisplay:'LINKFROMDISPLAY',
@/IFS@@IFS(LINK)@linktarget:'LINKTARGET',
@/IFS@@IFS(REPEAT)@repeat:'REPEAT',
@/IFS@@IFS(SHUFFLE)@shuffle:'SHUFFLE',
@/IFS@@IFS(RECURL)@recommendations:'RECURL',
@/IFS@@IFS(DISPLAYWIDTH)@displaywidth:'DISPLAYWIDTH',
@/IFS@@IFS(DISPLAYHEIGHT)@displayheight:'DISPLAYHEIGHT',
@/IFS@@IFS(LOGO)@logo:'LOGO',
@/IFS@@IFS(CAPTIONS)@captions:'CAPTIONS',
@/IFS@@IFS(USECAPTIONS)@usecaptions:'USECAPTIONS',
@/IFS@@IFS(SEARCHLINK)@searchlink:'SEARCHLINK',
@/IFS@showeq:'SHOWEQ',searchbar:'SEARCHBAR',enablejs:'ENABLEJS',autostart:'AUTOSTART',
showicons:'SHOWICONS',@IF(!SHOWNAV)@shownavigation:'SHOWNAV',
@/IF@@IF(SHOWNAV)@showstop:'SHOWSTOP',showdigits:'SHOWDIGITS',
showdownload:'SHOWDOWNLOAD',@/IF@usefullscreen:'USEFULLSCREEN',
backcolor:'PBGCOLOR',frontcolor:'PFGCOLOR',lightcolor:'PHICOLOR',
screencolor:'PSCCOLOR',overstretch:'STRETCH'}
,{allowscriptaccess:'always',seamlesstabbing:'true',allowfullscreen:'true',wmode:'WMODE',
bgcolor:'BGCOLOR',menu:'MENU',flashvars:'plugins=gapro-1&gapro.accountid=XX-XXXXXXX-X'},
{id:'p_DIVID',styleclass:'AVCSS'});
</script>
 


Once you've editted the flv player entry, or replaced it entirely with the one I include here, you simply need to save it. From that point, once people start watching videos you'll see the player stats in the "Events" section of the "Content" reports on Google Analytics. Needless to say, GA doesn't provide realtime updates, so you may have to wait a while for the plays to register.

Trackbacks

No Trackbacks

Comments

Display comments as Linear | Threaded

No comments

Add Comment

Pavatar, Gravatar, Favatar, MyBlogLog, Pavatar author images supported.
BBCode format allowed
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.
Form options