PDA

View Full Version : Google Analytics


alexeygu
05-02-2008, 11:01 AM
I want to insert Google Analytics at the beginning of end of the video to see if people watch the whole thing, and see how it impacts the sale process. Any ideas on where I can insert Google's JS code?

Jimb
05-02-2008, 03:08 PM
Alexeygu,

I don't think you can get it to work with the Techsmith player. I believe in order for it to function the player itself needs to have a javascript API. Then you can do something like this.

import flash.external.ExternalInterface;
/** sending the current file,title,id,state,timestamp to callback **/
private function sendVars(stt:String,dur:Number,cpl:Boolean) {
clearInterval(playSentInt);
if(config['callback'] == "analytics") {
var fil = feeder.feed[currentItem]["file"];
if(stt == "start") {
ExternalInterface.call("videoTracker._trackEvent", "start", fil, dur);
} else if (stt == "stop" && cpl == true) {
ExternalInterface.call("videoTracker._trackEvent", "end", fil, dur);
}
}

At least the you know when they played the video and IF they finished watching it to the end.

I am not aware of an API for the Camtasia Stdio player or more to the point documentation on it if it does.

There are 3rd party players that do offer that functionality at the expense of losing some of the cool features that come with the use of ExpresShow.

Jimb