RSS Feed for This PostCurrent Article

Fun with Google Analytics in the Flash IDE with AS3

ExternalInterface.call()
There’s always External Interface method. Some good tutorials on this out there too.

So far I found 1 Flashcoders post about a bug in IE7 that doesn’t allow the use of this technique.

nagivateToURL()
People seem to be complaining about unwanted popup windows with this method. It seems to work fine for me in the browser, both locally and off a server. Popup windows only show up with Test Movie, which, while annoying, will not be an issue with clients.

Google’s AS3 components
Google has an Analytics component and an Analytics Library component that doesn’t require any javascript on your page and talks to their analytics system directly. Only problem seems to be it adds between 60KB and 40KB to your file size. The cool part – it has Event tracking.

SWFaddress for Google Analytics tracking
There’s a way to use SWFaddress 2.0 together with ga.js to track page views in Flash sites.

sendToURL()
There’re a few posts from 2007 that utilize the global function sendToURL().

/* ... */
var trgtURL:URLRequest = new URLRequest("javascript:pageTracker._trackPageview('mypath/mypage_link');");
sendToURL(trgtURL);
/* ... */

This technique wouldn’t work & gave me a security error every time, both during Test Movie and from a live server. I suspect the Flash player security changes between 9,0115 and 10 banned this method. Here’s the error: “Security Error: Error #2169: The method sendToURL may not be used for browser scripting. The URL javascript:pageTracker._trackPageview…”

getURL() ?
Oh, I hope not…

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay

Trackback URL



Post a Comment

About - Contact - Privacy Policy - Terms of Service