When developing Flash based sites, you’ll quickly discover that the regular visitor statistics tools don’t work, as Flash doesn’t request plain HTML pages, but dynamically loads .swf and .xml files, depending on user interaction.
In order to be able to track what your visitors are doing in your Flash site, you need to call stats-triggers from within your Flash application. This can be as simple as calling a Javascript statement in the containing HTML file, which in turn sends a statistics ping to your reporting server.
But often, that’s not enough. We want to be able to track not only what users are doing inside the app we built, but also how users that originate from different websites behave. For example, perhaps Banner A is clicked 5000 times, but only 0.5% of those people actually make a transaction, once in the site, whereas Banner B is clicked only 1000 times, but 12% of those visitors are buying stuff in the Flash app.
So, it’s not only important to know how people behave, but what conversion ratios are realized from each banner, emailing or DM campaign. So we teamed up with a company named OneStat, as they are also interested in improving measurement of user behaviour in Flash sites.
As a result, we’ve been implementing a statistics ActionScript class for some time now that handles all reporting to the OneStat server through LoadVars (thus eliminating the need for the Flash > Javascript > Image object refresh trick).
The main event management code in our application can be instructed to send each and every mouse click if needed, but usually we measure visiting certain sections of an app and subscribing to newsletters, making transactions and the like. Below, I have represented our current stats reporting flow (in this case for the Hi Bling Bling campaign):

As you can see, when a user clicks a banner or link in a newsletter, he or she is first forwarded to the OneStat server, which records the click-in and retrieves the correct campaign ID the clicked link belongs to. This happens in a split second, visitors don’t notice this at all. Next, the actual Flash site is launched and the campaign ID is transmitted as one of the initial variables. All consequent clicks and conversion / transaction points we want measured are then reported to the OneStat server, including the initial campaign ID.
This setup enables us to get a very detailed impression of what banners work and which don’t, so we can help our clients in choosing the right sites to place banners on etcetera. It also gives us a great insight in the usability of a Flash based site. Do people just land on the main page, get confused and leave? Or do they really interact and visit multiple sections of the application? Are there steps in the application where many people tend to drop out? That’s interesting information.