Since Google released Event Tracking in their analytics packages, I’ve come across some reasons to use it in the SWFAddress framework, but of course it is not a part of the SWFAddress package yet. It sounds like Asual.com may plan on implementing it in later releases, but until then, this quick code can be added to the SWFAddress JavaScript code to implement the feature:
SWFAddress.trackEvent = function(/* String */ category, /* String */ action, /* String */ label, /* Int */ value) {
var tracker = (typeof pageTracker != 'undefined') ? pageTracker : SWFAddress.getTracker();
if (tracker && tracker._trackEvent) {
if (typeof trackers[object] == 'undefined')
_tracker.trackEvent(category, action, label, value);
}
}
And if you’d like to add it to the SWFAddress ActionScript (3) code, use this:
public static function trackEvent(category:String, action:String, label:String=null, value:int=null):Void {
if (_availability) ExternalInterface.call('SWFAddress.trackEvent', category, action, label, value);
}

No comments yet
Comments feed for this article