Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

Event Tracking - Google Analytics

17 replies [Last post]

I'm a big fan of the JW FLV Player and also a member of Google Analytics new Event Tracking beta. I'm no ActionScript expert, but I *think* I've successfully modified the default Callback AS included with the player (CallbackView.as) to send data on my site's video plays to GA's Event Tracking. However, my revisions are certainly clunky and aren't tracking all of the data I'd like to. So I was thinking maybe some of the experts here might want to get a head start on revising the Media Player's Callback code to work with Event Tracking, which I understand will be rolled out as <i>the</i> standard for Flash interface tracking in the near future.

To begin with, I think it'd be great if some simple player events could be captured/sent to GA's Event Tracking: total time played, pause button clicks, total time to download, full screen clicks, etc. Google Event Tracking documentation can be found here:

http://code.google.com/apis/analytics/docs/eventTrackerGuide.html

I can share my code if anyone wants to see that too. Interested? Thanks, Jeremy

Hello Jeremy,

Very interesting approach. I am experimenting the same.
If you can share your code, it will be great!!
Please email me at bduverneuil(at)gmail.com or post here!

Thanks a lot!

Hey Ben,

Basically what I've done is change the sendVars function in CallbackView.as as follows:

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);
}
}

The JavaScript on the page is basically what appears in the Google guide. I'm also adding the suggested callback variable in the SWFObject write as per the documentation on this site. It's working on GA as is, but it isn't really tracking anything interesting -- just when videos begin and when (if) they reach the end. I'd like to figure out how to track other events (see my first post above) but I don't know how to get at those variables/events, which I'm guessing are buried inside other of the player's ActionScript files.

Hey Jeremy,

I have an immediate need to implement the events you're proposing. I have some spare time to provide you assistance with this mini-project. Email me at avlok(dot)kohli(at)gmail(dot)com

Cheers,

Avlok

Hello,

Did anything further come from this?

I just went to the Google Event page and I can't find out how I can become part of the beta group - do I need an invite?

I'm working on a similar tracking feature for a Quicktime playback component but I do not have access to the Tracking Beta. I've considered using the "campaigns feature" of google tracking, but would much prefer to use Events the way they are intended.

Any news of how the flash player implementation is going? Any invites to the beta or insight into how to get one?

Thanks

What do I need to do to enable event tracking in GA? I don't see it as an option in my profile settings. Is it still in beta, if so, how do I sign up?

I've been trying to figure out how to join the GA beta, too. Best I can figure is that you need to go to a live GA event and ask them.

Hi,

I just have this feature enabled in my GA, seems great !... Any work progress of what Jerermy wanted to track ?

Can you please show an example of the embed code you used to get your GA integration to work? I'm using this code as but it is not working:

HTML embed:

<p><script type="text/javascript" src="/Media/StaticFiles/scripts/michaelcowan-full.js"></script></p>

.js Javascript contents:

// JavaScript Document

var so = new SWFObject('/Media/StaticFiles/flashplayer/player.swf','mpl','400','253','9');so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');so.addParam('flashvars','&duration=150&file=/Media/StaticFiles/1080p30p_VP6_640x360_900k_wide.flv&image=/Images/StaticFiles/tight-400x225.jpg&bufferlength=3&callback=analytics');
so.write('player4');

You can get access to it by simply adding the events folder to the Google analytics profile URL http://www.leewoodman.co.uk/blog/09042009/346752/google-event-tracking-hack/

Excellent Lee.

Hi,

I've been looking at the Google Analytics Flash component to add to my licensed JW player to track events.

Here's the download and instructions for the Flash component http://code.google.com/apis/analytics/docs/tracking/flashTrackingSetupFlash.html

So, I'd like to track an event when theplay button is clicked and also when the video/media has completed.

I have added the component to the stage (same level as the main 'player' object) and named it 'tracker'.

Does anyone know where I need to add the appropriate code (as documented in the above link) in the AS3 files to implement this handy tracker.

[The point of this tracker component is to enable event tracking of my flash player *wherever* it is embedded - ie: not needing the normal Google Analytics JS code urls to be in place on the page it's embedded on]

Any help/pointer would be great thanks ;)

Cheers,
Kosso

Hi Kosso, just posted an article on how to track events in SWFs embedded on remote sites: http://play.blog2t.net/tracking-events-in-embedded-swfs-with-google-analytics/ I hope that will help you, just thought I could share.

Hi,

I have embeded Youtube video in my website.
I want to track Play, Pause & End Event of the video, also i want to track that for how much time video is played.

Can you help in implementing event tracking for this.

We offer several analytics plugins (http://www.longtailvideo.com/addons/?q=analytics&category=) that can help you track play, pause, and complete events, however I think that GAPro (http://www.longtailvideo.com/addons/plugins/107/Google-Analytics-Pro?q=analytics) is the only one that tracks how much of the video is played.

I still don't know where i should put the tracking code for a flash video player. can anyone help?