16
May
2009
27
Extend Google Analytics with jQuery
For quite some time now Google Analytics has been leading the way when it comes to gathering free statistics about the web traffic of your website. I’m sure that you many of you have installed the Google code on your sites and are already using the great reporting tools it provides. However, there are a few limitations to the standard service which you may or may not have come across yet. Using the standard code, we can only track views of pages where the tracking code is installed. It becomes a little bit more difficult if we want to track file downloads and external links, where we cannot add the Google JavaScript.
The aim of this tutorial is to show you how you can modify the standard Google tracking code using the power of jQuery to get extra information from your Google Analytics reports. With jQuery, we can get Google Analytics track your file downloads and clicks to external sites without having to trawl through your code and write any extra mark up.
We are also going to use a new feature of Google Analytics which are known as ‘Events’. This should give you a good base for you to build your own code and extend the power of Google Analytics even more.
12
Apr
2009
4
Under used HTML tags
The current specification of HTML has been around for nearly 10 years now and us web developers all use this fundamental language on a daily basis. However, due to our busy schedules, there are a few HTML tags that tend to get either neglected or used in the wrong way.
I’m going to list a few of the more important tags here with some examples of their use. Hopefully this article will provide you with some guidance to why we should use them.
1. <address>
As the name suggests, the <address> tag is used to display contact details of the author of a web page. This means that you can standardised the format of either yours or your users contact details to make them easily identifiable.
The important thing to note is that the <address> tag is not limited to just a postal address, but you can include any contact details, such as a name, email, phone number, URL, etc.
For example:
<address>
Written by: Ian Harris<br />
Email: <a href="mailto:info@example.com">info@example.com</a><br />
Phone: 01234 567 890
</address>
Although the <address>tag should be used where possible, that is a better alternative in the form of microformats. Take a look at the hCard Microformats wiki page for more information.
26
Mar
2009
0
5 Simple but useful JavaScript snippits
JavaScript can be employed on your website to perform an whole multitude of simple, but quite effective, tasks that make your job as a web developer that little bit easier. Over time, we have compiled a library of these little JavaScript snippets and we have listed a few of our favourites here.
1. ‘Previous Page’ link
This snippet will take the user back to the previous page that they have viewed. Pretty much like the standard browser back button really:
<a href="javascript:history.back(1)">Previous Page</a>
21
Mar
2009
7
UK Postal Counties List
On a recent project, we were required to create a drop down list to display the UK’s counties as part of a web form collecting users addresses. We assumed that this would be a pretty standard task and that there would be an abundance of pre-configured lists available on the Internet for download. After about an hour of research, it became clear that it was not going to be that simple. All of the lists we unearthed were either incomplete or out of date and it seems that we were not the first developers to run into this trouble.
You can see how it is easy to get it wrong though, take a look at the Wikipedia list of UK counties. The list of counties has changed quite considerably over time, especially in Wales.
18
Mar
2009
41
Create an RSS feed with PHP
Having an RSS feed on your website is a great way of sharing your content with the rest of the Internet. It’s not a new technology and it’s probably something that you use on a daily basis. If you have a blog or use any form of CMS, that software will most likely handle the creation of your RSS feed for you.
Sometimes, however, it might be necessary for you to create a RSS feed yourself. Perhaps you have just won a new client who’s current site has a old bespoke CMS which they like and want to keep, but you want to be able to publish their updated content via RSS. Hopefully this tutorial will help you to achieve this.
What is RSS?
RSS, in its current form, stands for Really Simple Syndication and is a family of web formats to publish frequently updated content. The RSS Feed (as it is commonly known) can then be read by the users feed reading software or by another website which wishes to ’syndicate’ the content of that feed.
