Tracking Events in Flash Applications

Using Page Tags

Macromedia Flash has been around for a long time, at the time of writing this it is now on version 9 and in some circles on the web it has become quite popular. This is because it allows designers to quickly create very pretty and functional websites, web applications and interactive presentations (as well as the odd moving graphic).

With all this simplicity there are some trade-offs as with any development platform. For example, search engines have historically had trouble indexing Flash files although this is slowly improving. Also tracking online visitor behaviour within a flash application or flash website is impossible using the traditional log file analysis, associated with many web analytics packages. This is because only the initial request for the one flash file is ever recorded to the log.

Web analytics for traditional websites mainly focussed around the analysis of log files which can track visitors moving from page to page. Over the past few years page tags have been introduced in order to track visitors by their on-page events, this includes online applications such as Flash and technologies like AJAX. Collectively this new breed of interactive web applications is being classed as Web 2.0, but that's another article for another day.

So how can we track visitor events in Flash or indeed any Web 2.0 rich internet online application using page tags?

A page tag is essentially a piece of JavaScript code that when called, records information about the visitor that requested it and what they were doing at the time. Extra information can be stored by the page tag as a parameter or name/value pair. For Example, category=Red_Balloons or page_completed=2 etc. This means that you could track events like the following:-

  • When a user transitions between 'pages'
  • When a zoom/detail mode is activated to at something in detail.
  • Each question of a quiz (along with the answers/score)
  • Slides of a presentation
  • 30 second segments of a movie
  • Form field fill-in events
  • Scrolling down a 'page' / 'document'
  • Basically Anything!!

The flash actionscript code to achieve this looks like:-

function MyButtonReleasedEventHandler ()
{
fscommand ("ntptEventTag","zoom=50&user=Matt&page=2");
}

The above line of code uses the fscommand to run the external Javascript page tag function 'ntptEventTag' that allows meta data to be recorded by the NetTracker/NetInsight page tag. This extra meta information that can later be extracted in to the analytics application. We suggest that this event trigger be associated with an event handler in Flash.

This means that you can build up a picture of all of the zoom values of a particular user and know which page within the movie each action occurred.

Disadvantages to event tracking:

  1. It is very easy to get carried away and start tracking every event. It is therefore esstential to first decide what information you want to obtain.
  2. It is a very manual task as you need to define which events to track and what meta information to record
  3. You need to edit the Flash source code and therefore you need to have the skills available to do this
  4. You will not have any historical analytical information (although this is true of all page tagging data collection methods)

How can NetInsight and NetTracker help?

Both NetTracker and NetInsight can process log files from any web server and page tag data from websites, together with their flexibility on presentation and custom report building, web 2.0 applications such as AJAX or Flash movies can be effectively analysed.

Example reports that may be useful are path reports to show how people navigate the applications, scenario funnels to see how many people go through a defined path, and any number of custom reports based around the meta data collected by your page tags.

If you have any further questions on tracking events in web 2.0 applications or would like an evaluation of NetTracker or NetInsight then please call our Web Analytics Team on 01293 403636.