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: «12345678910111232»

    1. 61
      Trackback from: Se till vänster, där går en arab
    2. 62
      Chris Says:

      Hello and thanks for making this plug-in.

      I don’t know where to enter the google channel code and I get the following error at this url:

      http://www.nationofimmigrators.com/wp-content/plugins/googleanalytics.php

      =================

      Fatal error: Call to undefined function: get_option() in /home/dotfusi0/public_html/nationofimmigrators/wp-content/plugins/googleanalytics.php on line 259

      =================

    3. 63
      Rich Says:

      Hi Chris, the output you describe is what you’d see if you tried loading the plugin as a standard PHP page. Plugins don’t work like normal pages - they just provide capabilities to wordpress so you (999 times out of 1000) don’t need to load the file directly as you’re trying to do.

      Go into the admin interface (where you normally write articles) and look for the Plugins tab, under that is a Google Analytics tab, like this:
      Configuring the Google Analytics Plugin for Wordpress

      That’s where you have to enter the magic number.

      If you have any more questions, let me know, but hopefully that should be enough of a leg-up.

    4. 64
      Chris Says:

      Hello there,

      Thank you very much for your response but this is what I see:
      A 1.5-Beta Wordpress Admin Page

      Thank you.

    5. 65
      Rich Says:

      Hi Chris, that certainly doesn’t look right!

      The good news is that I can immediately see something that may be causing your trouble: the version string reads “1.5-beta-1 2005-01-01″.

      Yes, it really is over 12 months old, and beta level code, so it’s not bug free. You are strongly urged to upgrade to the newer codebase, or at the very least to a release version of the code.

      I’m guessing that will fix your problem, and if it doesn’t, at least we’ll be on a more level playing field for me to hypothesize about.

    6. 66
      Steve McNally Says:

      It seems to be working fine (the urchin code’s there; will be a day or so before I see results at analytics.google.com). Thanks for the simple way to get analytics code onto my site.

      S

    7. 67
      dede Says:

      could you elaborate re: exit page tracking? how rudimentary is it?

    8. 68
      Rich Says:

      Hi dede, sure. Currently four types of content are filtered so that they have their outgoing links tracked, they are:

      1. the post content (the articles you write)
      2. the post excerpt
      3. the comment text (the things others write) and
      4. the comment author’s url

      What’s not translated at the moment (because there are no filter hooks for the plugin to use - so if anyone knows a neat way to achieve this, let me know) is the header, the footer and the sidebar.

    9. 69
      Trackback from: Google Analytics e i link verso il mondo -- Fucinaweb - Idee per forgiare siti
    10. 70
      Trackback from: From the Mind of Paul » Blog Archive » Wordpress fun…

    Pages: «12345678910111232»