Month: May 2010

Website Analytics Introduction

With the powerful and free solutions available you would have to be crazy not to use website analytics. However for most people analysing the data means little more than viewing the visitor count and informing potential advertisers of the figure.

Used correctly analytics can be much more useful as an error checker, a marketing tool, a usability tool, and an ecommerce tracker. Lets examine some basic ways of getting more out of your analytics.

There are a lot of analytics packages, – personally I find the offering from Google to provide everything necessary. Google Analytics

Bounce Rate
Bounce rate is the number of people who after arriving at your site dont look at another page and leave straight away. This statistic is generally represented as a percentage of your total visitor count.

Make no mistake, bounce rate is very important. A high bounce rate can be an indicator of serious problems with your site. It could be the that your calls to action that are ineffective at engaging your visitors, or worse that your content is lacking.

Common causes of high bounce rates can be:

  • Site errors and broken links
  • Non-engaging content
  • Poorly placed calls to action
  • Poorly targeted advertisments

Conversely a low bounce rate can often illustrate a site that has engaging content that people want to read more of as well as effective ways to draw people in further. For example related content lists or invitations to try a product.

A 30% bounce rate is a good figure to use as a rough guide, whereas over 50% shows room for improvement.

It is important to realise that acceptable bounce rates differ for some types of websites. Blogs often have high bounce rates because people often click through from RSS feeds and tweets to read only that single web page. 60% could be considered a good figure for a site like this, and anywhere from 70% – 80% is ok. Over 80% could be cause for concern.

eCommerce sites are an example of sites that benefit from low bounce rates. They can draw people into investigating other products, reading more content on the site, and potentially making more purchases. Amazon is very good with their suggested items at doing this.

Conversion Rate
The conversion rate is the number of people who fulfill your goal. For an eCommerce site this is generally a completed checkout, for websites that require you to register (Twitter for example) it is completing the sign up form and for a business site it could be a completed enquiry form.

Conversion rate is another percentage, – the amount of people visiting your site that are carrying out the actions you want of them.

If you have a clear path to your goal (e.g. a certain process of clicks), set up a funnel to see where people are falling off. Where are they dropping shopping baskets, and where are they encountering errors on web forms? Overly complex forms are often a barrier to goal completion.

If you do not have a single set path, comparing where people come from to get to your goal pages can be valuable. If people arrive from one page but not another then compare both pages and contrast their differences.

Conversion rates are often surprisingly low; 3% is good conversion rate for completing a transaction on an eCommerce site.

Once you have established why people are or arent completing your goals and have fixed your issues and calls to action, then is time to look at where people are going after converting. Are they staying on your site or exiting? If they are exiting, then perhaps you are missing opportunity to upsell.

Percentage of visitors viewing target pages
Tracking target pages is similar to tracking conversions however these stats offer different values.

For example consider a conversion page being a completed checkout page.

Target pages could be an information page for a business site, or an individual post for a blog.

In most cases pages such as these are the first steps towards goal completion. Viewing a product is generally required prior to completing a checkout and viewing a business service is the first step to getting in touch to ask about that service.

It starts to become clear where a strongly defined funnel can really help to benefit your analytics. If people are getting to these information pages and not completeing a conversion, consider where they are getting lost.

Examine searches and post search actions
Tracking site search is something very few people tend to do, overlooking a valuable resource for finding out what your visitors actually want.

To illustrate if the search results revealed people searching for an item that was not stocked it would make sense to start stocking that item or offer substitutes.

Post search actions can have two results

The search reveals the item

The user goes to the relevant page and remains on your site.
The user doesnt go to the relevant page, revealing a problem with the search results. It may not be returning the results it should be, or perhaps the search results are not displayed in a way the visitor can understand.

The search does not reveal the item
Do not let these visitors leave if possible
The “Did you mean” search suggestions on sites like Amazon and Google are great examples of turning a negative into a positive with search results by offering alternatives to keep your users from leaving.

Site search reveals what your visitors want, – without it even being necessary to ask!

Embedding Google Maps in WordPress

Wordpress Logo

According to the support on the WordPress site here embedding GoogleMaps in WordPress is simply a matter of cutting and pasting the Iframe to your post. Simple! Effective? Not so much!

The problem is that if you use the Visual instead of the HTML Post or Page editors the code can get very messed up which is frustrating to say the least. So, a simple and elegant solution:

In your functions.php or custom_functions.php file (for your relevant theme of course) place the following code

//GoogleMaps Shortcode
function googleMaps($attribs, $content = null) {
"width" => '640',
"height" => '480',
"src" => ''
), $attribs));
return '<iframe width="''.$width.''" height="'.$height.'" scrolling="no" frameborder="0" marginwidth="0" marginheight="0" src="'.$src.'&output=embed"></iframe>';
add_shortcode("googlemap", "googleMaps");

Usage within a Page or Post
[googlemap width="200" height="200" src="YOUR_URL_HERE"]

So there are three parameters for our custom shortcode: width and height are optional – if you do not specify the size will default to that specified in the functions.php file. The URL is simply the GoogleMaps share URL.

Update 25/09/2012 – Clarified a few typos where WordPress has messed with the character encoding.

SEO Keywords and Tags

We had a client today with a triple figure for keywords. Guess what? Less can be more!

A few tips on selecting relevant keywords:

  • neither too general, nor too specific
  • in common usage
  • relevant to the site in question

General keywords will be competing against millions of other search results, while becoming too specific will attract better searches, – there will be less of them. Finding the balance is our goal here.

People tend to search in two to four word phrases, (single word searches are very uncommon) so make your keywords realistic.

Keyword placement

Dont limit yourself to the document body text, remember:

  • headline text (H1, H2, etc)
  • header tags: title, meta
  • HTML comments
  • URLs and links
  • image ALT tags

This barely scratches the surface of this subject, – what else can you add to it?

WordPress ‘hacks’

Wordpress Logo

Been doing a bit of WordPress customisation work recently, – here are a few ways to delve into your content. There are plugins available for a lot of these techniques; however sometimes you may wish to trim your plugins for speed or other considerations. Enjoy.

1) Displaying Related Posts
Related posts can retain your readers by offering them easy to click, context related links. To execute this ‘hack’ you will need to edit your single.php file (in your current theme)

//Place in the loop to list 5 posts related to the first tag in the current post
$tags = wp_get_post_tags($post->ID);
if ($tags) {
echo 'Related Posts';
$first_tag = $tags[0]->term_id;
'tag__in' => array($first_tag),
'post__not_in' => array($post->ID),
'showposts'=>5, 'caller_get_posts'=>1
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
<?php endwhile;

2) Displaying Recent Comments
Recent comments can be very helpful to build awareness of what topics readers are finding value in. To display recent comments you will need to modify your functions.php file (in your current theme)
If this file is not present, you will need to create it.

function recent_comments($src_count=10, $src_length=60, $pre_HTML='<ul>', $post_HTML='') {
global $wpdb;
$sql = "SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_date_gmt, comment_approved, comment_type,
SUBSTRING(comment_content,1,$src_length) AS com_excerpt FROM $wpdb->comments LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID) WHERE comment_approved = '1' AND comment_type = '' AND post_password = '' ORDER BY comment_date_gmt DESC
LIMIT $src_count";
$comments = $wpdb->get_results($sql);
$output = $pre_HTML;
foreach ($comments as $comment) {
$output .= "<li><a href=\"" . get_permalink($comment->ID) . "#comment-" . $comment->comment_ID . "\" title=\"on " . $comment->post_title . "\">" . strip_tags($comment->com_excerpt) ."...</a></li>";
$output .= $post_HTML;
echo $output;

Wherever you would like to place comments simply include the following line:
<?php recent_comments(); ?>

3) Adding A Print Button To Blog Posts
Of course there are keyboard shortcuts and other ways to perform this task, but it is nice little feature to offer.
Edit your single.php file (in your current theme) and add the following code:

<a href="javascript:window.print()" rel="nofollow">Print this Article</a>

4) Excluding Categories From Your RSS Feed
Perhaps your have a category which has little to do with the rest of your blog, – sometimes it can be useful to exclude certain categories from your feed. Simple.

You will need to know the Category ID (cat_id= seen in your URLs)

Edit your function.php file (for your current theme, or create one if it doesnt exist)

function myFilter($query) {
if ($query->is_feed) {
$query->set('cat','-5'); //Don't forget to change the category ID =^o^=
return $query;


Everything about UTF-8

Filed under PHP, but obviously much more than that.

In an update to this post, it is time for a revisit of UTF-8.

In a post entitled “Everything you always wanted to know about UTF-8 (but never dared to ask)” the good folk at the iBuildings TechPortal have Juliette Reinders Folmer speak on a variety of topics.

“…In this talk I will cover UTF-8 from basic linguistics, through client-side aspects to all the steps you need to take to tackle the most common (and some more obscure) issues when using UTF-8 in a database driven PHP application…”

Check it out here.