|

providing graphic design, branding, photography and marketing expertise to denver and the world
|
Quote
of the Week:
All solitary dreamers know that they hear differently when they close their eyes. -Gaston Bachelard
|
|
Notes from Notchcode
2.08.2008
Google Analytics part 2: tracking outbound links from within a Flash document using Google Analytics
>Geek-out alert< Tracking intrasite links using GA is pretty easy: as long as you have the tracking code installed in the body of each page, Analytics is doing all the heavy lifting for you. The one exception would be if you have a Flash-based site, in which case you need to do the first half of the below bit. The second half applies to tracking outbound links, either embedded in a Flash file or in normal XHTML. Let's get to the Flash-embedded link-tracking first.
You can track any Flash or java-enabled event using Analytics. The trick is calling out to Analytics in each event (or action in Flash, say) using GA's JavaScript. Here's the note from Google. Specifically for Flash event, you just include an action that tells GA to create a link entry to a fake directory or page. Clicks on those actions in Flash are then recorded by GA as links to that directory/page, and you can then access stats for them in GA. Confused? Don't be, it's simple.
Say I have a map, like this one, and I want to know when people are clicking on, say, Boise. I would place this in the action for my Boise button:
on (release) { // Track with no action getURL("javascript:pageTracker._trackPageview('/city-clicks/boise');"); } I'd then see an entry on my Analytics page for /city-clicks/boise and could measure how many times Boise was clicked. Remember, this works for _any_ action, not just clicks. Over, Hit, Release....lots of possibilities to measure how people interact with your Flash file here.
Now for part 2.
The map example above was developed for one of my clients, who needed a gateway page that their member public radio stations in different states could send people to when they wanted to donate money. They wanted one simple URL to announce on-air, to keep their branding and messaging consistent. Easy enough. As you can see on the example page, there's a list of stations below the map with clickable logos and text links to the member stations' giving/donation pages.
But we wanted something more compelling. Something that would make station location easy for geographically disprate listeners easy. The idea of a map came up, and we realized we could do something special with it in Flash: the user rolls their cursor over the map, landing on their city. The city's state is highlighted, and a balloon with the call letters and station logo appear, linked to the city location. Not too flashy, but it provides necessary information for the user (is this my station? If I click here am I giving to my station, or to someone else's?) and does it without making things too crowded (a list of stations and call signs or cities).
The problem was this: With all of this in Flash, Analytics has no way of tracking the links out to the member stations' donation pages. So all GA tells us is how many people visited the map page, not where they went afterwards. Not very useful when the client wants to be able to tell a particular station how many potential donors they sent them. Enter the JavaScript call mentioned above, but slightly modified.
Before we implemented this action, the action to send people from the Flash map to, say, Boise, looked like this:
on (release) { getURL("http://radio.boisestate.edu/members.html"); }
...and they were sent on their way to KBSU in Boise. But they weren't being tracked.
So we added this:
on (release) { getURL("javascript:urchinTracker('/outgoing/kbsu');"); getURL("http://radio.boisestate.edu/members.html"); }
and now Analytics reports each click for KBSU as a link to the fictional directory "/outgoing/kbsu", making it a breeze to track.
There are a few additional things to do, like placing your Analytics tracking code ABOVE the Flash element that contains your embedded tracking calls, but really it's pretty easy. I mean, it's not rocket science. So give it a try, and your Flash-based design clients will love you.
For more information on how to embed tracking code for outbound links, see these Google Analytics help documents:
How do I track Flash events?
How do I manually track clicks on outbound links?
Labels: analytics, flash, interface, seo, web design
posted at 7:30 AM
Leave your comments here:
0 comments
Leave your comments here:
0 comments


|