Google Analytics Tracking Component for Flash Platform

Although it's not too hard to set up Google Analytics tracking on Flash based web sites the traditional way by referencing JavaScript, there are still good chances for something to go wrong in the process and debugging it is notoriously hard. The good people at Google have provided the Flash Platform Developer community with a great "little" library that wraps the whole process and provides a good debugging mode.

Libraries for Flash and Flex can be downloaded here. I used the one for Flex called analytics.swc.

Installation is as simple as dragging the analytics.swc file into the libs folder in your project.

Once you do that, you have the FlexTracker MXML component available. Setting up the parameters for the component is also easy.

One parameter that I would highlight is visualDebug which if set to "true" provides you with a debugging mode where you can easily see what kind of page views and events you actually are tracking, which shortens debugging time in comparison to the traditional approach tremendously.

The library is accompanied by very good API documentation that you download together with the library. And like all good things in life, it's free : )

Now the down side. The library is pretty darn big! It's 100kb on disk and turns into about 50kb when compressed in a release build. That doesn't sound like too much, but if you are fighting for every kilobyte in optimizing your app, this "spike" in size isn't welcome.

In conclusion, I think this is an excellent solution for Flash Platform web usage statistics. Basically you get out-of-the-box functionality, zero learning curve, very useful data, maximum flexibility and you just have to make peace with a few extra kb.

Additionally, no bugs noticed so far.