Google Analytics provides an easy to use interface that tells you which pages on your website are
being accessed, how often they are accessed, and lots of other useful information about how your website is used.
The problem for me on a recent project was to collect usage statistics for a Flex application. To use Google analytics
you simply include a small javascript element in each page that's served. When the browser executes the
javascript a small message is sent to google recording the page URL that was accessed and some other details about the client.
The first problem with a Flex application is that it's really just a single big(ish) download of the swf (Flash) file, so
all that will get recorded is the fact that someone accessed your application. If the Flex application has several
different views within a view stack none of the navigation between those views will be recorded.
In addition, if the Flex application is using web
services to communicate to a backend server, these requests wont be recorded either. Here's how I got my Flex application to
record statistics of the navigation within the application and the web service calls made to a backend server.
When you register your website with Google analytics you're given a javascript element to include in your pages.
Start by adding this javascript to your html file that loads the Flex application. It should look something like this: