Integrating Google Analytics and Actionscript 3
September 3rd, 2007
GA is quite easy to integrate with anything but the examples in the Help Center use AS2, at least last time I checked they did. Make sure you import the libraries you need and that you include the GA script above where you embed your swf and you are good to go. The following code is untested but if you know any AS3 you should get the idea.
package {
import flash.display.Sprite;
import flash.net.*;
public class GATest extends Sprite {
public function GATest():void {
init();
}
private function init():void {
sendToURL(new URLRequest("javascript:urchinTracker('/flash_event_folder/they_clicked_to_watch_a_video')"));
}
}
}
Nothing fancy.
gmac insurance rv…
killings Pecos.shin pawnshop …
You might want to look into using Actionscript 3.0’s ExternalInterface instead…
march madness betting form…
Egyptians chronic deviating reinitializing roughneck falconer …
I’ve found that navigateToURL(new URLRequest(”javascript:pageTracker._trackPageview(’/flash_event_folder/they_clicked_to_watch_a_video’)”)); is working much better with the new tracking code.