Monthly Archive for December, 2008

Google Analytics and Event Tracking

I received an email from Google this evening announcing that my Analytics Account is part of a limited release currently only available to select profiles. This means that I now have access to a set of features within Google Analytics called “Event Tracking” that do pretty much what they sound like they would, track events.

This is really cool, because for the past few years I have been basically building a fake directory structure that mimicked page views. There wasn’t anything necessarily wrong with this approach, but it was nowhere as ideal as event tracking.

Event Tracking allows you to track interactions with Web 2.0 style content such as Flash, AJAX, Silverlight, social networking apps, etc. We recently made tracking Adobe Flash even easier with the release of a new Flash Tracking client library. It allows for much simpler tracking of Flash content with drag and drop functionality and an open source framework.

 

To use Event Tracking, you will need to upgrade your site to use the new ga.js javascript. Detailed instructions on how to set up Event Tracking on your site are available on our CodeSite.

 

To find your ga.js code snippet, edit the settings for your profile and click the “Check Status” link on the upper right corner of the page. You can now track interactions beyond just pageviews.

Thank you Google, this is a most needed addition to your Analytics.

Insights for ActionScript Developers

I just read a great article on as3dp.com written by Bill Sanders. He covers topics dealing with project deadlines and doing things the right way to a truly insightful piece about the differences between the pursuit perfection and excellence. He also mentions some interesting facts about us ActionScript developers and the things we deal with in our industry. It was uncanny as to how much I could relate to this article.

Read “No Time for OOP and Design Patterns”

Shuffling an Array

I recently needed to shuffle the contents of an array and end up with a randomly sorted or shuffled result. After doing some research and looking at examples of others I noticed that there are several ways to achieve the same goal, but there are clear performance advantages to some methods. Below is an example based off of inspiration of others and what I developed as a test for a commercial project. This example is compatible with both AS2 and AS3.

var input:Array = ["item1", "item2", "item3", "item4", "item5"];
var output:Array = new Array();
 
function shuffle():Array
{
    while(input.length > 0)
{
    var n:Number = Math.floor(Math.random() * input.length);
    output.push(input[n]);
    input.splice(n, 1);
}
    return output;
}
shuffle();

Download the .fla for fully-commented example.