ArticlesForumDownload AboutContact

boakes.org

nice of you to drop by. tea?

Tags: Google, Releases, Website, WordPress

Google Analytics Plugin for Wordpress

November 14th, 2005, by Rich.

Google Analytics Plugin for Wordpress

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('

You appear to be using an older version of the plugin. You may wish to download the latest version.

‘);
}
}
?>

I have it running on this site and it seems to be working just fine so far.

Installation instructions

To use it:

  1. If you have a previous version of the plugin, delete it.
  2. Download this fileDownload this file
  3. Rename the file googleanalytics.php and copy it to your /wp-content/plugins directory.
  4. Enable it on the plugins page.
  5. Enter your Google Analytics User Account string (it’ll be something like UA-12345-6. It appears when you “Add a channel”)
  6. 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
    A graph showing clicks on outbound links - something not possible with stats based on server logs alone
  • 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.
  • Per Category Channels
    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!

    308 Responses to “Google Analytics Plugin for Wordpress”

    Pages: «123456789101131»

    1. 21
      Kevin Says:

      Rich,

      I am getting the same error as Joe. The only copy of the PHP file I have resides in the plugins directory.

    2. 22
      dhchen Says:

      Hello Rich,

      I have the same bug with Joe:

      Fatal error: Cannot redeclare analytics_config_page() (previously declared in /…/wp-content/plugins/googleanalytics.php:30) in /…/wp-content/plugins/googleanalytics.php on line 33

      I checked the plugin dir and there is only one copy of googleanalytics.php. Is this problem related to php version? I’m using php5.

      Thanks for your great work!

    3. 23
      Trackback from: maTT cHEn {dot} info » Blog Archive » Google Analytics
    4. 24
      Rich Says:

      dhchen, Kevin, Mike & Joe,

      Thanks for your feedback! dhchen mentions PHP5, and having looked around the issue it appears that others have had similar problems.

      So, I’m going to assume it’s a PHP5 issue and attack it from that angle. Watch this space :)

    5. 25
      Trackback from: Fogelmania » Google Analytics - No More lies
    6. 26
      Rich Says:

      Release 0.50

      Download it!

      I’ve re-written the method defintions and filters in the plugin to be more defensive than they previously were, which means it should now play nicely with PHP5 based installations.

      Hopefully this will solve the “Cannot redeclare analytics_config_page()” errors - RSVP!

      I’ve also added a few words to the instructions to make the activation provess more obvious, and included a little feedback message to give warm feelings when a User Account number has been entered.

    7. 27
      Niklas Says:

      Hey there!

      Thanks a lot for this plug-in! It works wonderfully on my site.

    8. 28
      Trackback from: La mate por un yogur » Plugins de WordPress para Google Analytics
    9. 29
      Joe Foote Says:

      Rich, version 0.50 works perfectly. I’ve given your plugin a brief writeup at http://www.joefoote.com/blogs/google-analytics-is-now-lurking

      Thanks!

      Joe
      http://www.joefoote.com

    10. 30
      Trackback from: Clint’s TiddlyWiki Thoughts » Nifty Wordpress Plugins

    Pages: «123456789101131»