Archive for the ‘gaforflash’ tag
Google Analytics for Myspace

Tracking without JavaScript using gaforflash
I offer you a ready-made tracker for Google Analytics (GA) that can be used in Myspace or any other place where you are not allowed to use JavaScript. For those who speak geek this is nothing new, this is mainly dedicated to non-users of flash.
As I was customizing the myspace profile for by friends’ punk rock band Cacophonics I realized the need to track users. As Google Analytics (my tracking system of choice) uses JavaScript but Myspace does not support that I set up a small tracker using gaforflash.
Once you have a GA account and have uploaded somewhere the myspaceGA.swf file you only need to copy the following code in your About section in Myspace and modyfie the highlighted values to represent your GA account number, url to locate the myspaceGA.swf and the color of the 1 by 1 pixel area the swf file will take to match the background.
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" height="1" width="1">
<param name="movie" value="http://www.edzis.com/random/myspaceGA.swf?account=UA-XXXXXXXX-Y" />
<param name="bgcolor" value="080808" />
<embed type="application/x-shockwave-flash" src="http://www.edzis.com/random/myspaceGA.swf?account=UA-XXXXXXXX-Y" height="1" width="1" bgcolor="080808" />
</object>
In case you do not have your own hosting server where to keep your own copy of myspaceGA.swf you can risk to use the current url for it. However but I do not guarantee that the file will always be there and available to you. In case of any changes I will notify everyone who posts a comment on this blog.
And just in case you want to know how this was done – here is the code you can use:
package {
import com.google.analytics.AnalyticsTracker;
import com.google.analytics.GATracker;
import flash.display.Sprite;
import flash.events.Event;
/**
* ...
* @author Edgars Simsons, edzis on edzis (dot) com, www.edzis.com
*/
public class Main extends Sprite {
private var tracker :AnalyticsTracker;
public function Main():void {
if (stage) init();
else addEventListener(Event.ADDED_TO_STAGE, init);
}
private function init(e:Event = null):void {
removeEventListener(Event.ADDED_TO_STAGE, init);
// entry point
var account:String = loaderInfo.parameters.account;
if (account == null || account == "") return;
tracker = new GATracker(this, account);
tracker.trackPageview();
}
}
}
Event Tracking in Google Analytics
Google recently announced Google Analytics Tracking For Adobe Flash by publishing gaforflash library. This is a standardized and officially supported way for flash platform to track pageviews and events, with the second available only in Event Tracking Beta. Yesterday I checked it out.
After some misunderstandings in the initiation process (tracker has to be of type AnalyticsTracker instead of GATracker) I got my pageviews tracked. But, as i am not enrolled in Event Tracking Beta, the GA user interface did not provide me with access to the events I had tracked. But today I found the cure for that – it is still possible to access event data by navigating to Content Overview and changing the URL from /analytics/reporting/content to /analytics/reporting/events.