<?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>David Simpson &#187; analytics</title>
	<atom:link href="http://davidsimpson.me/tag/analytics/feed/" rel="self" type="application/rss+xml" />
	<link>http://davidsimpson.me</link>
	<description>Developing the web, one page at a time.</description>
	<lastBuildDate>Wed, 16 May 2012 20:14:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Adding custom dimensions in Webtrends. A video tutorial.</title>
		<link>http://davidsimpson.me/2012/02/23/adding-custom-dimensions-in-webtrends/</link>
		<comments>http://davidsimpson.me/2012/02/23/adding-custom-dimensions-in-webtrends/#comments</comments>
		<pubDate>Thu, 23 Feb 2012 19:40:59 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[analytics]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[webtrends]]></category>

		<guid isPermaLink="false">http://davidsimpson.me/?p=1404</guid>
		<description><![CDATA[This post is a short video tutorial that shows how to add custom dimensions to Webtrends. Having setup event tracking on Webtrends, you&#8217;ll likely want to build reports in the Webtrends admin UI. Even after adding event tracking JavaScript, reporting of your dimension or measure doesn&#8217;t just happen magically. Webtrends needs to know what to [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton1404" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fdavidsimpson.me%2F2012%2F02%2F23%2Fadding-custom-dimensions-in-webtrends%2F&amp;via=dvdsmpsn&amp;text=Adding%20custom%20dimensions%20in%20Webtrends.%20A%20video%20tutorial.&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fdavidsimpson.me%2F2012%2F02%2F23%2Fadding-custom-dimensions-in-webtrends%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://davidsimpson.me/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;"></a></div><p>This post is a short video tutorial that shows how to add custom dimensions to Webtrends.</p>
<p>Having setup <a href="http://davidsimpson.me/2011/11/04/a-simple-webtrends-event-tracking-tip/">event tracking on Webtrends</a>, you&#8217;ll likely want to build reports in the Webtrends admin UI.  Even after adding event tracking JavaScript, reporting of your dimension or measure doesn&#8217;t just happen magically. Webtrends needs to know what to look for. So, before you can create reports, you&#8217;ll need to add the dimension. </p>
<p>When creating custom dimensions or measures from events tracked via <b>dcsMultiTrack</b>, example query parameter <b>DCSext.w_custom_identifier</b> will be converted into <b>w_custom_identifier</b> in Webtrends, so this is the name of the query parameter that you then add in the Webtrends Admin UI.</p>
<h2>How to add a new dimension</h2>
<p>Check the short video below for details on adding new dimensions:</p>
<p><iframe width="500" height="375" src="http://www.youtube.com/embed/geHGDBLBPRw?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<h2>How to add a new dimension based on a lookup table</h2>
<p>Lookup tables are a great way of converting one metric into another within Webtrends.  The easiest way to create a lookup table is to add a CSV file under the Webtrends installation directory here:<br />
<code>.\wtm_wtx\datfiles\datasources\MyLookupTabel.csv</code><br />
If you use Webtrends On Demand, then you&#8217;ll have to submit the lookup table to Webtrends for them to install.</p>
<p>Check the short video below for details on adding a new dimension based on a lookup table</p>
<p><iframe width="500" height="375" src="http://www.youtube.com/embed/3Xd6uSUBBp4?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://davidsimpson.me/2012/02/23/adding-custom-dimensions-in-webtrends/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A simple Webtrends event tracking tip</title>
		<link>http://davidsimpson.me/2011/11/04/a-simple-webtrends-event-tracking-tip/</link>
		<comments>http://davidsimpson.me/2011/11/04/a-simple-webtrends-event-tracking-tip/#comments</comments>
		<pubDate>Fri, 04 Nov 2011 14:50:31 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[analytics]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[webtrends]]></category>

		<guid isPermaLink="false">http://davidsimpson.me/?p=1220</guid>
		<description><![CDATA[In Webtrends, events that happens after the page loads can be tracked using dcsMultiTrack. This takes the following form: dcsMultiTrack( key1, value1, key2, value2, key3, value3, ... ); But what if you don&#8217;t know how many key/value pairs you&#8217;ll be sending into dcsMultiTrack? How do you call it then? Take advantage of the JavaScript apply [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton1220" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fdavidsimpson.me%2F2011%2F11%2F04%2Fa-simple-webtrends-event-tracking-tip%2F&amp;via=dvdsmpsn&amp;text=A%20simple%20Webtrends%20event%20tracking%20tip&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fdavidsimpson.me%2F2011%2F11%2F04%2Fa-simple-webtrends-event-tracking-tip%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://davidsimpson.me/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;"></a></div><p>In Webtrends,  events that happens after the page loads can be tracked using <b><a href="https://tagbuilder.webtrends.com/Help/EventTracking/DcsMultiTrack.aspx">dcsMultiTrack</a></b>.</p>
<p>This takes the following form:</p>
<pre class="brush: plain; title: ;">dcsMultiTrack( key1, value1, key2, value2, key3, value3, ... );</pre>
<p>But what if you don&#8217;t know how many key/value pairs you&#8217;ll be sending into <b>dcsMultiTrack</b>? How do you call it then? </p>
<p>Take advantage of the JavaScript <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/function/apply">apply</a> function.  Create an array of key/value pairs and then apply that array to the <b>dcsMultiTrack</b> function:</p>
<pre class="brush: plain; title: ;">
var webtrendsArgs = [
	'DCSext.w_event_type', 'Video Started',
	'DCSext.w_video_id', 'xxxx-yyyy-zzzz-1234',
	'DCSext.w_video_name', 'Kitten Video'
	];

dcsMultiTrack.apply(this, webtrendsArgs);
</pre>
<p>This is equivalent to:</p>
<pre class="brush: plain; title: ;">
dcsMultiTrack(
	'DCSext.w_event_type', 'Video Started',
	'DCSext.w_video_id', 'xxxx-yyyy-zzzz-1234',
	'DCSext.w_video_name', 'Kitten Video'
);
</pre>
<p>If needed, you can add the key/value pairs to <b>webtrendsArgs</b> array incrementally and when complete, apply this to <b>dcsMultiTrack</b> at the end.</p>
<p><cite>Source: <a href="http://stackoverflow.com/questions/6078103/webtrends-analytics-implementation-using-variables-in-an-async-tracking-call-p">StackOverflow</a></cite></p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://davidsimpson.me/2011/11/04/a-simple-webtrends-event-tracking-tip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Analytics Tip: Use Advanced Segments</title>
		<link>http://davidsimpson.me/2010/09/24/google-analytics-tip-use-advanced-segments/</link>
		<comments>http://davidsimpson.me/2010/09/24/google-analytics-tip-use-advanced-segments/#comments</comments>
		<pubDate>Fri, 24 Sep 2010 19:26:11 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[analytics]]></category>
		<category><![CDATA[google analytics]]></category>

		<guid isPermaLink="false">http://davidsimpson.me/?p=902</guid>
		<description><![CDATA[I&#8217;ve said it before, but I&#8217;ll say it again — I like to #measure. Google Analytics has a great feature called Advanced Segments. Using this feature, you can easily show a subset of data. Sharing advanced segments with other users One of the ways I use advanced segments is to categorise traffic into user types. [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton902" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fdavidsimpson.me%2F2010%2F09%2F24%2Fgoogle-analytics-tip-use-advanced-segments%2F&amp;text=Google%20Analytics%20Tip%3A%20Use%20Advanced%20Segments&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fdavidsimpson.me%2F2010%2F09%2F24%2Fgoogle-analytics-tip-use-advanced-segments%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://davidsimpson.me/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;"></a></div><p>I&#8217;ve said it before, but I&#8217;ll say it again — I like to <a href="http://search.twitter.com/search?q=%23measure">#measure</a>.  Google Analytics has a great feature called <strong>Advanced Segments</strong>.  Using this feature, you can easily show a subset of data.</p>
<h2>Sharing advanced segments with other users</h2>
<p>One of the ways I use advanced segments is to categorise traffic into user types.  It works really well and the great thing is that any advanced segment you create, you can also share with other Google Analytics users.</p>
<p>The links below are examples of some advanced segments I created for the University of Nottingham. If they seem helpful to you, feel free to use them as part of your Google Analytics reporting activity.  To use them, simply login to Google Analytics and then click on the links below.<br />
<span id="more-902"></span></p>
<ul>
<li><a href="http://www.google.com/analytics/reporting/add_segment?share=mtMHRSsBAAA.RD_MY1rbVaEf7ayaUJLvVIp5hygzV3QgZeP33FJ4FCSFmsyt7q3YVKJIj0KrlOC4BelMH7mZCeLsatFDLCqdvQ.ghQRN2pc_woXx0RTCZVa4w">Visits from the University of Nottingham (Campus)</a></li>
<li><a href="http://www.google.com/analytics/reporting/add_segment?share=mtMHRSsBAAA.RD_MY1rbVaEf7ayaUJLvVIp5hygzV3QgZeP33FJ4FCSFmsyt7q3YVKJIj0KrlOC4MkyRaaTu7Gu3UETaeB90bQ.4UgBm1lMAQUTVRygPcAF8Q">Visits not from the University of Nottingham (the opposite of the previous one)</a></li>
<li><a href="http://www.google.com/analytics/reporting/add_segment?share=mtMHRSsBAAA.RD_MY1rbVaEf7ayaUJLvVIp5hygzV3QgZeP33FJ4FCSFmsyt7q3YVKJIj0KrlOC4jejUXMMikBgScIG469WTRw.eZaq07T1VQcygPJBvX7Szg">Visits from the city of Nottingham</a></li>
<li><a href="http://www.google.com/analytics/reporting/add_segment?share=mtMHRSsBAAA.RD_MY1rbVaEf7ayaUJLvVIp5hygzV3QgZeP33FJ4FCSFmsyt7q3YVKJIj0KrlOC4yoPwhj_PvsEh75Lt2x3eJA.U8EOJsZPRy4ThUuSGQ-0vA">Visits from China</a></li>
<li><a href="http://www.google.com/analytics/reporting/add_segment?share=mtMHRSsBAAA.RD_MY1rbVaEf7ayaUJLvVIp5hygzV3QgZeP33FJ4FCSFmsyt7q3YVKJIj0KrlOC4Lj2r8B3KmiI43tVqrktSOw.RePTh7K6Typ3XAiJcsvllg">Visits from Malaysia</a></li>
</ul>
<h2>Tutorial</h2>
<p>Here&#8217;s a nice tutorial video from <a href="http://www.youtube.com/user/GoogleBusiness">GoogleBusiness</a> on how to create and use your own custom advanced segments:</p>
<p><object width="425" height="345"><param name="movie" value="http://www.youtube.com/v/wu8YzF0AM14?fs=1&amp;hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/wu8YzF0AM14?fs=1&amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="345"></embed></object></p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://davidsimpson.me/2010/09/24/google-analytics-tip-use-advanced-segments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Analytics Plugin for Confluence 1.2 released</title>
		<link>http://davidsimpson.me/2010/06/24/analytics-plugin-for-confluence-12-released/</link>
		<comments>http://davidsimpson.me/2010/06/24/analytics-plugin-for-confluence-12-released/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 11:39:35 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[analytics]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[atlassian]]></category>
		<category><![CDATA[confluence]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[web analytics]]></category>
		<category><![CDATA[wiki]]></category>

		<guid isPermaLink="false">http://davidsimpson.me/?p=865</guid>
		<description><![CDATA[Last week I released Analytics Plugin for Confluence 1.2 on the Atlassian Plugin Exchange. It&#8217;s been 6 months since the initial release which was only tested on Confluence 3.0. This time I&#8217;ve added a new dashboard section, full support for Confluence 3.1 &#038; 3.2 and a pile of macro parameters as requested by Guy Fraser. [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton865" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fdavidsimpson.me%2F2010%2F06%2F24%2Fanalytics-plugin-for-confluence-12-released%2F&amp;text=Analytics%20Plugin%20for%20Confluence%201.2%20released&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fdavidsimpson.me%2F2010%2F06%2F24%2Fanalytics-plugin-for-confluence-12-released%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://davidsimpson.me/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;"></a></div><p><img src="/wp-content/uploads/2010/06/analytics-plugin-icon-60pc.png" alt="analytics-plugin-icon-60pc" title="analytics-plugin-icon-60pc" width="153" height="124" class="alignleft size-full wp-image-875" /> Last week I released <a href="https://plugins.atlassian.com/plugin/details/16722">Analytics Plugin for Confluence 1.2</a> on the Atlassian Plugin Exchange.  </p>
<p>It&#8217;s been  6 months since the initial release which was only tested on Confluence 3.0.  This time I&#8217;ve added a new dashboard section, full support for Confluence 3.1 &#038; 3.2 and a pile of macro parameters <a href="/2010/01/02/announcing-google-analytics-plugin-for-confluence/comment-page-1/#comment-487">as requested</a> by Guy Fraser.     The <a href="https://studio.plugins.atlassian.com/wiki/display/CGAP/Analytics+Plugin+1.2+-+Release+Notes">release notes are here</a>.   Confluence 3.3  is just around the corner, so I&#8217;ll add an update for that when it comes out.</p>
<h3>Thank you</h3>
<p>The Confluence community has shown a great deal of support and encouragement since the plugin was originally released.   For example, <a href="http://blogs.atlassian.com/confluence/2009/12/report-confluence-activity-using-google-analytics-in-the-wiki.html">Atlassian blogged about it</a> before I got a chance to.  So thanks to all for your support.  </p>
<p>The plugin was name checked by Sherif Mansour &#8211; Atlassian&#8217;s  Product Manager for Confluence in the <a href="http://www.atlassian.com/summit/2010/presentations/collaboration-and-projects/confluence-state-of-union.jsp">Confluence State of the Union</a> presentation at <a href="http://www.atlassian.com/summit/2010/">Atlassian Summit 2010</a> at the start of the month.  Watch it all, but concentrate especially around 5:10!</p>
<p>This week Google approved the plugin for their <a href="http://www.google.com/analytics/apps/">Google Analytics Application Gallery</a> &mdash;  <a href="http://www.google.com/analytics/apps/about?app_id=229002">take a look here</a>.  The Apps Gallery has only been going for about a month so I&#8217;m really excited about being a part of it.  The slight name change and new logo were done to fit in with the Application Gallery Policy.<br />
<span id="more-865"></span></p>
<h3>In the future</h3>
<p>The next release should support Confluence 3.3  and also complete tracking of all pages in a space  &mdash; not just those with a URL starting /display/spaceKey/  &mdash; based on <a href="/2010/04/09/meta-tags-are-your-friend-part-2-space-specific-tracking-in-confluence-with-google-analytics/">this hack</a> :</p>
<pre class="brush: jscript; title: ;">
// Add a page-level custom variable to record the space-key
if (typeof jQuery('meta[name=confluence-space-key]').attr(&quot;content&quot;) == 'string')
{
  pageTracker._setCustomVar(
    1, // This custom var is set to slot #1 of 5

    // The name acts as a kind of category for the user activity
    'confluence-space-key',    

    // This value of the custom variable
    jQuery('meta[name=confluence-space-key]').attr(&quot;content&quot;), 

    3 // Sets the scope to page-level
  );
}
</pre>
<p>&mdash; If you want to use this hack now, try out <a href="http://www.google.com/analytics/reporting/edit_custom_report?share=gKOvaSkBAAA.5cmZVfTgv7FSDQaf3SApcJ_A8fPPw5P0SVumf1XIBw6dZ9IfubVqvpdV97TN5wj9PYWeLHgMbDxm22PtwyLU0Q.tBCFvr4UE3alVuAccnjeMA">this custom Google Analytics report</a> which will allow you to take advantage of it now.</p>
<p>I&#8217;d also like to add full space specific tracking for attachments too.</p>
<h3>A quick demo</h3>
<p>And finally, this is what the new version looks like:</p>
<p><object height="350" width="425" class="alignleft"><param value="http://www.youtube.com/v/0JgoBwlQT_4&amp;hl=en_US&amp;fs=1&amp;" name="movie"><param value="true" name="allowFullScreen"><param value="always" name="allowscriptaccess"><embed height="350" width="425" allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash" src="http://www.youtube.com/v/0JgoBwlQT_4&amp;hl=en_US&amp;fs=1&amp;"></object> &nbsp;</p>
<h3>Related Posts</h3>
<ul>
<li><a href="/2009/03/18/tracking-atlassian-confluence-usage-with-google-analytics/">Tracking Atlassian Confluence usage with Google Analytics</a></li>
<li><a href="/2009/04/16/4-useful-tips-on-google-analytics-reporting-for-confluence/">4 Useful Tips on Google Analytics Reporting for Confluence</a></li>
<li><a href="/2010/01/02/announcing-google-analytics-plugin-for-confluence/">Announcing: Google Analytics plugin for Confluence</a> &#8211; original release</li>
</ul>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://davidsimpson.me/2010/06/24/analytics-plugin-for-confluence-12-released/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Some thoughts on developing my first Confluence plugin</title>
		<link>http://davidsimpson.me/2010/01/25/some-thoughts-on-developing-my-first-confluence-plugin/</link>
		<comments>http://davidsimpson.me/2010/01/25/some-thoughts-on-developing-my-first-confluence-plugin/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 12:42:04 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Uncategorised]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[analytics]]></category>
		<category><![CDATA[atlassian]]></category>
		<category><![CDATA[confluence]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[wiki]]></category>

		<guid isPermaLink="false">http://davidsimpson.me/?p=503</guid>
		<description><![CDATA[I recently started building Confluence plugins. The first one being my Google Analytics plugin for Confluence. This post outlines my &#8220;journey&#8221; into Confluence plugin development. It documents a beginner&#8217;s pitfalls when developing with the Atlassian Plugin SDK. Hopefully others can learn from, or at least laugh at my mistakes. Where I was starting from: No [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton503" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fdavidsimpson.me%2F2010%2F01%2F25%2Fsome-thoughts-on-developing-my-first-confluence-plugin%2F&amp;text=Some%20thoughts%20on%20developing%20my%20first%20Confluence%20plugin&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fdavidsimpson.me%2F2010%2F01%2F25%2Fsome-thoughts-on-developing-my-first-confluence-plugin%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://davidsimpson.me/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;"></a></div><p><img class="alignnone" title="ga-idea" src="/wp-content/uploads/2010/01/ga-idea2.png" alt="ga-idea" /></p>
<p><!-- Some thoughts on developing my first Confluence plugin  or A bluffer's guide to developing Confluence plugins --></p>
<p>I recently started building Confluence plugins.  The first one being my <a href="/2010/01/02/announcing-google-analytics-plugin-for-confluence/">Google Analytics plugin for Confluence</a>. This post outlines my &#8220;journey&#8221; into Confluence plugin development.  It documents a beginner&#8217;s pitfalls when developing with the Atlassian Plugin SDK. Hopefully others can learn from, or at least laugh at my mistakes.</p>
<p>Where I was starting from:</p>
<ul>
<li>No experience of <a href="http://maven.apache.org/">maven</a></li>
<li>No understanding of how Confluence plugins work or how they are written</li>
<li>Some experience of Java &#8211; Mainly <a href="http://www.jasig.org/uportal">uPortal</a>/<a href="http://www.sungardhe.com/products/luminis-platform">Luminis</a> portal development for the <a href="http://my.nottingham.ac.uk/">University of Nottingham</a> and some consultancy work e.g. for Astra Zeneca, Documentum and 3Com</li>
<li>No experience of unit testing or integration testing in Java &#8211; oh dear</li>
<li>I prefer UI work to real programming</li>
</ul>
<p><span id="more-503"></span></p>
<h2>Initial failure</h2>
<p>I tried to setup a development environment for plugin development using Atlassian&#8217;s <a href="http://confluence.atlassian.com/display/DEVNET/How+to+Build+an+Atlassian+Plugin">documentation</a> a little before the beta release of version 3 of the Atlassian Plugin SDK.  It was a pain. This was no fault of the documentation — it was really just to do with my schedules and available time to experiment.</p>
<p>The problem was two-fold:</p>
<ol>
<li>I&#8217;d not done this before, so was clueless to what was involved</li>
<li>The setup was a complete ball-ache considering the time restraints</li>
</ol>
<p>I was well aware of point 1 and the pain it was likely to cause.  Point 2 seemed to be the old chestnut &#8211; install and configure the exact correct versions of the software you need in the correct sequence, then start.</p>
<p>Wait.  I don&#8217;t know what that means, see point 1. Yes, I&#8217;ve got maven installed on my MacBook! Woo! Let&#8217;s go.  Hang on, it&#8217;s not the correct version. Where do I get that from?</p>
<p>In many ways, it reminded me of my initial experience of building and installing Apache 1.x on Solaris SPARC boxes back in the day:</p>
<blockquote><p>cd /path/to/apache/source; make; make install;<br />
Oh. Wrong version of make. Where do I get that from?  Hmmm.<br />
Install correct version of make. Damn, make needs the correct version of gcc. Where do I get that from?<br />
And so on. Moving further and further away from the problem you&#8217;re trying to solve.</p></blockquote>
<p>So, I stopped there.  No shiny Confluence plugins for me.  I&#8217;ve got plenty of other things to do anyway thank you very much.</p>
<h2>Reboot</h2>
<p>Then Atlassian released the Plugin SDK beta and all this nastiness was removed.  Everything you need to build an Atlassian plugin was bundled in one place.  Refreshing. All commands have been wrapped and so are prefixed with <code>atlas-</code> to prevent conflict with whatever else you&#8217;ve got installed.</p>
<p>For the impatient, this really drives down the barriers to entry for plugin development.</p>
<p>Following the documentation for <a href="http://confluence.atlassian.com/display/DEVNET/Setting+up+your+Plugin+Development+Environment">installing the Plugin SDK</a> was a piece of cake.  It just worked.</p>
<ul>
<li>Download</li>
<li>Unzip</li>
<li>Add some environment settings. Edit <code>~/.profile</code> and add:
<pre class="brush: bash; title: ;">
PATH=$PATH:.
PATH=$PATH:$HOME/
PATH=$PATH:$HOME/bin
PATH=$PATH:$HOME/atlassian-plugin-sdk/atlassian-plugin-sdk-3.0-beta3
PATH=$PATH:$HOME/atlassian-plugin-sdk/atlassian-plugin-sdk-3.0-beta3/bin
export PATH
</pre>
</li>
<li>Start building a plugin</li>
</ul>
<p>Starting out to build your Atlassian plugin is <a href="http://confluence.atlassian.com/display/DEVNET/Developing+your+Plugin+using+the+Atlassian+Plugin+SDK">documented here</a>. It&#8217;s a fairly straightforward set of instructions.</p>
<p>You start by doing something like this:</p>
<pre class="brush: bash; title: ;">
mkdir ~/projects/davidsimpson.me/
mkdir ~/projects/davidsimpson.me/confluence
cd  ~/projects/davidsimpson.me/confluence

atlas-create-confluence-plugin
...
...
...
When prompted
Define value for groupId: : me.davdsimpson.confluence.plugins
Define value for artifactId: : googleanalytics
Define value for version:  1.0-SNAPSHOT: :
Define value for package:  me.davdsimpson.confluence.plugins: :
Confirm properties configuration:
groupId: me.davdsimpson.confluence.plugins
artifactId: googleanalytics
version: 1.0-SNAPSHOT
package: me.davdsimpson.confluence.plugins
</pre>
<p>Then type&#8230;</p>
<pre class="brush: bash; title: ;">cd googleanalytics
atlas-run</pre>
<p>&#8230;and sit back.  If maven doesn&#8217;t fall over for lack of memory at this point, you&#8217;re laughing.  Go away, have a beer or two.  This may take some time.</p>
<p><img class="aligncenter size-medium wp-image-525" title="Beer" src="/wp-content/uploads/2010/01/iStock_000009660877XSmall.jpg" alt="Beer" width="440" height="175" /></p>
<p>On your return, maven will hopefully have finished dragging all manner of nonsense from Australia and installed a working copy of Confluence, together with an empty plugin onto your computer. Nice.  Next, write some code.</p>
<p><strong>I like to run before I can walk.</strong> It seems like much more fun to attempt something that&#8217;s harder.  You do fall over a lot more often though.  So rather than some kind of silly little hello world or equivalent plugin, my first plugin was an integration of Google Analytics with Confluence using the Google Analytics API to fetch data from Google.  It requires some additional JARs from Google.</p>
<p>Google doesn&#8217;t have a public maven repository to my knowledge and I&#8217;d no idea how to get these JARs added into maven.  Luckily, people had already written about <a href="http://www.techbits.de/2009/08/06/adding-googles-gdata-java-api-to-your-maven-repository/">parts</a> of <a href="http://blog.stuartlewis.com/2009/05/29/surfacing-google-analytics-stats-in-dspace/">this</a>, so I put 2 and 2 together.</p>
<p><strong>Add Google Analytics JARs to maven:</strong></p>
<pre class="brush: bash; title: ;">
atlas-mvn install:install-file -DgroupId=com.google.gdata
    -DartifactId=gdata-core
    -Dversion=1.0
    -Dpackaging=jar
    -Dfile=/path/to/gdata-core-1.0.jar
    -DgeneratePom=true

atlas-mvn install:install-file -DgroupId=com.google.gdata
    -DartifactId=gdata-analytics
    -Dversion=2.0
    -Dpackaging=jar
    -Dfile=/path/to/gdata-analytics-2.0.jar
    -DgeneratePom=true

atlas-mvn install:install-file -DgroupId=com.google.collect
    -DartifactId=google-collect
    -Dversion=1.0
    -Dpackaging=jar
    -Dfile=/path/to/google-collect-1.0-rc3.jar
</pre>
<p><strong>Edit the Project Object Model (POM) to add the dependencies</strong></p>
<p>Edit the pom:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">vi</span> ~<span style="color: #000000; font-weight: bold;">/</span>projects<span style="color: #000000; font-weight: bold;">/</span>davidsimpson.me<span style="color: #000000; font-weight: bold;">/</span>confluence<span style="color: #000000; font-weight: bold;">/</span>googleanalytics<span style="color: #000000; font-weight: bold;">/</span>pom.xml</pre></div></div>

<p>Add this bit to the end of the dependencies node:</p>
<pre class="brush: xml; title: ;">
&lt;!-- Add Google Analytics dependencies: --&gt;

       com.google.gdata
       gdata-core
       1.0

       com.google.gdata
       gdata-analytics
       2.0

	com.google.collect
	google-collect
	1.0
</pre>
<p><strong>Next, fire up your IDE</strong></p>
<p>My chosen IDE is <a href="http://www.jetbrains.com/idea/">IntelliJ IDEA</a>.</p>
<ul>
<li>Open the pom.xml in IntelliJ IDEA (File | Open project)</li>
<li>Override/set the maven home directory:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>davidsimpson<span style="color: #000000; font-weight: bold;">/</span>atlassian-plugin-sdk-<span style="color: #000000;">3.0</span>-beta3<span style="color: #000000; font-weight: bold;">/</span>apache-maven</pre></div></div>

</li>
<li>Set the JDK for build as 1.5 or 1.6</li>
<li>Start editing the plugin</li>
</ul>
<h2>Hiccups</h2>
<p>It&#8217;s not all straightforward.  Here&#8217;s some of the annoyances that I came across.</p>
<h3>Maven needs more memory</h3>
<p>I needed more memory for maven.  Not really a problem &#8211; append to <code>~/.profile</code>:</p>
<pre class="brush: bash; title: ;">
MAVEN_OPTS=-Xmx512m
export MAVEN_OPTS
</pre>
<h3>Annoying warnings on <code>atlas-run</code></h3>
<p>I noticed this on running <code>atlas-run</code> &#8211; it probably shouldn&#8217;t be there:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>WARNING<span style="color: #7a0874; font-weight: bold;">&#93;</span> Using platform encoding <span style="color: #7a0874; font-weight: bold;">&#40;</span>MacRoman actually<span style="color: #7a0874; font-weight: bold;">&#41;</span> to copy filtered resources, i.e. build is platform dependent<span style="color: #000000; font-weight: bold;">!</span></pre></div></div>

<p>Of course, someone has already blogged about it — <a href="http://www.redleopard.com/2009/04/macroman-encoding-creeps-into-maven/">Red Leopard</a> — and it&#8217;s easily fixed by editing the POM to add the correct encoding.</p>
<pre class="brush: xml; title: ;">
3.0.2
    3.0

    &lt;!-- Fix for MacRoman warnings on build --&gt;
    UTF-8
    UTF-8
</pre>
<p>Now, we have no nasty warnings.</p>
<h3>The macro browser icon</h3>
<p>I love the Macro Browser in Confluence.  It&#8217;s a nice step forward in the evolution of the UI.  So as a result, I wanted my macro to have a  shiny icon in the macro browser.   That damn Macro Browser icon ate up several hours of my life.  Looking at the comments on the <a href="http://confluence.atlassian.com/display/CONFDEV/Updating+macros+for+the+Macro+Browser">documentation</a> page, several other people have had a whole load of fun getting their pretty icon to show up too.</p>
<div id="attachment_521" class="wp-caption alignnone" style="width: 450px"><a href="http://localhost/davidsimpson.me/wp-content/uploads/2010/01/macro-browser1.png" rel="lightbox[503]" title="macro-browser"><img class="size-medium wp-image-521" title="macro-browser" src="http://davidsimpson.me/wp-content/uploads/2010/01/macro-browser1.png" alt="The macro browser icon: What we're aiming for"  /></a><p class="wp-caption-text">The macro browser icon: What we</p></div>
<p>Could I get the Macro Browser to show my plugin&#8217;s icon. No.  I followed the <a href="http://confluence.atlassian.com/display/CONFDEV/Updating+macros+for+the+Macro+Browser">documentation</a>.  It did not work.  I looked again. This time I <em>really</em> paid attention.  Was it my fat fingers?  Was I just being stupid? (Probably.)  I ignored this for a while — maybe it would be better after a night&#8217;s sleep.</p>
<p>Everything <a href="http://twitter.com/dvdsmpsn/status/5796289204">seemed to work a whole lot better</a> when I dropped the beta and moved to version 3.0.2 of the Plugin SDK.<br />
<strong>Note:</strong> I had to update my <code>~/.profile</code> to point to the new version of the SDK and update the references to maven in Intelli-J at this point.</p>
<p>I also followed a different tack on getting the macro browser icon to work</p>
<ul>
<li>Find a macro that has a custom icon in the macro browser</li>
<li>Go to the Atlassian public subversion repository and browse to the source for that macro plugin.</li>
<li>Copy the exact syntax from the <code>atlassian-plugin.xml</code> and paste into your macro&#8217;s own <code>atlassian-plugin.xml</code></li>
<li>Name the icon exactly the same as in the <code>atlassian-plugin.xml</code> and put it in the correct place in the directory structure</li>
</ul>
<p>I&#8217;m not entirely sure whether it was the copy and paste approach that helped or moving away from the beta.  It works now, so I&#8217;m not going to loose sleep on why.</p>
<h3>Adding a configuring UI to the plugin</h3>
<p>My plugin needed to store Google account credentials and display a list of Google Analytics sites, so you can choose the correct profile.   How do you do that?  Hmmm. Go back to the <a href="http://confluence.atlassian.com/display/CONFDEV/Adding+a+Configuration+UI+for+your+Plugin">documentation</a>.  It wasn&#8217;t nearly detailed enough for my liking, so time to vent a <a href="http://twitter.com/dvdsmpsn/status/5719013792">little</a>.</p>
<p>Again, it seemed the best way to learn was to find a plugin that has a similar kind of configuration to that you&#8217;re hoping for and start appropriating the code.</p>
<h3>Unit testing and integration testing</h3>
<p>This is a good idea. Period. Did I have a clue how to do it for Confluence?  Of course not.</p>
<p>Again, the community helped out.  Atlassian partners at Adaptavist, Comala Technology and Customware have written about this:</p>
<ul>
<li><a href="http://www.customware.net/repository/display/GREENHOUSE/2009/03/18/Integration+Testing+of+Confluence+Plugins">Integration Testing of Confluence Plugins</a> by Bo Wang</li>
<li><a href="http://www.adaptavist.com/display/~erobertshaw/2009/08/17/Unit+testing+a+Confluence+Action">Unit testing a Confluence Action</a> by Edward Robertshaw</li>
<li><a href="http://www.adaptavist.com/display/~erobertshaw/Unit+testing+a+Confluence+Macro">Unit testing a Confluence Macro</a> by Edward Robertshaw</li>
<li><a href="http://www.mundoreves.com/display/HOME/2009/01/29/Confluence+plugin+integration+testing"> Confluence plugin integration testing </a> by Roberto Dominguez</li>
</ul>
<p>Browsing around the Atlassian public subversion repository was also a help.  I&#8217;ve got to say that I&#8217;m an easy convert to testing.  It just makes sense.</p>
<p><strong>Update (2010-05-04):</strong> A nice feature of the SDK is running or testing your plugin against different versions of the product.  This is straightforward:</p>
<pre class="brush: bash; title: ;">
# Integration tests for different versions
atlas-integration-test -v 3.0
atlas-integration-test -v 3.1
atlas-integration-test -v 3.2
# Run different versions of Confluence
atlas-run -v 3.0
atlas-run -v 3.1
atlas-run -v 3.2
</pre>
<h2>Wrapping up</h2>
<p>After a good deal of stumbling around, it turns out that I can write a Confluence plugin after all.  Everything started working a lot better after I updated from the beta version, but that could just be coincidence.  The documentation <em>could</em> be a little better to help the uninitiated  but it was equally my fault for not learning to walk first.  There is a lot of good information, but it is spread over a few different spaces.</p>
<p>My next step was to get the plugin added to Atlassian <a href="https://plugins.atlassian.com/plugin/home">Plugin Exchange</a>.  It took a little while to get this done — maybe that&#8217;s best saved for a follow up post.  The plugin is now <a href="https://plugins.atlassian.com/plugin/details/16722">available</a> on Atlassian Plugin Exchange.  I hope other people get some use out of it.</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://davidsimpson.me/2010/01/25/some-thoughts-on-developing-my-first-confluence-plugin/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Announcing: Google Analytics plugin for Confluence</title>
		<link>http://davidsimpson.me/2010/01/02/announcing-google-analytics-plugin-for-confluence/</link>
		<comments>http://davidsimpson.me/2010/01/02/announcing-google-analytics-plugin-for-confluence/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 17:06:36 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[analytics]]></category>
		<category><![CDATA[atlassian]]></category>
		<category><![CDATA[confluence]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://davidsimpson.me/?p=457</guid>
		<description><![CDATA[I&#8217;m pleased to announce the release of my first Confluence plugin &#8212; Google Analytics plugin for Confluence. It lists Google Analytics reports for a particular Confluence space &#8211; from within that space. The current version has 10 reports and shows the first 20 results for each report. Top Content Depth of Visit Internal Search Browser [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton457" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fdavidsimpson.me%2F2010%2F01%2F02%2Fannouncing-google-analytics-plugin-for-confluence%2F&amp;text=Announcing%3A%20Google%20Analytics%20plugin%20for%20Confluence&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fdavidsimpson.me%2F2010%2F01%2F02%2Fannouncing-google-analytics-plugin-for-confluence%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://davidsimpson.me/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;"></a></div><p><img src="/wp-content/uploads/2010/02/ga-icon.png" alt="Google Analytics" title="Google Analytics" width="170" height="139" class="alignleft size-full wp-image-618" /></p>
<p>I&#8217;m pleased to announce the release of my first Confluence plugin &mdash; <a href="https://plugins.atlassian.com/plugin/details/16722">Google Analytics plugin for Confluence</a>. </p>
<p>It lists Google Analytics reports for a particular Confluence space &#8211; from within that space.  The current version has 10 reports and shows the first 20 results for each report.</p>
<ul>
<li>Top Content</li>
<li>Depth of Visit</li>
<li>Internal Search</li>
<li>Browser and OS</li>
<li>Browser Version</li>
<li>Screen Resolution</li>
<li>Network</li>
<li>City</li>
<li>All Traffic Sources</li>
<li>Search Engine Keywords</li>
</ul>
<p><span id="more-457"></span></p>
<p>Just before Christmas, Atlassian quietly approved the plugin on their <a href="http://plugins.atlassian.com">Plugin Exchange</a> website.  Since then, <a href="http://twitter.com/mattnhodges">Matt Hodges</a> posted a great write up about it on the Atlassian website &mdash; <a href="http://blogs.atlassian.com/confluence/2009/12/report-confluence-activity-using-google-analytics-in-the-wiki.html">Report Confluence Activity Using Google Analytics in the Wiki</a>.</p>
<h3>Screencasts and live demonstrations</h3>
<p>I&#8217;ve done a couple of screencast demos on usage and configuration:</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/zbKElYFCWyk&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/zbKElYFCWyk&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/3jnWSWwRWH0&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/3jnWSWwRWH0&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>But better than that, it&#8217;s now out in the wild and you can try it for yourself on other people&#8217;s sites:</p>
<ul>
<li>Atlassian have installed it on their <a href="http://sandbox.onconfluence.com/display/SBOX/Google+Analytics">Confluence Sandbox</a></li>
<li><a href="http://twitter.com/schirmacher">Arne Schirmacher</a> has posted a <a href="http://www.schirmacher.de/display/INFO/Google+Analytics">live demo</a> on his Confluence site</li>
<li><a href="http://workspace.nottingham.ac.uk/display/~cczdas/Google+Analytics+reports">Another live demo</a> on my personal Confluence space (using 1.2-SNAPSHOT)</li>
</ul>
<h3>What next?</h3>
<ul>
<li><a href="https://plugins.atlassian.com/server/1.0/download/pluginVersion/16723">Download Google Analytics plugin for Confluence</a></li>
<li><a href="http://davidsimpson.me/2009/03/18/tracking-atlassian-confluence-usage-with-google-analytics/">Setup Google Analytics on your Confluence site</a></li>
</ul>
<p>If you&#8217;re using this plugin or have tried it out, I&#8217;d really like to know what you think of it.</p>
<ul>
<li>What improvements would you like made?</li>
<li>What reports are missing?</li>
<li>Where could the UI could be improved?</li>
</ul>
<p>Please post a comment if you&#8217;ve got it installed.</p>
<h3>Thanks</h3>
<p>I&#8217;d like to thank the Confluence community for their help mainly via <a href="http://forums.atlassian.com/">Atlassian Forums</a> and some Atlassians for helping me out when I got stuck &#8211; particularly <a href="http://twitter.com/sdh100shaun">Shaun Hare</a>, <a href="http://twitter.com/keibro">Keith Brophy</a>,  <a href="http://blogs.atlassian.com/news/jnolen/">Jonathan Nolen</a> and  <a href="http://forums.atlassian.com/profile.jspa?userID=2157">David Peterson</a>.</p>
<p>Image credit: <a href="http://www.iconspedia.com/icon/google-analytics--737.html">Google Analytics icon</a></p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://davidsimpson.me/2010/01/02/announcing-google-analytics-plugin-for-confluence/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>4 Useful Tips on Google Analytics Reporting for Confluence</title>
		<link>http://davidsimpson.me/2009/04/16/4-useful-tips-on-google-analytics-reporting-for-confluence/</link>
		<comments>http://davidsimpson.me/2009/04/16/4-useful-tips-on-google-analytics-reporting-for-confluence/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 21:29:38 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[analytics]]></category>
		<category><![CDATA[atlassian]]></category>
		<category><![CDATA[confluence]]></category>
		<category><![CDATA[google analytics]]></category>

		<guid isPermaLink="false">http://davidsimpson.me/?p=283</guid>
		<description><![CDATA[Having installed Google Analytics on Confluence, you need to ensure that you&#8217;re not lost in a world of pretty metrics. Make sure that your new analytics toy produces something solid and actionable. Anything less is just a shiny curiosity that your organisation will soon fail to engage with. This article presents 4 useful tips that [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton283" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fdavidsimpson.me%2F2009%2F04%2F16%2F4-useful-tips-on-google-analytics-reporting-for-confluence%2F&amp;text=4%20Useful%20Tips%20on%20Google%20Analytics%20Reporting%20for%20Confluence&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fdavidsimpson.me%2F2009%2F04%2F16%2F4-useful-tips-on-google-analytics-reporting-for-confluence%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://davidsimpson.me/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;"></a></div><p><!-- 4 useful tips on Google Analytics reporting for Confluence --></p>
<p>Having <a href="/2009/03/18/tracking-atlassian-confluence-usage-with-google-analytics/">installed Google Analytics on Confluence</a>, you need to ensure that you&#8217;re not lost in a world of pretty metrics.  </p>
<p>Make sure that your new analytics toy produces something solid and actionable.  Anything less is just a shiny curiosity that your organisation will soon fail to engage with.</p>
<p>This article presents 4 useful tips that really show the power of the analytics data available.  Each one can help improve the success of your Confluence installation.<br />
<span id="more-283"></span></p>
<h2>1. Use the Content Drilldown report to segment traffic by site</h2>
<p>Want to know which sites are generating the most traffic?  The Content Drilldown report is for you.  This allows you to view page reads by Site.</p>
<p>The gallery below shows you how to access the correct report &#8211; In Google Analytics (GA), click on the highlighted links to get to the next page.</p>
<p><!--***--><a href="/wp-content/uploads/2009/04/content-drilldown-all.png" rel="lightbox[283]" title="Content Drilldown - All"><img src="http://davidsimpson.me/wp-content/uploads/2009/04/content-drilldown-all-150x150.png" alt="Content Drilldown - Select &quot;display&quot;" title="Content Drilldown - All" width="150" height="150" class="size-thumbnail wp-image-291" /></a></p>
<p><!--***--><a href="/wp-content/uploads/2009/04/content-drilldown-sites.png" rel="lightbox[283]" title="Content Drilldown - Sites"><img src="http://davidsimpson.me/wp-content/uploads/2009/04/content-drilldown-sites-150x150.png" alt="Content Drilldown - Select &quot;DOC&quot;" title="Content Drilldown - Sites" width="150" height="150" class="size-thumbnail wp-image-292" /></a></p>
<p><!--***--><div id="attachment_293" class="wp-caption alignnone" style="width: 160px"><a href="/wp-content/uploads/2009/04/content-drilldown-sites-doc.png" rel="lightbox[283]" title="Content Drilldown - DOC"><img src="http://davidsimpson.me/wp-content/uploads/2009/04/content-drilldown-sites-doc-150x150.png" alt="Content Drilldown - Shows pages within the DOC site" title="Content Drilldown - DOC" width="150" height="150" class="size-thumbnail wp-image-293" /></a><p class="wp-caption-text">Content Drilldown - Shows pages within the DOC site</p></div></p>
<h3>Missing Page Views</h3>
<p>The Content Drilldown report  does <em>not</em> however show everything that happens within the site, but rather only pages that are descendent of <strong>/display/DOC/</strong></p>
<h4>Examples of missing pages</h4>
<ul>
<li>
		<strong>Pages with punctuation marks in the title.</strong><br />
		A page with a title of <em>What&#8217;s this?</em> would have a URI similar to <strong>/pages/viewpage.action?pageId=26181760</strong><br />
		<em>As a workaround, only use alphanumerics and spaces in page titles.</em>
	</li>
<li>
		<strong>Page edits.</strong><br />
		A page edit would have a URI similar to <strong>/pages/editpage.action?pageId=26181733</strong>
	</li>
<li>
		<strong>Attachment views.</strong><br />
		These do not call the Google Analytics JavaScript, so are not caught by the tracking code
	</li>
</ul>
<p>The first 2 of these are tracked, but not on a site by site basis within the Content Drilldown, so they are a little more difficult to understand.</p>
<p>Each of these <em>could</em> be tracked within the Content Drilldown by using a little jQuery magic to rewrite the URL before it is sent to Google Analytics.</p>
<p>I&#8217;ve not done this yet, but it should be fairly simple to change the reported URLs to e.g.</p>
<ul>
<li>/display/DOC/What&#8217;s This?</li>
<li>/display/DOC/Test+Page/Edit Page</li>
<li>/display/DOC/Test+Page/attachment/screenshot.png</li>
</ul>
<h2>2. Enable Site Search  &#038; Search Categories in GA</h2>
<p>Google Analytics will allow you to categorize site searches. With this option enabled, you can see searches within individual sites.</p>
<p>In GA, go to <strong>Analytics Settings > Profile Settings > Edit Profile Information</strong></p>
<p>* Select <strong>Do Track Site Search</strong><br />
* Add <strong>queryString,searchQuery.queryString</strong> to <strong>Query Parameter (required):</strong><br />
* Select <strong>Yes</strong> from <strong>Do you use categories for site search?</strong><br />
* Add <strong>key,searchQuery.spaceKey,where</strong> to <strong>Category Parameter:</strong></p>
<p><!--***--><div id="attachment_306" class="wp-caption alignnone" style="width: 160px"><a href="/wp-content/uploads/2009/04/settings-site-search.png" rel="lightbox[283]" title="settings-site-search"><img src="http://davidsimpson.me/wp-content/uploads/2009/04/settings-site-search-150x150.png" alt="Settings - Site Search" title="settings-site-search" width="150" height="150" class="size-thumbnail wp-image-306" /></a><p class="wp-caption-text">A screenshot of the Site Search Setting section</p></div></p>
<h3>Example &#8211; Searching for &#8220;David Simpson&#8221; on Atlassian&#8217;s own installation of Confluence </h3>
<p>The table below shows the various different situations and query parameters that I&#8217;ve used to Categorize the Site Search:</p>
<div class="overflowAuto">
<table>
<tr>
<th>Description/Link</th>
<th>Example query parameter pairs (Category Parameter in bold)</th>
<th class="comments">Comments</th>
</tr>
<tr>
<td class="nowrap"><a href="http://confluence.atlassian.com/dosearchsite.action?queryString=David+Simpson">Search the whole site</a></td>
<td>queryString=David+Simpson</td>
<td class="nowrap">These are the (not set) results within Google Analytics</td>
</tr>
<tr>
<td class="nowrap"><a href="http://confluence.atlassian.com/dosearchsite.action?key=DOC&#038;searchQuery.queryString=David+Simpson&#038;searchQuery.spaceKey=DOC">Search within a space (1)</a></td>
<td>
			<b>key=DOC</b><br />
			searchQuery.queryString=David+Simpson<br />
			<b>searchQuery.spaceKey=DOC</b>
		</td>
<td>The standard query parameter structure created by the {search-box} macro</td>
</tr>
<tr>
<td class="nowrap"><a href="http://confluence.atlassian.com/dosearchsite.action?queryString=ancestorIds%3A135922+AND+David+Simpson&#038;where=DOC&#038;type=&#038;lastModified=&#038;contributor=&#038;contributorUsername=">Search within a space (2)</a></td>
<td>
			queryString=ancestorIds%3A135922+AND+David+Simpson<br />
			<b>where=DOC</b><br />
			type=<br />
			lastModified=<br />
			contributor=<br />
			contributorUsername=
		</td>
<td>The query parameters created when a {pagetree} macro contains a search box (I think)</td>
</tr>
<tr>
<td><a href="http://confluence.atlassian.com/dosearchsite.action?queryString=David+Simpson&#038;where=DOC&#038;type=&#038;lastModified=&#038;contributor=&#038;contributorUsername=">Filter a previous search</a></td>
<td>
			queryString=David+Simpson<br />
			<b>where=DOC</b><br />
			type=<br />
			lastModified=<br />
			contributor=<br />
			contributorUsername=
		</td>
<td>This is when you perform further searches within the Search Results page</td>
</tr>
</table>
</div>
<h2>3. Use &#8220;Site Search Categories&#8221; to show search terms from within individual sites</h2>
<p>With site specific search information you can see </p>
<ul>
<li>What people are looking for </li>
<li>Whether they&#8217;ve found it</li>
</ul>
<p>Some screenshots of how to view the Site Specific search terms:</p>
<p><!--***--><div id="attachment_290" class="wp-caption alignnone" style="width: 160px"><a href="/wp-content/uploads/2009/04/site-search-categories.png" rel="lightbox[283]" title="site-search-categories"><img src="/wp-content/uploads/2009/04/site-search-categories-150x150.png" alt="Site Search - List of categories" title="site-search-categories" width="150" height="150" class="size-thumbnail wp-image-290" /></a><p class="wp-caption-text">Site Search - List of categories</p></div></p>
<p><!--***--><div id="attachment_289" class="wp-caption alignnone" style="width: 160px"><a href="/wp-content/uploads/2009/04/site-search-categories-doc.png" rel="lightbox[283]" title="site-search-categories-doc"><img src="/wp-content/uploads/2009/04/site-search-categories-doc-150x150.png" alt="Site Search Results - DOC category only" title="site-search-categories-doc" width="150" height="150" class="size-thumbnail wp-image-289" /></a><p class="wp-caption-text">Site Search Results - DOC category only</p></div></p>
<p>This is powerful.  If they&#8217;re searching and finding stuff &#8211; great!</p>
<p>If they&#8217;re failing to find the content they desire, then there&#8217;s a real problem that needs fixing.   <strong>The top search terms that return no result should be tackled.</strong></p>
<p>With a little consideration, the user experience can be improved considerably, saving the organisation time and money. </p>
<h3>Ask yourself a few questions:</h3>
<ul>
<li>Why are my visitors searching for <em>search-term-x</em>?</li>
<li>
		Is this search term relevent to my site?</p>
<ul>
<li>If so, add the content you the site.</li>
</ul>
</li>
<li>
		Is the search term related to different terminology that I&#8217;m using?</p>
<ul>
<li>If so, include the various terminologies in pages, so that people with different language styles can find the content</li>
</ul>
</li>
<li>
		Should the top result be easier to find?</p>
<ul>
<li>Consider moving the top search term to be visible on the site home page or higher up in the site hierarchy</li>
</ul>
</li>
</ul>
<h2>4. Use the &#8220;Site Search Start Pages&#8221; report to find out where visitors turn to search</h2>
<p>This report exposes the page a visitor is on when they abandon the navigation system in the site and jump to the search box.  This could give some insight into what&#8217;s missing in your navigation system. </p>
<p><!--***--><div id="attachment_307" class="wp-caption alignnone" style="width: 160px"><a href="/wp-content/uploads/2009/04/site-search-start-pages.png" rel="lightbox[283]" title="site-search-start-pages"><img src="/wp-content/uploads/2009/04/site-search-start-pages-150x150.png" alt="Site Search Start Pages Report" title="site-search-start-pages" width="150" height="150" class="size-thumbnail wp-image-307" /></a><p class="wp-caption-text">Site Search Start Pages Report</p></div></p>
<p>To view the search start pages on a site by site basis, filter this report by using the URI of each site.</p>
<p><!--***--><div id="attachment_308" class="wp-caption alignnone" style="width: 371px"><a href="/wp-content/uploads/2009/04/filter-by-site.png" rel="lightbox[283]" title="filter-by-site"><img src="/wp-content/uploads/2009/04/filter-by-site.png" alt="Filter by site URI" title="filter-by-site" width="361" height="28" class="size-full wp-image-308" /></a><p class="wp-caption-text">Filter by site URI</p></div></p>
<h3>Ask some more questions&#8230;</h3>
<ul>
<li>
		Are my visitors browsing or just searching?</p>
<ul>
<li>When I&#8217;m on the eBay homepage, I generally just start searching and ignore all the content on the page.  Are your visits doing this?</li>
</ul>
</li>
<li>
		Do visitors search from particular pages?</p>
<ul>
<li>If so, what are the search terms? Should these be included on, or linked to from these pages?</li>
</ul>
</li>
</ul>
<h2>To Conclude</h2>
<p>Using just these 4 simple tips highlights the combined power of Google Analytics and the internal search engine within Confluence.   Answering some of the questions posed should provide the insight you need to improve the usability for all your visitors.    </p>
<p>These tips are really only the a small part of what analytics has to offer.   I&#8217;d encourage you to learn more  and let me know how you get on.</p>
<h3>Further reading/viewing</h3>
<ul>
<li><a href="http://www.google.com/support/conversionuniversity/?hl=en">Google Analytics Conversion University</a></li>
<li><a href="http://www.youtube.com/watch?v=m4RaGKwvMbY&#038;feature=related">Internal Site Search Analysis and Visitor Intent</a> &#8211; video by Avinash Kaushik (<a href="http://twitter.com/avinashkaushik">@avinashkaushik</a>)</li>
<li><a href="http://www.rosenfeldmedia.com/books/searchanalytics/">Search Analytics</a> book by Louis Rosenfeld (<a href="http://twitter.com/louisrosenfeld">@louisrosenfeld</a>) and Marko Hurst</li>
<li><a href="http://semphonic.blogs.com/semangel/2007/04/web_analytics_t.html">Web Analytics ToolKit and Internal Search</a></li>
<li><a href="http://www.kaushik.net/avinash/2007/10/kick-butt-with-internal-site-search-analytics.html">Kick Butt With Internal Site Search Analytics</a> &#8211; Avinash Kaushik</li>
</ul>
<p><strong>Please note:</strong> We&#8217;ve not had GA tracking Confluence for very long, so there are some empty results for the start of the month.<br />
I&#8217;ve used <a href="http://getfirebug.com/">Firebug</a> to pretend we&#8217;re looking at the analytics reports for <a href="http://confluence.atlassian.com/">Atlassian&#8217;s own installation of Confluence</a></p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://davidsimpson.me/2009/04/16/4-useful-tips-on-google-analytics-reporting-for-confluence/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Tracking Atlassian Confluence usage with Google Analytics</title>
		<link>http://davidsimpson.me/2009/03/18/tracking-atlassian-confluence-usage-with-google-analytics/</link>
		<comments>http://davidsimpson.me/2009/03/18/tracking-atlassian-confluence-usage-with-google-analytics/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 17:45:56 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[analytics]]></category>
		<category><![CDATA[Uncategorised]]></category>
		<category><![CDATA[atlassian]]></category>
		<category><![CDATA[confluence]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[wiki]]></category>

		<guid isPermaLink="false">http://davidsimpson.me/?p=177</guid>
		<description><![CDATA[Updated 2011-06-30: Changed to asynchronous Google Analytics tracking You&#8217;ve chosen Confluence as your Enterprise wiki and got it installed. People are using it. But how many people? You could have a look at the Global Activity page on Confluence, but this might confuse matters. You&#8217;ll get to see graphs, but what do they really mean? [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton177" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fdavidsimpson.me%2F2009%2F03%2F18%2Ftracking-atlassian-confluence-usage-with-google-analytics%2F&amp;text=Tracking%20Atlassian%20Confluence%20usage%20with%20Google%20Analytics&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fdavidsimpson.me%2F2009%2F03%2F18%2Ftracking-atlassian-confluence-usage-with-google-analytics%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://davidsimpson.me/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;"></a></div><p><strong>Updated 2011-06-30: Changed to asynchronous Google Analytics tracking</strong><br />
You&#8217;ve chosen <a href="http://www.atlassian.com/software/confluence/">Confluence</a> as your Enterprise wiki and got it installed.  People are using it.  But how many people?</p>
<p>You could have a look at the <strong>Global Activity</strong> page on Confluence, but this might confuse matters.  </p>
<p><a href="/wp-content/uploads/2009/03/confluence-global-activity1.png" rel="lightbox[177]" title="Confluence - Global Activity"><img src="http://davidsimpson.me/wp-content/uploads/2009/03/confluence-global-activity1-284x300.png" alt="" title="Confluence - Global Activity" width="284" height="300" class="alignnone size-medium wp-image-217" /></a></p>
<p>You&#8217;ll get to see graphs, but what do they really mean?  The Global Activity statistics are at best very basic.</p>
<p>Better still, install Google Analytics and you&#8217;ll have a much more accurate idea of what&#8217;s going on.  Best of all, it&#8217;s really easy to install.<br />
<span id="more-177"></span></p>
<h2>How to install Google Analytics on Confluence</h2>
<p>I&#8217;m assuming (for my sake) that you already know your way around Google Analytics.</p>
<h3>In Google Analytics</h3>
<p>Login to Google Analytics and add a new website profile</p>
<p>The settings will roughly mirror those in the screenshot below</p>
<p><a href="/wp-content/uploads/2009/03/google-analytics-account-settings.png" rel="lightbox[177]" title="Google Analytics - Account Settings"><img src="/wp-content/uploads/2009/03/google-analytics-account-settings-300x279.png" alt="" title="Google Analytics - Account Settings" width="300" height="279" class="alignnone size-medium wp-image-204" /></a></p>
<p>Make sure that you check &#8220;Do Track Site Search&#8221; against Site Search.  Add <strong>queryString</strong> as the Query Parameter. This will allow you to monitor who is searching for what.  </p>
<p><strong>Update (2009-11-12)</strong><br />
<em>Edit the Search Settings configuration like in the image to see search terms grouped by spaceKey in the internal search categories reports.  Further details why can be seen <a href="http://davidsimpson.me/2009/04/16/4-useful-tips-on-google-analytics-reporting-for-confluence/">here</a></em> </p>
<p><!--***--><div id="attachment_306" class="wp-caption alignnone" style="width: 160px"><a href="/wp-content/uploads/2009/04/settings-site-search.png" rel="lightbox[177]" title="settings-site-search"><img src="/wp-content/uploads/2009/04/settings-site-search-150x150.png" alt="Settings - Site Search" title="settings-site-search" width="150" height="150" class="size-thumbnail wp-image-306" /></a><p class="wp-caption-text">A screenshot of the Site Search Setting section</p></div></p>
<p>The top search terms will suggest either content that&#8217;s missing from the site, or something that is not easily found in the current information architecture.  Either way, tracking this and acting on the findings should improve the user experience.</p>
<h3>In Confluence</h3>
<p>Login to Confluence as an administrator and add the GA tracking javascript code to the end of the page body&#8230;</p>
<p>Navigate to:</p>
<p>Dashboard | Administration | Look and Feel | Custom HTML</p>
<p><a href="/wp-content/uploads/2009/03/confluence-custom-html-1.png" rel="lightbox[177]" title="Confluence - Custom HTML"><img src="/wp-content/uploads/2009/03/confluence-custom-html-1-150x150.png" alt="" title="Confluence - Custom HTML" width="150" height="150" class="alignnone size-thumbnail wp-image-203" /></a></p>
<p>Click on the &#8220;Edit&#8221; button and add the javascript sample (with your tracker code) to the &#8220;At end of the HEAD&#8221; section:</p>
<p><a href="/wp-content/uploads/2009/03/confluence-custom-html-2.png" rel="lightbox[177]" title="Confluence - Edit Custom HTML "><img src="/wp-content/uploads/2009/03/confluence-custom-html-2-150x150.png" alt="" title="Confluence - Edit Custom HTML " width="150" height="150" class="alignnone size-thumbnail wp-image-202" /></a></p>
<pre class="brush: jscript; title: ;">
&lt;script type=&quot;text/javascript&quot;&gt;
  // See: http://davidsimpson.me/2009/03/18/tracking-atlassian-confluence-usage-with-google-analytics/
  // Put this in Confluence Administration | Look and Feel | Custom HTML -- &quot;At end of the HEAD&quot;

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-XXXX-XX']); // Your GA code here
  _gaq.push(['_trackPageview']);

  // Add a page-level custom variable to record the space-key
  if (typeof jQuery('meta[name=confluence-space-key]').attr(&quot;content&quot;) == 'string') {
    _gaq.push(['_setCustomVar',
      1,                        // This custom var is set to slot #1 of 5
      'confluence-space-key',   // The name acts as a kind of category for the user activity
      jQuery('meta[name=confluence-space-key]').attr(&quot;content&quot;),  // This value of the custom variable
      3                         // Sets the scope to page-level
    ]);
  }

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

&lt;/script&gt;
</pre>
<h2>Results</h2>
<p>This works nicely, particularly as the custom variable allows us to easily track all space related content separately, and thus facilitate the use of the <a href="https://plugins.atlassian.com/plugin/details/16722">(Google) Analytics reporting plugin for Confluence</a>.</p>
<p>Screenshot of Content by Title report:<br />
<a href="/wp-content/uploads/2009/03/ga-results-content-by-title1.png" rel="lightbox[177]" title="Google Analytics Results - Content by Title"><img src="http://davidsimpson.me/wp-content/uploads/2009/03/ga-results-content-by-title1-300x231.png" alt="" title="Google Analytics Results - Content by Title" width="300" height="231" class="alignnone size-medium wp-image-211" /></a></p>
<p>Screenshot of Site Search Terms report:<br />
<a href="/wp-content/uploads/2009/03/ga-results-site-search.png" rel="lightbox[177]" title="Google Analytics Results - Site Search"><img src="http://davidsimpson.me/wp-content/uploads/2009/03/ga-results-site-search-300x141.png" alt="" title="Google Analytics Results - Site Search" width="300" height="141" class="alignnone size-medium wp-image-214" /></a></p>
<h3>Related Posts <small>(Updated)</small></h3>
<ul>
<li><a href="http://davidsimpson.me/2009/04/16/4-useful-tips-on-google-analytics-reporting-for-confluence/">4 Useful Tips on Google Analytics Reporting for Confluence</a></li>
<li><a href="http://davidsimpson.me/2010/01/02/announcing-google-analytics-plugin-for-confluence/">Announcing: Google Analytics plugin for Confluence</a></li>
<li><a href="http://www.bitvoodoo.ch/display/web/How+to+track+Confluence+usage+with+Google+Analytics">How to track Confluence usage with Google Analytics</a> by Remo Siegwart</li>
</ul>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://davidsimpson.me/2009/03/18/tracking-atlassian-confluence-usage-with-google-analytics/feed/</wfw:commentRss>
		<slash:comments>38</slash:comments>
		</item>
		<item>
		<title>Tracking referers to your website from Twitter clients with Google Analytics</title>
		<link>http://davidsimpson.me/2009/03/13/tracking-referers-to-your-website-from-twitter-clients-with-google-analytics/</link>
		<comments>http://davidsimpson.me/2009/03/13/tracking-referers-to-your-website-from-twitter-clients-with-google-analytics/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 19:53:50 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[analytics]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[web analytics]]></category>

		<guid isPermaLink="false">http://davidsimpson.me/?p=154</guid>
		<description><![CDATA[If someone using a desktop Twitter client (such as TweetDeck or Twirl) clicks on a link I&#8217;ve posted to my blog, the Google Analytics referer information will be blank. It registers as direct traffic to the website. This is fine when linking to other people&#8217;s websites &#8212; I&#8217;m not worried about them &#8212; but I&#8217;d [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton154" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fdavidsimpson.me%2F2009%2F03%2F13%2Ftracking-referers-to-your-website-from-twitter-clients-with-google-analytics%2F&amp;text=Tracking%20referers%20to%20your%20website%20from%20Twitter%20clients%20with%20Google%20Analytics&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fdavidsimpson.me%2F2009%2F03%2F13%2Ftracking-referers-to-your-website-from-twitter-clients-with-google-analytics%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://davidsimpson.me/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;"></a></div><p>If someone using a desktop Twitter client (such as <a href="http://tweetdeck.com/">TweetDeck</a> or <a href="http://www.twhirl.org/">Twirl</a>) clicks on a link I&#8217;ve posted to my blog, the Google Analytics referer information will be blank.  It registers as direct traffic to the website.  </p>
<p>This is fine when linking to other people&#8217;s websites &mdash; I&#8217;m not worried about them &mdash; but I&#8217;d like to know where that traffic to <em>my</em> websites comes from.</p>
<p>I generally shorten URLs with a service like <a href="http://bit.ly">bit.ly</a> (which does provide basic statistics on click throughs).  The trouble here is that you still miss the referrer information on your Google Analytics account. </p>
<h2>How can we capture that the source of the link was a Twitter post?</h2>
<p>The <a href="http://www.epikone.com/blog/">Analytics Talk</a> blog post &mdash; <a href="http://www.epikone.com/blog/2008/09/02/tracking-twitter/">Twitter and Google Analytics: What to Track</a> &mdash; gives a good solution to this problem.</p>
<p>Put simply, before you shorten the URL, add the following GA campaign request parameters to the end:<br />
<code>?utm_campaign=blog&#038;utm_source=twitter&#038;utm_medium=micro-blog</code></p>
<p>e.g.<br />
<code>http://example.com/</code><br />
becomes<br />
<code>http://example.com/?utm_campaign=blog&#038;utm_source=twitter&#038;utm_medium=micro-blog</code> </p>
<p>Now you can track referrers from Twitter clients within Google Analytics using<br />
<code>Traffic Sources | Campaigns</code>.  Nice.</p>
<p>Check out <a href="http://www.epikone.com/blog/2008/09/02/tracking-twitter/">Twitter and Google Analytics: What to Track</a> by Justin Cutroni  for the details.  </p>
<p><b>Aside:</b> Justin&#8217;s <a href="http://www.gashortcut.com/">Google Analytics Short Cut</a> PDF book ($10 from O&#8217;Reilly) is a great read, but it was written in 2007 before the last GA update.  I hope Justin gets the time to release an updated version soon.</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://davidsimpson.me/2009/03/13/tracking-referers-to-your-website-from-twitter-clients-with-google-analytics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Track Events in Flash Movies using WebTrends</title>
		<link>http://davidsimpson.me/2009/03/09/how-to-track-events-in-flash-movies-using-webtrends/</link>
		<comments>http://davidsimpson.me/2009/03/09/how-to-track-events-in-flash-movies-using-webtrends/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 17:07:26 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[analytics]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[webtrends]]></category>

		<guid isPermaLink="false">http://davidsimpson.me/?p=106</guid>
		<description><![CDATA[If your website contains Flash movies that link offsite or to microsites, you may wish to register the offsite link using WebTrends. This article provides an introduction. It assumes a little knowledge of ActionScript, Javascript as well as WebTrends. This example uses a intermediary javascript function that sits between the Flash movies and the WebTrends [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton106" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fdavidsimpson.me%2F2009%2F03%2F09%2Fhow-to-track-events-in-flash-movies-using-webtrends%2F&amp;text=How%20To%20Track%20Events%20in%20Flash%20Movies%20using%20WebTrends&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fdavidsimpson.me%2F2009%2F03%2F09%2Fhow-to-track-events-in-flash-movies-using-webtrends%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://davidsimpson.me/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;"></a></div><p><!-- How To Track Events in Flash Movies using WebTrends --></p>
<p>If your website contains Flash movies that link offsite or to microsites, you may wish to register the offsite link using WebTrends.  This article provides an introduction.  It assumes a little knowledge of ActionScript, Javascript as well as WebTrends.</p>
<p>This example uses a intermediary javascript function that sits between the Flash movies and the WebTrends code.</p>
<h3>Benefits</h3>
<ul>
<li>It&#8217;s much easier to debug if the WebTrends javascript is not called within the compiled Flash movie</li>
<li>The WebTrends tracking can be changed later without recompiling the Flash movie or even speaking to your Flash developer</li>
</ul>
<p><span id="more-106"></span></p>
<h3>Drawbacks</h3>
<ul>
<li>Javascript must be enabled to trigger the link to the target web page</li>
<li>Both Flash <i>and</i> Javascript will be required to navigate your website</li>
</ul>
<p><b>This is bad from an accessibility point of view</b>, but I won&#8217;t discuss that here.</p>
<h2>ActionScript for Flash buttons</h2>
<p>Edit your Flash movies so that the button that links to your external website or microsite has an ActionScript event handler which will trigger a call to Javascript.</p>
<h3>Older ActionScript versions</h3>
<pre class="brush: plain; title: ;">on (release)
{
	getURL(&quot;javascript:myFlashEvent('Open Days','http://www.nottingham.ac.uk/opendays');&quot;);
}</pre>
<h3>ActionScript 3+</h3>
<p>The <code>getURL</code> function was removed in ActionScript 3, so a slightly more complex example is required</p>
<pre class="brush: plain; title: ;">if (ExternalInterface.available)
{
	try
	{
		ExternalInterface.call(
			'myFlashEvent',                        // function name
			'Open Days',                           // function parameter 1
			'http://www.nottingham.ac.uk/opendays' // function parameter 2
		);
	}
	catch (error:Error)
	{
		// Error handling here
	}
	catch (error:SecurityError)
	{
		// Error handling here
	}
}</pre>
<p>The ActionScript calls the Javascript intermediary function <code>myFlashEvent</code>, which in turn registers the event with WebTrends and then loads the new web page.</p>
<h2>Javascript</h2>
<pre class="brush: jscript; title: ;">function myFlashEvent(eventDescription, eventValue){

	// Register Event with WebTrends
	dcsMultiTrack(
		'DCS.dcsuri', eventValue,                  // name/value pair for URL
		'WT.ti', 'FlashEvent:' + eventDescription  // name/value pair for page title
	);

	// Go to URL
	document.location.href = eventValue;
}</pre>
<p>This function will track the event as a visit to a URI using the <code>DCS.dcsuri</code> parameter.  The page title for the URI will be set to e.g. &#8216;FlashEvent:My Page Title&#8217; using the <code>WT.ti</code> parameter.</p>
<h2>Results</h2>
<p>The click event is showing up nicely in WebTrends as <code>FlashEvent:Open Days</code>, see the screenshot below</p>
<p><img class="hang-1-column" src="http://www.nottingham.ac.uk/~cczdas/images/webtrends-flash-event.png" alt="Screenshot of WebTrends Console" /></p>
<h2>Example code</h2>
<p>A working example of this code can be found <a href="http://www.nottingham.ac.uk/analytics-events/analytics-events/">here</a>.  </p>
<p>Sorry, I don&#8217;t have access to the .fla file, so that is not included.</p>
<h2>Adapting the Javascript for Google Analytics</h2>
<p>The <code>myFlashEvent</code> function can easily be adapted to work with Google Analytics instead:</p>
<pre class="brush: jscript; title: ;">function myFlashEvent(eventDescription, eventValue){

	// Register event
	pageTracker._trackEvent(
		'Flash', 'Link',
		eventDescription, eventValue
	);

	// Go to URL
	document.location.href = eventValue;
}</pre>
<h2>Reference</h2>
<ul>
<li><a href="http://www.arena.no/dokumentasjon/wt85/dcsMultiTrack.pdf">Tracking Complex Web Page Interactions Using dcsMultiTrack (WebTrends)</a></li>
<li><a href="http://blog.webtrends.com/2009/03/09/tracking-visitors-in-a-rich-media-world-part-i-tracking/">Tracking Visitors in a Rich Media World, Part I: Tracking</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/eventTrackerGuide.html">Event Tracking Guide (Google Analytics)</a></li>
<li><strong>Update:</strong> Here&#8217;s a really elegant solution to adding <a href="http://www.embeddedstream.com/2009/02/27/webtrends-tracking-from-flash/">Webtrends tracking to Flash</a> movies</li>
<li><strong>Update:</strong> <a href="http://www.insideria.com/2009/02/using-google-analytics-within.html">Google Analytics within Flex/Flash Applications</a</li>
</ul>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://davidsimpson.me/2009/03/09/how-to-track-events-in-flash-movies-using-webtrends/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

