<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>David Simpson</title>
	
	<link>http://davidsimpson.me</link>
	<description>Developing the web, one page at a time.</description>
	<lastBuildDate>Thu, 12 Aug 2010 13:31:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/davidsimpson" /><feedburner:info uri="davidsimpson" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Analytics Plugin for Confluence 1.2 released</title>
		<link>http://feedproxy.google.com/~r/davidsimpson/~3/ULwC029RQrA/</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 [...]]]></description>
			<content:encoded><![CDATA[
<p><img src="http://davidsimpson.me/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;">
// 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>

<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/davidsimpson?a=ULwC029RQrA:Rw6prSK6j1Y:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/davidsimpson?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=ULwC029RQrA:Rw6prSK6j1Y:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/davidsimpson?i=ULwC029RQrA:Rw6prSK6j1Y:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=ULwC029RQrA:Rw6prSK6j1Y:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/davidsimpson?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=ULwC029RQrA:Rw6prSK6j1Y:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/davidsimpson?i=ULwC029RQrA:Rw6prSK6j1Y:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=ULwC029RQrA:Rw6prSK6j1Y:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/davidsimpson?d=7Q72WNTAKBA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/davidsimpson/~4/ULwC029RQrA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://davidsimpson.me/2010/06/24/analytics-plugin-for-confluence-12-released/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://davidsimpson.me/2010/06/24/analytics-plugin-for-confluence-12-released/</feedburner:origLink></item>
		<item>
		<title>Bitten a lot by a bitlybot</title>
		<link>http://feedproxy.google.com/~r/davidsimpson/~3/LAYBZ0-8AmM/</link>
		<comments>http://davidsimpson.me/2010/06/22/bitten-a-lot-by-a-bitlybot/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 23:29:14 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[web]]></category>
		<category><![CDATA[bad coding]]></category>
		<category><![CDATA[bitly]]></category>
		<category><![CDATA[bitlybot]]></category>

		<guid isPermaLink="false">http://davidsimpson.me/?p=829</guid>
		<description><![CDATA[

This website and one or two others I run recently experienced what appeared to be a denial-of-service attack.   
Looking at the access logs, I could see several tens of thousands of requests all originating from a range of amazonaws.com IP addresses. All with the useragent &#8220;bitlybot&#8221;.
This post is a quick postmortem of what [...]]]></description>
			<content:encoded><![CDATA[
<p><a href="http://bit.ly/"><img src="http://davidsimpson.me/wp-content/uploads/2010/06/blowfish_twtr.png" alt="Bitly" title="Bitly blowfish" width="73" height="73" class="alignleft size-full wp-image-841" /></a></p>
<p>This website and one or two others I run recently experienced what appeared to be a denial-of-service attack.   </p>
<p>Looking at the access logs, I could see several tens of thousands of requests all originating from a range of amazonaws.com IP addresses. All with the useragent &#8220;bitlybot&#8221;.</p>
<p>This post is a quick postmortem of what went wrong and why.<br />
<span id="more-829"></span>	</p>
<h2>So what happened?</h2>
<p>I&#8217;ve been happily using the excellent <a href="http://bit.ly/">bit.ly</a> URL shortening API on the <a href="http://www.read-able.com/">Readability Test Tool</a> website for over a year with no problems at all.  Whenever a user checks the readability of a web page using the Readability Test Tool, a convenient &#8220;tweet this&#8221; link is provided for the results page.  </p>
<p>My bit.ly link also innocently appended a query string &mdash; <strong>&#038;utm_source=twitter&#038;utm_medium=retweet</strong> &mdash; so that I can track click-throughs from Twitter in <a hef="http://www.google.com/analytics/">Google Analytics</a>.  </p>
<p>Looking back at this, it wasn&#8217;t that clever a thing to do, but it only took a couple of minutes to implement, so was very little effort for a nice bit of analytics/measurement return.</p>
<p>All was good for a year.  Google Analytics tracking worked well.  There were no problems.  Indeed looking back at the access logs, the bitlybot user agent had not so much as sniffed the website once in that time. </p>
<p>One day, something changed.  Overnight bitlybot started crawling my website for all the links it had created over the year.  Unfortunately for every link it crawl, it also created another link appending more parameters to the query string. </p>
<p>Which it then crawled. Creating another link with more appended query parameters.  Ouch.</p>
<p>e.g.</p>
<pre class="brush: plain;">
http://www.read-able.com/check.php?uri=http%3A%2F%2Fwww.example.com%2F&amp;utm_source=twitter&amp;utm_medium=retweet
http://www.read-able.com/check.php?uri=http%3A%2F%2Fwww.example.com%2F&amp;utm_source=twitter&amp;utm_medium=retweet&amp;utm_source=twitter&amp;utm_medium=retweet
http://www.read-able.com/check.php?uri=http%3A%2F%2Fwww.example.com%2F&amp;utm_source=twitter&amp;utm_medium=retweet&amp;utm_source=twitter&amp;utm_medium=retweet&amp;utm_source=twitter&amp;utm_medium=retweet
</pre>
<p>And so on.</p>
<h2>What did I do?</h2>
<p>Initially I ranted on Twitter.  </p>
<p>Then I removed the &#8220;tweet this&#8221; link to prevent further bit.ly URLs from being created.  This wouldn&#8217;t stop things for while, but would at least prevent the problem from getting any worse.</p>
<p>Then I edited robots.txt:</p>
<pre class="brush: bash;">
# Tell &quot;bitlybot&quot; not to come here at all
User-agent: bitlybot
Disallow: /
</pre>
<p>This did not work &#8211; bitlybot only checks robots.txt once a day, so this would not improve matters instantly.</p>
<p>Then I redirected the traffic to bit.ly:</p>
<pre class="brush: php;">
if ($_SERVER['HTTP_USER_AGENT'] == 'bitlybot')
{
	header('Location: http://bit.ly/', true, 301);
}
</pre>
<p>That slowed it a bit.  Admittedly, I was still blaming them at this point.</p>
<p>Then <a href="http://twitter.com/dvdsmpsn/status/12973263701">I reached out to @bitly</a>.</p>
<p>They were very responsive. I sent them a detailed email with a section of access logs and they fixed it.  Quickly.</p>
<p>They disabled my account, preventing me from causing any further mischief.  They stopped bitlybot from it&#8217;s crawling activity and reported the progress back to me.</p>
<p>Each contact with bit.ly via twitter or email resulted in a positive response &mdash; they were very quick to respond and my websites were soon back to their usual somewhat diminutive volume of traffic.</p>
<h2>Conclusions</h2>
<ul>
<li>Bit.ly has excellent support &#8211; they are very responsive and my little server was soon back to normal</li>
<li>Think before you write code that uses other people&#8217;s APIs &#8211; you may not fully understand the consequences of your actions</li>
<li>My Google Analytics tracking parameters were added with little thought &#8211; I really ought to have tried a bit harder to weigh up the implications</li>
<li>My small VPS does nicely thank you for the limited traffic that it experiences.  Given some decent volumes of traffic it will fail.</li>
</ul>

<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/davidsimpson?a=LAYBZ0-8AmM:ZTAa4-lxE0s:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/davidsimpson?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=LAYBZ0-8AmM:ZTAa4-lxE0s:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/davidsimpson?i=LAYBZ0-8AmM:ZTAa4-lxE0s:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=LAYBZ0-8AmM:ZTAa4-lxE0s:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/davidsimpson?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=LAYBZ0-8AmM:ZTAa4-lxE0s:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/davidsimpson?i=LAYBZ0-8AmM:ZTAa4-lxE0s:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=LAYBZ0-8AmM:ZTAa4-lxE0s:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/davidsimpson?d=7Q72WNTAKBA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/davidsimpson/~4/LAYBZ0-8AmM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://davidsimpson.me/2010/06/22/bitten-a-lot-by-a-bitlybot/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://davidsimpson.me/2010/06/22/bitten-a-lot-by-a-bitlybot/</feedburner:origLink></item>
		<item>
		<title>Hide wiki markup – Confluence user macro</title>
		<link>http://feedproxy.google.com/~r/davidsimpson/~3/A3hcjRlD-WQ/</link>
		<comments>http://davidsimpson.me/2010/06/06/hide-wiki-markup-confluence-user-macro/#comments</comments>
		<pubDate>Sun, 06 Jun 2010 21:30:31 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[web]]></category>
		<category><![CDATA[atlassian]]></category>
		<category><![CDATA[confluence]]></category>

		<guid isPermaLink="false">http://davidsimpson.me/?p=788</guid>
		<description><![CDATA[
A simple Confluence user macro to hide access to the View Wiki Markup menu link&#8230;
{hide-wiki-markup}

One thing I love about Confluence is the way that you can browse other people&#8217;s pages and steal their superior layout ideas for your own wiki pages.  
It&#8217;s dead easy to do.  Go to the Tools drop down menu [...]]]></description>
			<content:encoded><![CDATA[
<p>A simple Confluence user macro to hide access to the <b>View Wiki Markup</b> menu link&#8230;</p>
<p style="font-size:250%; font-family:monaco,courier,fixed-width;">{hide-wiki-markup}</p>
<p><img src="http://davidsimpson.me/wp-content/uploads/2010/06/tools-menu1.png" alt="tools-menu" title="tools-menu" width="164" height="464" class="alignleft size-full wp-image-801" /></p>
<p>One thing I love about Confluence is the way that you can browse other people&#8217;s pages and steal their superior layout ideas for your own wiki pages.  </p>
<p>It&#8217;s dead easy to do.  Go to the <b>Tools</b> drop down menu and click on the <b>View Wiki Markup</b> link.  A new window will open containing the wiki markup for the page.  You can now copy the bits you like and discard the rest.  Your friends and colleagues will be impressed by your wiki skills and you can continue on your path to <a href="http://confluence.atlassian.com/display/CONFDEVAL/Become+a+Wiki+Ninja+with+Confluence">becoming a wiki ninja</a>.</p>
<p><b>But what if you don&#8217;t want to share those wiki markup skills?</b><br />
That&#8217;s not very collaborative, I know. But there are entirely valid reasons that you&#8217;d wish to disable this feature.<br />
<span id="more-788"></span><br />
An example of this is use of the <code>{sql}</code> plugin.  This is a really powerful plugin that allows you to query databases and tabulate the results in Confluence. Wrap this in a <code>{chart}</code> macro and you have an instant graph. Nice work!  There&#8217;s a <a href="http://blogs.atlassian.com/confluence/2009/08/confluence-business-intelligence-part1.html">great blog post at Atlassian</a> that use this to great effect.</p>
<h2>Security</h2>
<p>However, using this kind of markup on a public website is a bad idea.  Exposing the structure of your databases to people you don&#8217;t know and can&#8217;t trust is somewhat short sighted.  On a company intranet, the risk is still there, but hopefully it is not so dangerous.  Even so, it&#8217;s really best not to show this information in the first place.</p>
<h2>What can we do about it?</h2>
<p>The best solution would be additional security in the product that allows editors to prevent others from viewing wiki markup.  It would probably go in the <b>Restrictions</b> screen.  This does seem somewhat like a paranoid feature request, but call me paranoid.</p>
<p>Another way is to use Javascript to remove the link from the DOM.  This is not a replacement for good security, but will stop the casual user from accessing the wiki markup.</p>
<p><b>It is easily done in a user macro:</b></p>
<p>As a Confluence administrator, go to <b>Confluence Admin | User Macros</b> and click on <b>Create a User Macro</b>.</p>
<p>Fill out the form&#8230;<br />
<b>Macro name:</b> hide-wiki-markup<br />
<b>Output:</b> Macro generates HTML markup<br />
<b>Template:</b></p>
<pre class="brush: xml;">&lt;script type=&quot;text/javascript&quot;&gt;
jQuery('#action-view-source-link').parent().hide(); /*Updated from .remove(); Aug 2010*/
&lt;/script&gt;
</pre>
<p><img src="http://davidsimpson.me/wp-content/uploads/2010/06/hide-wiki-markup-config1-440x306.png" alt="hide-wiki-markup-config" title="hide-wiki-markup-config" width="440" height="306" class="alignnone size-medium wp-image-815" /></p>

<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/davidsimpson?a=A3hcjRlD-WQ:irgO1FbIblA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/davidsimpson?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=A3hcjRlD-WQ:irgO1FbIblA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/davidsimpson?i=A3hcjRlD-WQ:irgO1FbIblA:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=A3hcjRlD-WQ:irgO1FbIblA:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/davidsimpson?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=A3hcjRlD-WQ:irgO1FbIblA:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/davidsimpson?i=A3hcjRlD-WQ:irgO1FbIblA:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=A3hcjRlD-WQ:irgO1FbIblA:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/davidsimpson?d=7Q72WNTAKBA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/davidsimpson/~4/A3hcjRlD-WQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://davidsimpson.me/2010/06/06/hide-wiki-markup-confluence-user-macro/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://davidsimpson.me/2010/06/06/hide-wiki-markup-confluence-user-macro/</feedburner:origLink></item>
		<item>
		<title>What we really want to know about UK politics – Google Suggest reveals all</title>
		<link>http://feedproxy.google.com/~r/davidsimpson/~3/nDzEuUOsYyM/</link>
		<comments>http://davidsimpson.me/2010/05/13/what-we-really-want-to-know-uk-politics-google-suggest-results/#comments</comments>
		<pubDate>Wed, 12 May 2010 23:09:42 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Uncategorised]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[politics]]></category>

		<guid isPermaLink="false">http://davidsimpson.me/?p=755</guid>
		<description><![CDATA[
In light of the newly changed UK government and recent blogpost about Google Suggest, I thought I&#8217;d check the current state of the nation&#8217;s thoughts as predicted by Google UK. 
How? Type part of a sentence in the search form, then sit back and wait for the concerns of the people to be revealed.

Are politicians&#8230;
Celebrities? [...]]]></description>
			<content:encoded><![CDATA[
<p>In light of the newly changed UK government and <a href="http://www.lauralippay.com/blog/12-remarkable-google-suggest-results-what-americans-really-want-to-know/">recent blogpost</a> about Google Suggest, I thought I&#8217;d check the current state of the nation&#8217;s thoughts as predicted by <a href="http://www.google.co.uk/">Google UK</a>. </p>
<p>How? Type part of a sentence in the search form, then sit back and wait for the concerns of the people to be revealed.<br />
<span id="more-755"></span></p>
<h3>Are politicians&#8230;</h3>
<p>Celebrities? Psychopaths? Corrupt? Drug tested?</p>
<p><img src="http://davidsimpson.me/wp-content/uploads/2010/05/are-politicians-440x246.png" alt="are-politicians" title="are-politicians" width="440" height="246" class="alignright size-medium wp-image-762" /></p>
<p>&nbsp;</p>
<h3>Does David Cameron&#8230;</h3>
<p>Smoke? Dye his hair? Where does David Cameron go at night?</p>
<p><img src="http://davidsimpson.me/wp-content/uploads/2010/05/does-david-cameron-440x264.png" alt="does-david-cameron" title="does-david-cameron" width="440" height="264" class="alignright size-medium wp-image-761" /></p>
<p>&nbsp;</p>
<h3>Nick Clegg</h3>
<p>Atheist. 30 women. Nuff said.</p>
<p><img src="http://davidsimpson.me/wp-content/uploads/2010/05/nick-clegg-440x264.png" alt="nick-clegg" title="nick-clegg" width="440" height="264" class="alignright size-medium wp-image-763" /></p>
<p>&nbsp;</p>
<h3>Is Gordon Brown&#8230;</h3>
<p>A freemason? A liar? <em>And erm, some others</em></p>
<p><img src="http://davidsimpson.me/wp-content/uploads/2010/05/is-gordon-brown-440x265.png" alt="is-gordon-brown" title="is-gordon-brown" width="440" height="265" class="alignright size-medium wp-image-760" /></p>
<p>&nbsp;</p>
<h3>Is Parliament&#8230;</h3>
<p>Effective? Democratic? Now an irrelevant institution?</p>
<p><img src="http://davidsimpson.me/wp-content/uploads/2010/05/is-parliament-440x265.png" alt="is-parliament" title="is-parliament" width="440" height="265" class="alignright size-medium wp-image-764" /></p>
<p>&nbsp;</p>
<h3>Is the treasury&#8230;</h3>
<p>Printing money?<br />
<img src="http://davidsimpson.me/wp-content/uploads/2010/05/is-the-treasury-440x96.png" alt="is-the-treasury" title="is-the-treasury" width="440" height="96" class="alignright size-medium wp-image-756" /></p>
<p>&nbsp;</p>
<h3>Is the government&#8230;</h3>
<p>Hiding aliens? Making you fat? Watching my computer?<br />
<img src="http://davidsimpson.me/wp-content/uploads/2010/05/is-the-government-440x266.png" alt="is-the-government" title="is-the-government" width="440" height="266" class="alignright size-medium wp-image-758" /></p>
<p>&nbsp;</p>
<h3>Do government&#8230;</h3>
<p>Assassins exist? Officials pay taxes?<br />
<img src="http://davidsimpson.me/wp-content/uploads/2010/05/do-government-440x265.png" alt="do-government" title="do-government" width="440" height="265" class="alignright size-medium wp-image-757" /></p>
<p>&nbsp;</p>
<h3>Does democracy&#8230;</h3>
<p>Work? Exist? Encourage terrorism?<br />
<img src="http://davidsimpson.me/wp-content/uploads/2010/05/does-democracy-440x264.png" alt="does-democracy" title="does-democracy" width="440" height="264" class="alignright size-medium wp-image-759" /></p>
<p>&nbsp;</p>

<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/davidsimpson?a=nDzEuUOsYyM:KkpotnyC7r4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/davidsimpson?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=nDzEuUOsYyM:KkpotnyC7r4:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/davidsimpson?i=nDzEuUOsYyM:KkpotnyC7r4:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=nDzEuUOsYyM:KkpotnyC7r4:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/davidsimpson?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=nDzEuUOsYyM:KkpotnyC7r4:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/davidsimpson?i=nDzEuUOsYyM:KkpotnyC7r4:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=nDzEuUOsYyM:KkpotnyC7r4:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/davidsimpson?d=7Q72WNTAKBA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/davidsimpson/~4/nDzEuUOsYyM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://davidsimpson.me/2010/05/13/what-we-really-want-to-know-uk-politics-google-suggest-results/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://davidsimpson.me/2010/05/13/what-we-really-want-to-know-uk-politics-google-suggest-results/</feedburner:origLink></item>
		<item>
		<title>Meta tags are your friend part 2: Space specific tracking in Confluence with Google Analytics</title>
		<link>http://feedproxy.google.com/~r/davidsimpson/~3/NwyURfQYgPo/</link>
		<comments>http://davidsimpson.me/2010/04/09/meta-tags-are-your-friend-part-2-space-specific-tracking-in-confluence-with-google-analytics/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 01:14:54 +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]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[web analytics]]></category>
		<category><![CDATA[wiki]]></category>

		<guid isPermaLink="false">http://davidsimpson.me/?p=719</guid>
		<description><![CDATA[
I&#8217;ve previously written a number of posts about Confluence and Google Analytics (GA), including how to set up GA on Confluence and pointers for GA reports you should consider.  Lastly, I wrote the Confluence Google Analytics Plugin (CGAP) which provides space specific GA reports from within Confluence.
However, I&#8217;ve not been entirely happy because there [...]]]></description>
			<content:encoded><![CDATA[
<p>I&#8217;ve previously written a number of posts about Confluence and Google Analytics (GA), including <a href="/2009/03/18/tracking-atlassian-confluence-usage-with-google-analytics/">how to set up GA on Confluence</a> and pointers for <a href="/2009/04/16/4-useful-tips-on-google-analytics-reporting-for-confluence/">GA reports you should consider</a>.  Lastly, I wrote the <a href="/2010/01/02/announcing-google-analytics-plugin-for-confluence/">Confluence Google Analytics Plugin</a> (CGAP) which provides space specific GA reports from within Confluence.</p>
<p>However, I&#8217;ve not been entirely happy because there wasn&#8217;t a method to allow complete tracking of all space specific Confluence pages using CGAP or the reports that I&#8217;ve previously described.</p>
<p>This has been <a href="http://forums.atlassian.com/thread.jspa?messageID=257303418">documented</a> <a href="http://blogs.atlassian.com/confluence/2009/12/report-confluence-activity-using-google-analytics-in-the-wiki.html#comment-210247">elsewhere</a>, but briefly, the problem is with&#8230;</p>
<ul>
<li>pages with punctuation in the title e.g. <a href="http://workspace.nottingham.ac.uk/pages/viewpage.action?pageId=45947608" title="http://workspace.nottingham.ac.uk/pages/viewpage.action?pageId=45947608">This page is bad for Analytics, isn&#8217;t it?</a> (hover on the link to see the URI)</li>
<li>short URLs e.g. /x/2Bq9Ag</li>
<li>space administration e.g. /spaces/spaceadmin.action?key=spaceKey</li>
<li>page edits e.g./pages/editpage.action?pageId=XXXX</li>
<li>page creation e.g. /pages/createpage.action?spaceKey=spaceKey&#038;fromPageId=XXXX</li>
<li>add/view attachments e.g. /pages/viewpageattachments.action?pageId=XXXX</li>
<li>page history e.g. /pages/viewpreviousversions.action?pageId=XXXX</li>
<li>view wiki markup e.g. /pages/viewpagesrc.action?pageId=XXXX</li>
</ul>
<p>&#8230;and so on.  I think you get the picture.</p>
<p>For any page where there is a real interaction with the wiki &mdash; such as page creation or page edits, attachment viewing or uploading &mdash; it is very difficult associate that interaction to the space where the interaction took place.  Damn.  That&#8217;s the main point really. Wikis are for collaboration &mdash; editing and creating content &mdash; not just passively reading.  </p>
<p>It really bugs me that the URIs in Confluence aren&#8217;t built up so that they always provide a context of where you are.  But what can we do?</p>
<p>This post suggests 2 possible solutions to this problem:  </p>
<ol>
<li>A Javascript only method</li>
<li>A Javascript and velocity templating method</li>
</ol>
<p>Both have their drawbacks, but they do let you get a little closer to understanding what your users are doing within your Confluence spaces. Try them out and please report back on your preference or your own alternative solution.</p>
<p><span id="more-719"></span></p>
<h2>The Javascript only method</h2>
<p>In this method, we track a custom variable in GA where possible, so that we can attach a page view to the corresponding Confluence space.</p>
<p>Atlassian handily provide the following (example) meta tag on every page that has an associated space:</p>
<pre class="brush: xml;">&lt;meta id=&quot;confluence-space-key&quot; name=&quot;confluence-space-key&quot; content=&quot;~cczdas&quot;&gt;</pre>
<p>We can check for that meta tag and pass it into a custom variable in Google Analytics.</p>
<p>In Confluence, go to <b>Dashboard | Administration | Look and Feel | Custom HTML</b></p>
<p>Click on the “Edit” button and add this javascript snippet (with your tracker code) to the “At end of the BODY” section:</p>
<pre class="brush: jscript;">
&lt;script type=&quot;text/javascript&quot;&gt;
var gaJsHost = ((&quot;https:&quot; == document.location.protocol) ? &quot;https://ssl.&quot; : &quot;http://www.&quot;);
document.write(unescape(&quot;%3Cscript src='&quot; + gaJsHost + &quot;google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E&quot;));
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;

	window.onload = function(){
		try
		{
			var pageTracker = _gat._getTracker(&quot;UA-XXXXX-XX&quot;);

			// 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
				     '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
				);
			}
		}
		catch (err) {}
	}

&lt;/script&gt;
</pre>
<p>This means for each page, we&#8217;ve added a custom variable which can later be check against.  We can now therefore easily check which page belongs to which space.</p>
<p>In Google Analytics, the custom variables report looks like this:</p>
<p><a href="http://davidsimpson.me/wp-content/uploads/2010/04/confluence-ga-custom-variable-report.png"><img src="http://davidsimpson.me/wp-content/uploads/2010/04/confluence-ga-custom-variable-report-440x316.png" alt="confluence-ga-custom-variable-report" title="confluence-ga-custom-variable-report" width="440" height="316" class="size-medium wp-image-725" /></a></p>
<p>This doesn&#8217;t really tell us much, other than the number of page views for a space and a little more.  To get at the real power of custom variables, we need to create a custom segment for each space.  This will allow us to see all the interactions for the space.</p>
<p>Here&#8217;s a short video guide to creating custom segments for Confluence spaces:</p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/gOBoqG7LNLc&#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/gOBoqG7LNLc&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<h3>Pros</h3>
<ul>
<li>It&#8217;s really simple. Anyone with Confluence administration rights can cut and paste this code.</li>
<li>It&#8217;s pure. This should not be affected by upgrades to the platform.</li>
<li>It&#8217;s easily to support. Lots of people know Javascript.</li>
</ul>
<h3>Cons</h3>
<ul>
<li>You&#8217;re moving into slightly advanced Google Analytics territory here.</li>
<li>You&#8217;ll need to set up a separate custom advanced segment for each space.  This may be somewhat dull.</li>
</ul>
<p>I really like this approach, but haven&#8217;t managed to successfully add it into CGAP yet <a href="http://www.google.com/support/forum/p/Google+Analytics/thread?tid=23eb6e88efbd4ac3&#038;hl=en">whilst maintaining access to historical data</a>.</p>
<h2>Javascript and velocity templating method</h2>
<p>In this method, we trick Google Analytics into reporting the URL in a the format that works with content drill-down e.g.</p>
<ul>
<li>/pages/viewpage.action?pageId=XXXX becomes /display/spaceKey/Page+Title</li>
<li>/x/2Bq9Ag (short URL) becomes /display/spaceKey/Page+Title</li>
<li>/pages/editpage.action?pageId=XXX becomes /display/spaceKey/Page+Title/edit</li>
<li>/pages/viewpageattachments.action?pageId=XXX becomes /display/spaceKey/Page+Title/view-attachments</li>
</ul>
<p>We do this by adding a custom meta tag named &#8220;analytics.url.fix&#8221; from which we read the &#8220;fixed&#8221; URL using a little Javascript.	</p>
<h3>Edits</h3>
<p><b>page.vmd</b> in your theme:</p>
<pre class="brush: plain;">
## Add Google Analytics support for page edits, attachment views etc.
## Called by $!sitemeshPage.getProperty(&quot;page.googleAnalyticsUrlFix&quot;) in main.vmd
&lt;content tag=&quot;googleAnalyticsUrlFix&quot;&gt;
	#if ($mode == &quot;view&quot;)
		&lt;meta name=&quot;analytics.url.fix&quot; desc=&quot;$req.contextPath/display/$page.spaceKey/$page.title&quot; /&gt;
	#else
		&lt;meta name=&quot;analytics.url.fix&quot; desc=&quot;$req.contextPath/display/$page.spaceKey/$page.title/$mode&quot; /&gt;
	#end
&lt;/content&gt;
</pre>
<p><b>main.vmd</b> in your theme:<br />
Add after the title node in /html/head/title</p>
<pre class="brush: plain;">
## Call the googleAnalyticsUrlFix content tag in page.vmd, fail silently:
$!sitemeshPage.getProperty(&quot;page.googleAnalyticsUrlFix&quot;)
</pre>
<p>In Confluence, go to <b>Dashboard | Administration | Look and Feel | Custom HTML</b></p>
<p>Click on the “Edit” button and add this javascript snippet (with your tracker code) to the “At end of the BODY” section:</p>
<pre class="brush: jscript;">
&lt;script type=&quot;text/javascript&quot;&gt;
var gaJsHost = ((&quot;https:&quot; == document.location.protocol) ? &quot;https://ssl.&quot; : &quot;http://www.&quot;);
document.write(unescape(&quot;%3Cscript src='&quot; + gaJsHost + &quot;google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E&quot;));
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
	window.onload = function(){
		try
		{
			var pageTracker = _gat._getTracker(&quot;UA-XXXXXX-X&quot;); 

			// Test for the meta[name=analytics.url.fix] tag &amp; fix the url
			if (typeof jQuery('meta[name=analytics.url.fix]').attr(&quot;content&quot;) == 'string')
			{
	 			// console.debug('corrected pageview');
	   			var pageUri = jQuery('meta[name=analytics.url.fix]').attr(&quot;content&quot;).replace(/\s+/gi, '+');
				pageTracker._trackPageview(pageUri);
			}
			else
			{
				// console.debug('default pageview');
				pageTracker._trackPageview();
			}
		}
		catch (err) {}
	}
&lt;/script&gt;
</pre>
<h3>Pros</h3>
<ul>
<li>You don&#8217;t have to do anything on the Google Analytics side at all</li>
<li>
		This is just great for the content drilldown screen in Google Analytics.</p>
<ul>
<li>It means that pages with punctuation in the title can now be seen within their correct space.</li>
<li>The space owners can now be sure of the stats for viewing and editing pages within their space.</li>
</ul>
</li>
<li>
		This is great for the Google Analytics plugin for Confluence (CGAP)</p>
<ul>
<li>All the page edits should be shown in the analytics report</li>
<li>It&#8217;s easily supportable. Lots of people know Javascript</li>
</ul>
</li>
</ul>
<h3>Cons</h3>
<ul>
<li>It&#8217;s a bit messy.</li>
<li>You&#8217;ll have to apply this to every theme you support.</li>
<li>Editing velocity templates isn&#8217;t everyone&#8217;s cup of tea.</li>
<li>I&#8217;ve no idea what will happen when you upgrade Confluence.</li>
<li>It niggles me that we&#8217;re sending incorrect (though easily readable) pageview data to Google Analytics.</li>
<li>It still doesn&#8217;t tie everything to the space, just the page interactions</li>
</ul>
<p>To my mind, this is less elegant, but provides pretty much instant results.</p>
<h2>Which one to choose?</h2>
<p>I really like the simplicity of the first solution. Just a little bit of Javascript to read a meta tag that&#8217;s already there.  It&#8217;s likely to easily survive an upgrade. But I&#8217;m  disappointed that as yet, I can&#8217;t get it to work nicely with CGAP.</p>
<p>For ongoing support reasons, I&#8217;d always say <b>don&#8217;t mess with the platform</b>. Don&#8217;t do anything which makes it more difficult to upgrade to the latest and greatest version. If you agree, then steer well clear of the latter option.  If however, you absolutely have to start complete space specific tracking right now, no matter what, then the latter is then choice for you.</p>

<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/davidsimpson?a=NwyURfQYgPo:Zu_WN4SkITE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/davidsimpson?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=NwyURfQYgPo:Zu_WN4SkITE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/davidsimpson?i=NwyURfQYgPo:Zu_WN4SkITE:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=NwyURfQYgPo:Zu_WN4SkITE:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/davidsimpson?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=NwyURfQYgPo:Zu_WN4SkITE:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/davidsimpson?i=NwyURfQYgPo:Zu_WN4SkITE:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=NwyURfQYgPo:Zu_WN4SkITE:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/davidsimpson?d=7Q72WNTAKBA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/davidsimpson/~4/NwyURfQYgPo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://davidsimpson.me/2010/04/09/meta-tags-are-your-friend-part-2-space-specific-tracking-in-confluence-with-google-analytics/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://davidsimpson.me/2010/04/09/meta-tags-are-your-friend-part-2-space-specific-tracking-in-confluence-with-google-analytics/</feedburner:origLink></item>
		<item>
		<title>Meta tags are your friend part 1: Tracking roles in Sungard Luminis with Google Analytics</title>
		<link>http://feedproxy.google.com/~r/davidsimpson/~3/YmS1zD7qJ4U/</link>
		<comments>http://davidsimpson.me/2010/04/08/meta-tags-are-your-friend-part-tracking-roles-in-sungard-luminis-with-google-analytics/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 14:57:23 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Uncategorised]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[luminis]]></category>
		<category><![CDATA[sungardhe]]></category>
		<category><![CDATA[university of nottingham]]></category>

		<guid isPermaLink="false">http://davidsimpson.me/?p=668</guid>
		<description><![CDATA[
At work, we use Sungard HE&#8217;s Luminis portal (v3.3) &#8212; It&#8217;s been good to us over the years, but there&#8217;s a lack of usage information regarding users&#8217; roles and their interactions with Luminis.  
In the past, we&#8217;ve added Google Analytics to Luminis to track the interactions, but never managed to fully segment user roles. [...]]]></description>
			<content:encoded><![CDATA[
<p>At work, we use <a href="http://www.sungardhe.com/">Sungard HE</a>&#8217;s Luminis portal (v3.3) &mdash; It&#8217;s been good to us over the years, but there&#8217;s a lack of usage information regarding users&#8217; roles and their interactions with Luminis.  </p>
<p>In the past, <a href="http://davidsimpson.me/2009/02/27/google-analytics-and-sungardhe-luminis/">we&#8217;ve added Google Analytics to Luminis</a> to track the interactions, but never managed to fully segment user roles. Until now.</p>
<p>Out of the box, Luminis has roles such as staff, student, faculty, ProspectiveStudent etc.  Users can have one or more of these roles and other custom roles too.  If we could capture all the roles and pass them onto Google Analytics, then we&#8217;d be able to fully segment the user types and gain a better understanding of how each segment uses Luminis.</p>
<p>This post aims to show how this is possible in just 3 steps:</p>
<ol>
<li><b>XSL:</b> Edit nested-tables.xsl to add a custom meta tag for the luminis roles</li>
<li><b>Javascript/jQuery:</b> Read the custom meta tag and set a custom variable in Google Analytics</li>
<li><b>Google Analytics:</b> Create custom segments to view traffic for specific Luminis roles</li>
</ol>
<p><span id="more-668"></span></p>
<h2>Edit nested-tables.xsl and add a custom meta tag to the header</h2>
<p>We&#8217;ve seriously hacked at nested-tables.xsl over the years, so our version of the file is likely to be different to most.  The main aim here is to find the html &gt; head  section and add a custom meta tag:</p>
<pre class="brush: plain;">
&lt;!-- Dump all roles into a single meta tag as a comma separated value --&gt;
&lt;meta name=&quot;luminis.role&quot;&gt;
   	&lt;xsl:attribute name=&quot;content&quot;&gt;
		&lt;xsl:for-each select=&quot;//layout/cp:cpInfo/cp:cpProperty[@name='pdsRole']/child::*&quot;&gt;
			&lt;xsl:value-of select=&quot;concat(., ',')&quot; /&gt;
   		&lt;/xsl:for-each&gt;
   	&lt;/xsl:attribute&gt;
&lt;/meta&gt;
</pre>
<h2>Read the custom meta tag and set a custom variable in Google Analytics</h2>
<p>Our implementation of Google Analytics is a little complex, but this example I&#8217;ve based on the standard Google Analytics example code.   </p>
<p>Using Javascript (infused with jQuery in our case), we can read the custom meta tag and set a custom variable. </p>
<pre class="brush: jscript;">
&lt;script type=&quot;text/javascript&quot;&gt;
var gaJsHost = ((&quot;https:&quot; == document.location.protocol) ? &quot;https://ssl.&quot; : &quot;http://www.&quot;);
document.write(unescape(&quot;%3Cscript src='&quot; + gaJsHost + &quot;google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E&quot;));
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;

	window.onload = function(){
		try
		{
			var pageTracker = _gat._getTracker(&quot;UA-XXXXX-XX&quot;);

			if (typeof $('meta[name=luminis.role]').attr(&quot;content&quot;) == 'string')
			{
				pageTracker._setCustomVar(
				     1,                                                // This custom var is set to slot #1 of the 5 available in GA
				     &quot;luminis.role&quot;,                                   // The name acts as a kind of category for the user activity
				     ','+$('meta[name=luminis.role]').attr(&quot;content&quot;), // The value of the custom variable (starting with a comma)
				     2                                                 // Sets the scope to session-level
				);
			}
			pageTracker._trackPageview();
		}
		catch (err) {}
	}

&lt;/script&gt;
</pre>
<p>According to the <a href="http://code.google.com/apis/analytics/docs/tracking/gaTrackingCustomVariables.html#sessionLevel">documentation</a>, it&#8217;s important to set the custom variable before tracking the page view.	</p>
<h2>Create custom segments to view traffic for specific Luminis roles</h2>
<p>Sign in to Google Analytics and view your normal website reports.<br />
Click on <b>Advanced segments | Create a new advanced segment</b></p>
<p>Create a new segment where&#8230;<br />
<b>Custom variable (Value 1)</b> contains <b>,staff,</b><br />
AND<br />
<b>Custom variable (Value 1)</b> contains <b>,faculty,</b></p>
<p>Note the surrounding commas &#8211; we&#8217;re using them as role delimiters.</p>
<p>Give the segment a name e.g. &#8220;Luminis roles: staff AND faculty&#8221;"</p>
<p><a href="http://davidsimpson.me/wp-content/uploads/2010/04/create-custom-segment.png"><img src="http://davidsimpson.me/wp-content/uploads/2010/04/create-custom-segment-419x440.png" alt="Create  custom segment" title="Create  custom segment" width="419" height="440" class="size-medium wp-image-674" /></a></p>
<h2>All done, but have patience</h2>
<p>Your custom segment is now available from the advanced segment drop-down:</p>
<p><img src="http://davidsimpson.me/wp-content/uploads/2010/04/select-custom-segment.png" alt="select-custom-segment" title="Select advanced segment" width="316" height="41" class="wp-image-675" /></p>
<p>Custom variables seem to take longer to filter through to Google Analytics than normal data such as page views.  So come back in a couple of days and try out your new advanced segment.</p>
<p><b>Update (12 April 2010):</b><br />
Shortly after I published this post, the Google Analytics blog posted their <a href="http://analytics.blogspot.com/2010/04/custom-variables-webinar-available-for.html">webinar on Google Analytics custom variables</a>.</p>
<p>Also, if you&#8217;re interested in creating advanced segments from custom variables, I&#8217;ve posted a<a href="http://www.youtube.com/watch?v=gOBoqG7LNLc">youtube video that steps through the process</a>.</p>

<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/davidsimpson?a=YmS1zD7qJ4U:EdMhub4th2g:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/davidsimpson?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=YmS1zD7qJ4U:EdMhub4th2g:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/davidsimpson?i=YmS1zD7qJ4U:EdMhub4th2g:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=YmS1zD7qJ4U:EdMhub4th2g:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/davidsimpson?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=YmS1zD7qJ4U:EdMhub4th2g:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/davidsimpson?i=YmS1zD7qJ4U:EdMhub4th2g:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=YmS1zD7qJ4U:EdMhub4th2g:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/davidsimpson?d=7Q72WNTAKBA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/davidsimpson/~4/YmS1zD7qJ4U" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://davidsimpson.me/2010/04/08/meta-tags-are-your-friend-part-tracking-roles-in-sungard-luminis-with-google-analytics/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://davidsimpson.me/2010/04/08/meta-tags-are-your-friend-part-tracking-roles-in-sungard-luminis-with-google-analytics/</feedburner:origLink></item>
		<item>
		<title>Dear Apple Inc.</title>
		<link>http://feedproxy.google.com/~r/davidsimpson/~3/hCu5HcB_j9E/</link>
		<comments>http://davidsimpson.me/2010/02/10/dear-apple-inc/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 19:52:52 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[usability]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[ui patterns]]></category>
		<category><![CDATA[ux]]></category>

		<guid isPermaLink="false">http://davidsimpson.me/?p=571</guid>
		<description><![CDATA[

Please fix the search UI in Safari on the iPhone.  
I&#8217;ve been using the iPhone for some time now and overall, the interface is really slick.  The buttons are consistently placed and this gives a really strong user experience.  Everything appears to be in the obvious place.  
The trouble is, I [...]]]></description>
			<content:encoded><![CDATA[
<p><img src="http://davidsimpson.me/wp-content/uploads/2010/02/UK_Mailred.png" alt="UK postage stamp" title="UK postage stamp" width="128" height="128" class="alignleft size-full wp-image-596" /></p>
<p><strong>Please fix the search <acronym title="user interface">UI<acronym> in Safari on the iPhone.</strong>  </p>
<p>I&#8217;ve been using the iPhone for some time now and overall, the interface is really slick.  The buttons are consistently placed and this gives a really strong user experience.  Everything appears to be in the obvious place.  </p>
<p>The trouble is, I like to search the web and it looks like you&#8217;ve forgotten your own iPhone user interface rules for this area.<br />
<span id="more-571"></span></p>
<h3>Let me explain</h3>
<p>In all your other applications, the primary action button is located top-right with a secondary action button top-left.  </p>
<p><strong>Here&#8217;s some examples:</strong></p>
<p><img src="http://davidsimpson.me/wp-content/uploads/2010/02/Calendar-Add-Event.png" alt="Calendar - Add Event" title="Calendar - Add Event" width="320" height="480"  /></p>
<p><img src="http://davidsimpson.me/wp-content/uploads/2010/02/Mail-New-Message.png" alt="Mail - New Message" title="Mail - New Message" width="320" height="480" /></p>
<p><img src="http://davidsimpson.me/wp-content/uploads/2010/02/Safari-Basic-Authentication-dialog.png" alt="Safari Basic Authentication dialog" title="Safari Basic Authentication dialog" width="320" height="480" /></p>
<p><img src="http://davidsimpson.me/wp-content/uploads/2010/02/Messages-Edit.png" alt="Messages - Edit" title="Messages - Edit" width="320" height="480"  /></p>
<p>You get the picture, right?</p>
<p>Over time the user learns this convention and without realising it assumes that the top-right button means &#8220;OK&#8221;, &#8220;Submit&#8221;, &#8220;Search&#8221; or whatever the primary action is.</p>
<h3>Now, let&#8217;s have a look at the Safari search screen</h3>
<p>What&#8217;s in the top-right button position?</p>
<p><img src="http://davidsimpson.me/wp-content/uploads/2010/02/Safari-Search-Currently.png" alt="Safari Search - Currently" title="Safari Search - Currently" width="320" height="480" /></p>
<p> It&#8217;s the &#8220;Cancel&#8221; button i.e. the secondary action.  </p>
<p><strong>Oh dear.  How did that get there?</strong></p>
<p>At first, I thought that I was at fault because I hadn&#8217;t properly learned the interface.  Then I remembered one of the first observations you make when usability testing.  <strong>Users blame themselves</strong> for the mistakes in the design of the interface.</p>
<p>That the reason I was making the mistake so often was precisely because I <em>had</em>  learned the conventions of the user interface.</p>
<h3>So what can we do?</h3>
<p>The interface needs a subtle redesign.  Nothing major, just an increment to correct the problem.</p>
<p><strong>There are 2 options that immediately spring to mind</strong></p>
<p><strong>Option 1:</strong>  Move the Cancel button to the top-left &#8220;secondary action&#8221; position</p>
<p><img src="http://davidsimpson.me/wp-content/uploads/2010/02/Safari-Search-Enhancement-Option-2.png" alt="Safari Search Enhancement - Option" title="Safari Search Enhancement - Option" width="320" height="480" /></p>
<p>This should be really easy.  The basic premise of the current design is left intact and the secondary action is returned to the correct place in the interface &#8211; the top-left position.</p>
<p><strong>Option 2:</strong> Add a &#8220;Search&#8221; button in the top-right position and move the Cancel button to the top-left &#8220;secondary action&#8221; position.</p>
<p><img src="http://davidsimpson.me/wp-content/uploads/2010/02/Safari-Search-Enhancement-Option-1.png" alt="Safari Search Enhancement - Option" title="Safari Search Enhancement - Option" width="320" height="480"  /></p>
<p>We&#8217;ve got an additional button now, but it&#8217;s consistent with the overall design of the other apps you produce.</p>
<p>I know you&#8217;re really busy right now, especially with all the activity around the iPad, but please fit this into the next version of the OS.  It is such a minor UI change, but would markedly improve the way the browser search interface works.</p>
<p>Best of luck with iPhone OS 4.0.  I hope you bundle some of <a href="http://www.tuaw.com/2010/01/10/dear-apple-what-we-want-to-see-for-iphone-4-0-part-1?icid=sphere_blogsmith_inpage_tuaw">these ideas</a>, but don&#8217;t worry too much about Flash.</p>
<p><a href="http://twitter.com/dvdsmpsn">David</a></p>
<p><strong>P.S.</strong> If you can&#8217;t manage this for me, then I&#8217;d be happy to settle for <a href="http://www.opera.com/press/releases/2010/02/10/">Opera Mini</a> being approved in the App Store instead &#8211;  I quite like the idea of being able to browse <a href="http://my.opera.com/haavard/blog/2010/02/10/opera-mini-iphone">6 times faster than Safari</a>.</p>
<p>Image credit: <a href="http://www.tonysmac.pwp.blueyonder.co.uk/2007/02/uk-stamp-icons.html">UK stamp</a></p>

<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/davidsimpson?a=hCu5HcB_j9E:G3q8RBL1etE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/davidsimpson?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=hCu5HcB_j9E:G3q8RBL1etE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/davidsimpson?i=hCu5HcB_j9E:G3q8RBL1etE:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=hCu5HcB_j9E:G3q8RBL1etE:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/davidsimpson?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=hCu5HcB_j9E:G3q8RBL1etE:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/davidsimpson?i=hCu5HcB_j9E:G3q8RBL1etE:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=hCu5HcB_j9E:G3q8RBL1etE:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/davidsimpson?d=7Q72WNTAKBA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/davidsimpson/~4/hCu5HcB_j9E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://davidsimpson.me/2010/02/10/dear-apple-inc/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://davidsimpson.me/2010/02/10/dear-apple-inc/</feedburner:origLink></item>
		<item>
		<title>Some thoughts on developing my first Confluence plugin</title>
		<link>http://feedproxy.google.com/~r/davidsimpson/~3/JvpM34u5xvU/</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 [...]]]></description>
			<content:encoded><![CDATA[
<p><img src="http://davidsimpson.me/wp-content/uploads/2010/01/ga-idea2.png" alt="ga-idea" title="ga-idea" width="440" height="150" class="alignnone" /></p>
<p><!--<br />
Some thoughts on developing my first Confluence plugin<br />
or<br />
A bluffer's guide to developing Confluence plugins<br />
--></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:
<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 &mdash; 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;">
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;">
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;">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 src="http://davidsimpson.me/wp-content/uploads/2010/01/iStock_000009660877XSmall-440x175.jpg" alt="Beer" title="Beer" width="440" height="175" class="aligncenter size-medium wp-image-525" /></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><b>I like to run before I can walk.</b>  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><b>Add Google Analytics JARs to maven:</b></p>
<pre class="brush: bash;">
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><b>Edit the Project Object Model (POM) to add the dependencies</b>  </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;">
&lt;!-- Add Google Analytics dependencies: --&gt;
   &lt;dependency&gt;
       &lt;groupId&gt;com.google.gdata&lt;/groupId&gt;
       &lt;artifactId&gt;gdata-core&lt;/artifactId&gt;
       &lt;version&gt;1.0&lt;/version&gt;
   &lt;/dependency&gt;
   &lt;dependency&gt;
       &lt;groupId&gt;com.google.gdata&lt;/groupId&gt;
       &lt;artifactId&gt;gdata-analytics&lt;/artifactId&gt;
       &lt;version&gt;2.0&lt;/version&gt;
   &lt;/dependency&gt;
&lt;dependency&gt;
	&lt;groupId&gt;com.google.collect&lt;/groupId&gt;
	&lt;artifactId&gt;google-collect&lt;/artifactId&gt;
	&lt;version&gt;1.0&lt;/version&gt;
&lt;/dependency&gt;
</pre>
<p><b>Next, fire up your IDE</b></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;">
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 &mdash; <a href="http://www.redleopard.com/2009/04/macroman-encoding-creeps-into-maven/">Red Leopard</a> &mdash; and it&#8217;s easily fixed by editing the POM to add the correct encoding.</p>
<pre class="brush: xml;">
&lt;properties&gt;
    &lt;confluence.version&gt;3.0.2&lt;/confluence.version&gt;
    &lt;confluence.data.version&gt;3.0&lt;/confluence.data.version&gt;

    &lt;!-- Fix for MacRoman warnings on build --&gt;
    &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
    &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
&lt;/properties&gt;
</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://davidsimpson.me/wp-content/uploads/2010/01/macro-browser1.png"><img src="http://davidsimpson.me/wp-content/uploads/2010/01/macro-browser1-440x270.png" alt="The macro browser icon: What we&#039;re aiming for" title="macro-browser" width="440" height="270" class="size-medium wp-image-521" /></a><p class="wp-caption-text">The macro browser icon: What we're aiming for</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 &mdash; 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 />
<b>Note:</b> 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;">
# 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 &mdash; 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>

<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/davidsimpson?a=JvpM34u5xvU:Fh9tSed14pc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/davidsimpson?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=JvpM34u5xvU:Fh9tSed14pc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/davidsimpson?i=JvpM34u5xvU:Fh9tSed14pc:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=JvpM34u5xvU:Fh9tSed14pc:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/davidsimpson?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=JvpM34u5xvU:Fh9tSed14pc:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/davidsimpson?i=JvpM34u5xvU:Fh9tSed14pc:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=JvpM34u5xvU:Fh9tSed14pc:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/davidsimpson?d=7Q72WNTAKBA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/davidsimpson/~4/JvpM34u5xvU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://davidsimpson.me/2010/01/25/some-thoughts-on-developing-my-first-confluence-plugin/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		<feedburner:origLink>http://davidsimpson.me/2010/01/25/some-thoughts-on-developing-my-first-confluence-plugin/</feedburner:origLink></item>
		<item>
		<title>Announcing: Google Analytics plugin for Confluence</title>
		<link>http://feedproxy.google.com/~r/davidsimpson/~3/3pYnCNp0Pyw/</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 and OS
Browser Version
Screen [...]]]></description>
			<content:encoded><![CDATA[
<p><img src="http://davidsimpson.me/wp-content/uploads/2010/01/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>

<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/davidsimpson?a=3pYnCNp0Pyw:0br1NOAo-bs:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/davidsimpson?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=3pYnCNp0Pyw:0br1NOAo-bs:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/davidsimpson?i=3pYnCNp0Pyw:0br1NOAo-bs:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=3pYnCNp0Pyw:0br1NOAo-bs:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/davidsimpson?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=3pYnCNp0Pyw:0br1NOAo-bs:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/davidsimpson?i=3pYnCNp0Pyw:0br1NOAo-bs:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=3pYnCNp0Pyw:0br1NOAo-bs:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/davidsimpson?d=7Q72WNTAKBA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/davidsimpson/~4/3pYnCNp0Pyw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://davidsimpson.me/2010/01/02/announcing-google-analytics-plugin-for-confluence/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		<feedburner:origLink>http://davidsimpson.me/2010/01/02/announcing-google-analytics-plugin-for-confluence/</feedburner:origLink></item>
		<item>
		<title>Portal UI Design Patterns</title>
		<link>http://feedproxy.google.com/~r/davidsimpson/~3/SwD5Y4Nffgc/</link>
		<comments>http://davidsimpson.me/2009/11/24/portal-ui-design-patterns/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 10:48:06 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[usability]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[luminis]]></category>
		<category><![CDATA[portal]]></category>
		<category><![CDATA[sungardhe]]></category>
		<category><![CDATA[ui patterns]]></category>
		<category><![CDATA[university of nottingham]]></category>
		<category><![CDATA[ux]]></category>

		<guid isPermaLink="false">http://davidsimpson.me/?p=448</guid>
		<description><![CDATA[
Here are the slides from a talk I gave at the European Luminis User Group in Nottingham last week. 
Outlined are some thoughts behind reusable UI elements in the Luminis portal at the University of Nottingham. 
Portal UI Design Patterns


]]></description>
			<content:encoded><![CDATA[
<p>Here are the slides from a talk I gave at the European Luminis User Group in Nottingham last week. </p>
<p>Outlined are some thoughts behind reusable UI elements in the Luminis portal at the University of Nottingham. </p>
<div style="width:425px;text-align:left" id="__ss_2544097"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/dvdsmpsn/portal-ui-design-patterns" title="Portal UI Design Patterns">Portal UI Design Patterns</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=elug-portaluidesignpatternstoshare-091120054329-phpapp02&#038;stripped_title=portal-ui-design-patterns" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=elug-portaluidesignpatternstoshare-091120054329-phpapp02&#038;stripped_title=portal-ui-design-patterns" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
</div>

<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/davidsimpson?a=SwD5Y4Nffgc:JMzONuONbvU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/davidsimpson?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=SwD5Y4Nffgc:JMzONuONbvU:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/davidsimpson?i=SwD5Y4Nffgc:JMzONuONbvU:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=SwD5Y4Nffgc:JMzONuONbvU:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/davidsimpson?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=SwD5Y4Nffgc:JMzONuONbvU:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/davidsimpson?i=SwD5Y4Nffgc:JMzONuONbvU:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/davidsimpson?a=SwD5Y4Nffgc:JMzONuONbvU:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/davidsimpson?d=7Q72WNTAKBA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/davidsimpson/~4/SwD5Y4Nffgc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://davidsimpson.me/2009/11/24/portal-ui-design-patterns/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://davidsimpson.me/2009/11/24/portal-ui-design-patterns/</feedburner:origLink></item>
	</channel>
</rss>
