Recently at the University of Northern Colorado we launched our new brand, “Bringing Education to Life”. As part of the launch the web team was charged with coming up with a landing website for the brand.
The site was created in Flash and when you click on different links, it uses the UILoader component in flash to display other Flash files. Each of these clicks is recorded in the log files, but our analytics tool doesn’t count .SWF flies.
Google Analytics Tracking:
On each of the clickable items there is this code.
navigateToURL(new URLRequest(“javascript:pageTracker._trackPageview(‘/life/component/” + e.currentTarget.theURL + “‘)”), “_self”);
Basically, it tells the Google Tracker to register a click. Above I tell the tracker to register at the url /life/component/itemname
Here is what it looks like in Google Analytics:

Basic Code:
Imports:
import flash.net.navigateToURL;
import flash.net.URLRequest;
Code:
navigateToURL(new URLRequest(“javascript:pageTracker._trackPageview(‘theURL to register ‘)”), “_self”);
Tags: Flash, Google Analytics







This article was published on Wednesday, March 31st, 2010 at 10:30 am. View other posts in the Code category.
If you found this article helpful please share it. If you have questions please ask them in the Comments section.