Tags: Google, Releases, Website, WordPress
Google Analytics Plugin for Wordpress
November 14th, 2005, by Rich.

This is the first beta release of a WordPress plugin that can add Google Analytics to your website without you needing to code one single set of <>’s.
$latest = "0.65";
if ( $_GET['v'] != '' ) {
if ( $_GET['v'] != $latest ) {
echo('
‘);
}
}
?>
I have it running on this site and it seems to be working just fine so far.
Installation instructions
To use it:
- If you have a previous version of the plugin, delete it.
Download this file- Rename the file
googleanalytics.phpand copy it to your/wp-content/pluginsdirectory. - Enable it on the plugins page.
- Enter your Google Analytics User Account string (it’ll be something like UA-12345-6. It appears when you “Add a channel”)
- That’s it.
You don’t need to look alter the code in any way to make it run; of course you’re welcome to improve it and send me any updates for inclusion.
Features
- Zero Coding
A zero coding install enables both the default tracking and the use of different channels for specific posts. - Outgoing links
Track which outgoing links your users click on - i.e. the ones that don’t traditionally register in your logs. Separate tracking streams for outbound links that are in the main article, comments, and comment author URL’s
- Multiple Channels
Assign a specific channel to any article by entering the channel ID as metadata. i.e. simply type “analytics” as the metadata field name and the channel ID as the value and you can run a channel for each specific post
Requested Features
- Filtering the Sidebar
WordPress provides hooks for filtering articles and comments, but not for filtering the sidebar and footer. Since the sidebar often includes the blogroll there are page-exit clicks that cannot be tracked. If anyoen has a clean solution to filtering the sidebar then please speak up! - 100% Point’n'Click UI
I’ve asked on the forums to see if there’s away to automate the retrieval of the account id, so hopefully the plugin can become a configuration free install.
Assign a different channel ID to each category.
Versions
A historical list of releases.
Contribute
Please neatly tuck any feedback, comments, suggestions & requests onto the forum!


November 15th, 2005 at 12:40 am
You have a bug on line 79:
echo(”_uacct = “$uadtring”;\n”);
should be:
echo(”_uacct = “$uastring”;\n”);
November 15th, 2005 at 12:41 am
Version 0.30 adds rudimentary support for tracking exit pages (described here). For any link that the user selects which is in a different domain to the source blog, a record of /outgoing/hostname is stored.
November 15th, 2005 at 12:46 am
Thanks Troy. Version 0.31 which fixes that is now the latest version.
November 15th, 2005 at 4:22 am
Thanks for the quick updates on this!
November 15th, 2005 at 4:40 am
could you elaborate re: exit page tracking? how rudimentary is it?
November 15th, 2005 at 4:54 am
Ah… I see. Outbound link tracking is enabled for links appearing within the loop, but not the sidebar, for example. I’ll be looking forward to an update that adds support for that, as I’m sure will others. It’ll be interesting to see how one’s blogroll is directing traffic.
November 15th, 2005 at 5:18 am
It seems like we both wrote almost identical plugins at the same time, lol. I had finished writing my Google Analyticator around 4pm. What time did you finish yours, because our code is almost identical.
November 15th, 2005 at 8:23 am
Hi C - a great idea re the blogroll - I’ll look into enabling it for the whole page.
Cavemonkey, yo, yeah, your’s is the 5th plugin I’m now aware of! I think we ought to get at least one of them into SVN and centralise efforts!
November 15th, 2005 at 2:09 pm
Hi
I’ve tried to install and configure your plugin, but when I’m trying to validate the setup on Google’s page it says that it can’t detect the tracking code.
November 15th, 2005 at 2:11 pm
Hi Dado, I’ll need a little more information to begin with. What’s the URL of the blog where you’re installing the plugin? I’m guessing it’s the one in your email address since that site does indeed have the tracking code present, with the UA number of UA-119977-1. So my next question is, can you confirm that 119977 is correct? The codes I’ve seen so far have only had 5 digits in the middle section (but then, Google have been very busy so this may have increased massively. From what I can see so far it looks like it’s working properly, so it may be a case of sit and wait whilst Google catches up with you.