I recently set up some social media links on a site and wanted to be able to track the clicks to each one. These were a couple of graphics that linked to a Twitter page and a Facebook fan page. The site uses Google Analytics to keep track of web statistics, and I wanted to be able to track the clicks to these two graphics. However Google Analytics doesn’t automatically track outbound links. Fortunately Google Analytics does have a little bit of JavaScript that you can append on to a link which will add outbound tracking to your Analytic Contents reports. Here’s the full image/link code for the two graphics:
<a onclick="javascript: pageTracker._trackPageview('/outgoing/twitter');" href="http://twitter.com/myaccount/" target="_blank"><img src="images/extras/social/rightnav/rightnav-twitter.gif" alt="Follow us on Twitter!" width="292" height="70" /></a></code>
<a onclick="javascript: pageTracker._trackPageview('/outgoing/facebook');" href="http://www.facebook.com/pages/myaccount/174805948058" target="_blank"><img src="images/extras/social/rightnav/rightnav-facebook.gif" alt="Join our Facebook fan page!</code>" width="292" height="61" /></a>
Now the important thing here is the onclick event. You want to specify a unique made-up page name. This can also be a directory, like in my example. The actual name or directory doesn’t need to exist. In fact it probably shouldn’t exist, since you don’t want it conflicting with an actual URL on your site.
For my purposes I track all outgoing links by prefixing them with /outgoing/. So to track the Twitter link I set the to _trackPageView(’/outgoing/twitter’). This is so I can filter by ‘outgoing’ and see a report of all outbound traffic.
Now after you’ve had this in place for a day or two you can log into Google Analytics, go to the Top Content report and then filter by whatever your _TrackPageView is set to. In my example, I’d filter by ‘outbound’ and it would return a nice report of all my tracked outbound links. One could even set up a nice custom report to save themselves the steps of having to filter your content report.
Now this solution works for a few links, but wouldn’t be ideal if you wanted to track a large number of links. You could, in theory, cook something up in jQuery or straight-up JavaScript to automatically add in the onclick event to all your outbound links. I am sure something already exists that would handle this.
There is a helpful support page on the topic of manually tracking outbound links available from Google.
I love MobileMe. It complements my workflow in countless ways. I particularly like using the iDisk to sync a selection of files between multiple computers. It’s nice to be able to work on a file during the day on one computer and come home and work on it on another computer without having to copy the file. However, every once in a while it hits a snag and no matter how many times I attempt to manually sync, the files just don’t update and I see a message in the bottom of the finder that says “iDisk not in sync”. So what now? We’ll it’s quite easy to get back up and running. You just need to follow these steps: