Flash_and_Flex_03_2009

Flex Application Optimization

To do the same with the RIA Analytics by Midnight Coders, the code would look as shown below: public function transactionComplete( tx: Transaction ):void { reading = ReadingIndicator.create( dims, "Transaction count" ); reading.publish(); } Since the reading is associated with the same metadata, it is possible to generate custom queries by slicing the data using the available dimensions. Additional Analytics Facilities Data collection is one of the fundamental elements of any analytics system. In addition to being able to report usage data out of a Flex application, other analytics facilities may include: • Application heat maps – visualize mouse and keyboard activity for various application states. • Custom Dashboards and scorecards – enable companies to create a completely custom interface for visualizing analytics data. Dashboards may include data visualization widgets linked to the stream of readings. • Custom Key Performance Indicators (KPIs) – provide a way to perform custom calculation on top of the aggregated data and/or data from other data sources. The Midnight Coders solution supports all of these facilities in the RIA Analytics product offering. Conclusion One of the key differentiators of the RIAs is user experience and usability. Knowing how the users are using the application, whether they find it intuitive or what they struggle with is very important. Additionally, as with any other line-of-business application, being able to visualize an application’s performance relative to its business impact is the key success factor for many businesses. MARK PILLER Mark Piller is the founder and Chief Architect of Midnight Coders, Inc, where is responsible for company strategy and product development. Mark is passionate about elegantly designed software, ease-of-use and uncompromised usability. He can be followed on Twitter at twitter.com/ midnightcoder

Figure 1. Viewing aggregates data using Midnight Coders Analytics Portal Krista Lapp

many users with a particular OS or resolution clicked the button. It is also important to understand that the dimensions can include any metadata relevant to the submitted data. Below is a screenshot from the RIA Analytics Server Portal interface visualizing received data for the button, see (Figure 1). Business Logic Events Tracking non-UI events is not very different from the UI events. Consider the following function. Suppose the function is invoked when some business transaction completes and the server notifies the client code of the completed transaction: public function transactionComplete( tx: Transaction ):void { .. handle transaction completion here } To track the event with Google Analytics, you can use the same API as for the UI events: public function transactionComplete( tx: Transaction ):void { tracker = new GATracker( this, "UA-111- 222", "AS3", false ); tracker.trackPageview( "/transaction count" ); }

To track the click event of the button with Google Analytics, you need to register a FlexTracker component and then add some ActionScript code handling the click event as shown in Listing 1. Whenever the Buy Now button is clicked, the code above sends a virtual page view of the ‘buttons/buy now page to the Google Analytics tracking servers. What it means is various UI events are tracked from the page view perspective. As a result, Google processes and visualizes a button click in a way that is similar to tracking someone visiting a traditional web page with the Google analytics code in it. The approach is a bit different with the Midnight Coders solution – RIA Analytics. MidnightCoders’APIsupportsdimensionality, thus a developer can attach additional properties to any submitted reading. The code below demonstrates the API for configuring a few dimensions attached to the button click event. The dimensions in this example include the Operating System the client is running and the screen resolution, see (Listing 2). The RIA Analytics server aggregates the data received from Flex clients running the application. Since the data includes dimensions (operating system and screen resolution), you can create customqueries andknowexactly how

On the 'Net

• http://www.google.com/analytics/ – Google Analytics • http://www.themidnightcoders.com/products/ria-analytics – Midnight Coders Analytics

03/2009 (5)

18

Made with FlippingBook HTML5