Wed 16 Aug 2006
Metrics for Flash
Posted by Brian Busche under Flash, web design, ActionScript
No Comments
Recently someone asked me about reporting tools for Flash navigation events. I have had some experience using Omniture, Google Analytics, and Atlas DMT. So here’s what I know.
Typically, there is a JavaScript function in the HTML container page that your SWF will call using the getURL() method. We have used ExternalInterface.call() to call the JavaScript function, but found it to be unreliable under certain browsers.
The JavaScript function for Omniture is sendAnalyticsEvent(), for Google Analytics its urchinTracker(), and for Atlas DMT they use GetActionTag(). All of these functions accept a string, which your Flash sends to indicate the state of the application in terms of navigation. Lots of planning goes into determining which “states” the client would like to measure as “trackable” navigation points. For Omniture and Google you typically create a folder-like approach to creating those string values. This is an important consideration since most of these metrics tools see the site as a series of folders and files. Therefore your tracking strings may look something like this:
/flash/about_us/contact
/flash/our_products/product_A/description
/flash/our_products/product_A/purchase_link
/flash/video_page/view_video_B
/flash/shopping_cart/view_contents
/flash/shopping_cart/shipping_method/ups_ground
In the above example, the Flash application has an “about us” section, and “our products” section, a “shopping cart” and a “video page”. Each of those states have their own sub-sections that are being tracked as if the user is navigating a folder structure in HTML. This seems to be the best practice approach to analytics reporting, but it is certainly open for discussion.
Figuring out the string value and the navigation states is actually a lot more work than coding the thing. Once you have figured that part out, you will want to choose whether to track the click or the landing for a particular state. I tend to code the “landing” since we then know for sure the user is experiencing that particular condition. It is personal preference. From there the code is simply a JavaScript call wrapped inside the getURL() statement, like this:
// For Google Analytics
getURL("javascript:urchinTracker(‘/flash/about_us/contact‘);");
// For Omniture
getURL("javascript:sendAnalyticsEvent(‘>flash>about_us>contact‘);");
// For Atlas DMT
getURL("javascript:GetActionTag(‘contact‘);");
Notice that Omniture uses “>” instead of the forward slash for their directory indicator. In my experience with Atlas DMT, I did not use the directory structure, and the tags were all defined ahead of time. It is unclear if they support the directory path methodology. I do know that their tags have to be used exactly as they were entered into the reporting system, including case-sensitivity.
The examples above assume we are tracking the ”contact” sub-section of the “about us” page in a fictitious Flash application. If you want to create a library type implementation, I would suggest a Tracking class that allows you to globally switch the metrics from Omniture to Google or whomever, while providing an API that never needs to change. We use a Tracking.as class, then call Tracking.track(stringValue);

