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!

    313 Responses to “Google Analytics Plugin for Wordpress”

    Pages: «1101112131415161718192032»

    1. 141
      Trackback from: Ian Chan: Faculty Page » Blog Archive » useful Wordpress plugins 2
    2. 142
      Iheartpgh Says:

      I have installed the plug-in, it says it has the tracking code installed but when I log in to google analytics there are no statistics tracked. whats up?

    3. 143
      Jean Says:

      Why do I get
      Warning: Cannot modify header information - headers already sent by (output started at /home/opmr/public_html/wp-admin/admin-header.php:16) in /home/opmr/public_html/wp-includes/functions.php on line 2448

      What can be the reason for that? Tried to find the answers in the post but no luck…

      Thanks!

    4. 144
      Rich Says:

      Hi Jean. It usually means there’s a space after the “?>” at the end of the plugin code, or in something else that you’ve edited. For example, see the codex.

    5. 145
      gslin Says:

      First, thanks for this nice plugin :)

      When the user install Adblock and block Google Analytics, the original code will cause Javascript error:

      echo("urchinTracker();\n");

      Just check if it has been loaded:

      echo("if (window.urchinTracker) urchinTracker();\n");

    6. 146
      Trackback from: lbcd78 » Premier bilan des plugins Wordpress utilisés actuellement sur ce blog
    7. 147
      Trackback from: Plugin ~最初に入れたプラグイン « Etranger than Paradise
    8. 148
      Trackback from: WordPressץ饰ѤƤΡ » TMJ style Blog
    9. 149
      Mathieu Says:

      Hi -

      First Excuse my poor english , i ‘m french.

      Thank you for this excellent plugin , but in my blog google analytics don’t detect my code …

      however installation is really easy .. i don’t understand the problem. Can you help me ?

      Thanks you for your help :) And sorry for my mistakes :x

      Amicalement.

    10. 150
      rdg Says:

      I have the same problem as Mathieu

    Pages: «1101112131415161718192032»