<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>refresherate.com &#187; SEO</title>
	<atom:link href="http://www.refresherate.com/category/seo/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.refresherate.com</link>
	<description>An invigorating splash of web geek goodness.</description>
	<lastBuildDate>Wed, 08 Sep 2010 18:07:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Tracking Outbound Links with Google Analytics</title>
		<link>http://www.refresherate.com/2009/12/18/tracking-outbound-links-with-google-analytics/</link>
		<comments>http://www.refresherate.com/2009/12/18/tracking-outbound-links-with-google-analytics/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 20:45:35 +0000</pubDate>
		<dc:creator>Sheldon Finlay</dc:creator>
				<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://www.refresherate.com/?p=197</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<p>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 <a href="http://twitter.com/sheldonfinlay">Twitter</a> page and a Facebook fan page. The site uses <a href="http://www.google.com/analytics">Google Analytics</a> to keep track of web statistics, and I wanted to be able to track the clicks to these two graphics. However Google Analytics doesn&#8217;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&#8217;s the full image/link code for the two graphics:</p>
<pre>&lt;a onclick="javascript: pageTracker._trackPageview('/outgoing/twitter');" href="http://twitter.com/myaccount/" target="_blank"&gt;&lt;img src="images/extras/social/rightnav/rightnav-twitter.gif" alt="Follow us on Twitter!" width="292" height="70" /&gt;&lt;/a&gt;&lt;/code&gt;

&lt;a onclick="javascript: pageTracker._trackPageview('/outgoing/facebook');" href="http://www.facebook.com/pages/myaccount/174805948058" target="_blank"&gt;&lt;img src="images/extras/social/rightnav/rightnav-facebook.gif" alt="Join our Facebook fan page!&amp;lt;/code&amp;gt;" width="292" height="61" /&gt;&lt;/a&gt;</pre>
<p>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&#8217;t need to exist. In fact it probably shouldn&#8217;t exist, since you don&#8217;t want it conflicting with an actual URL on your site.</p>
<p>For my purposes I track all outgoing links by prefixing them with /outgoing/. So to track the Twitter link I set the to _trackPageView(&#8216;/outgoing/twitter&#8217;). This is so I can filter by &#8216;outgoing&#8217; and see a report of all outbound traffic.</p>
<p>Now after you&#8217;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&#8217;d filter by &#8216;outbound&#8217; 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.</p>
<p>Now this solution works for a few links, but wouldn&#8217;t be ideal if you wanted to track a large number of links. You could, in theory, cook something up in <a href="http://jquery.com">jQuery</a> 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.</p>
<p>There is a helpful support page on the topic of <a href="http://google.com/support/analytics/bin/answer.py?answer=55527">manually tracking outbound links</a> available from Google.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.refresherate.com/2009/12/18/tracking-outbound-links-with-google-analytics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
