Google Analytics for WordPress gets a debug mode

With the wider introduction of the ga_debug.js script (Google Analytics Certified Partners had had access to that for a while so I’d been using it already); I finally had the chance to add a real debug mode to my Google Analytics plugin.

Since the debug script uses the console to display its information, I also added the option to immediately load Firebug lite. See how it works in the following screencast (ow and enjoy my new screencast intro, I’ll be doing loads more screencast in the coming months):

Tags: , runs on the Genesis Framework

Genesis theme frameworkThe Genesis Framework empowers you to quickly and easily build incredible websites with WordPress. Whether you're a novice or advanced developer, Genesis provides you with the secure and search-engine-optimized foundation that takes WordPress to places you never thought it could go.

Read our Genesis review or get Genesis now!

28 Responses

  1. AndrewBy Andrew on 26 August, 2010

    Hi Joost,

    Thanks for the update, but why have you started using apostrophes so widely? Get’s instead of Gets?

    Your post yesterday was edited by the time I got to the site and I think this is the third in a row that you have had to change.

    Are you farming out your blog posts?

    I am not being picky, it’s just that your English is usually so flawless that it really hits me when I see you repeating this error.

    • Joost de ValkBy Joost de Valk on 26 August, 2010

      Fixed, thanks, my english is failing me and yes I’m typing my posts faster than usually ;) Just a lot to do and a lot to say :)

  2. EdBy Ed on 26 August, 2010

    Nice work. Thanks Joost.

    Might we expect screencasts in a format other than Flash in the future?

    • Joost de ValkBy Joost de Valk on 26 August, 2010

      Yeah I’ll add a download link, there’s a .mov out there as well, and I’ll try to do iPhone versions too.

  3. cameronBy cameron on 26 August, 2010

    Help. I set up GA with Google and got one user id and then with your plugin, just to be sure.
    I installed the id in the header of each post, per your instructions.
    GA now says I have a different id than the one they originally gave me, and they say it should
    be installed once on in the theme footer.php, not the header of each post. I’ve been getting
    wildly divergent stats for Google Analytics and WordPress stats. If I have GA set up separately,
    should I uninstall your plugin? Many thanks.

    • Joost de ValkBy Joost de Valk on 26 August, 2010

      Which site? This is the asynchronous tracking code, and yes that should go in the header, not anywhere else. And installing GA separately is useless :) Just use this plugin, the video explains why: Google Analytics for WordPress.

  4. Eyal SelaBy Eyal Sela on 27 August, 2010

    I think Google’s new plugin – Google Analytics Tracking Code Debugger – Google Chrome extension gallery has the same functionality

    • Joost de ValkBy Joost de Valk on 29 August, 2010

      It has, but well, not everybody uses Chrome ;)

  5. cameronBy cameron on 27 August, 2010

    Thanks! Any chance you can take a look at the code for my site and tell me if it looks ok?

    If I already have
    an installed GA account with Google, will it mess up if I also install GA for WordPress?

    Since I couldn’t locate the ‘header’ for the theme that I’m using, Atachualpa, i pasted the code
    on each post and page at the top. The theme gives an HTML and a Visual option for posting,
    but does not show the HTML. So I can only assume that I’m pasting the GA snippet correctly.

    Can’t thank you enough for your time.

  6. Michael VisserBy Michael Visser on 28 August, 2010

    Hi Joost,

    I added several lines to get e-Commerce Tracking working with WP e-Commerce; they are below for line #1145.

    $sessionid = $_GET['sessionid'];
    $cart_log_id = $wpdb->get_var( "SELECT `id` FROM `" . WPSC_TABLE_PURCHASE_LOGS . "` WHERE `sessionid`= " . $sessionid . " LIMIT 1" );

  7. PaulBy Paul on 30 August, 2010

    I have one hint for you: Can you change in your plugin display_name into user_login? If two users have the same Display Name in frontend, the are tracked as one. The user_login (username) instead is unique and can be taken.

    Hope you understand me :)

    • Joost de ValkBy Joost de Valk on 30 August, 2010

      hmm good idea but that would have to be an extra option, let me think about it.

  8. cameronBy cameron on 30 August, 2010

    where do I find the GA results? GA for WP has been installed and activated. What next?

  9. rajeeBy rajee on 4 September, 2010

    should I enable debug the mode for firefox in your Google Analytics for WordPress plugin. I used your plugin for Google Analytics for WordPress in my blog, It doesn’t show up Pls help

    • Joost de ValkBy Joost de Valk on 4 September, 2010

      It’s showing up just fine, might be that it’s hidden for you because you’re logged in? But even in that case you should see a message to that effect.

      • Joost de ValkBy Joost de Valk on 4 September, 2010

        You do have the tracking code three times now though, once added by my plugin, once through the theme (I guess…) and once through Ultimate Google Analytics. I’d get rid of the last two :)

  10. rajeeBy rajee on 4 September, 2010

    Thanks for your response. I don’t know how it will show up. Do you have sample website that is used
    your plugin to show up. Do you want me to get the rid of the last two? If yes, then please help how
    to get rid of the last two. I don’t know whether it’s worth to have the last two.

    Where can I find WordPress 4.0.9 version to download?

    • Joost de ValkBy Joost de Valk on 4 September, 2010

      Maybe you should just hire someone to do this for you :)

  11. rajeeBy rajee on 4 September, 2010

    I like to learn. I couldn’t find the latest version of wordpress. If I know, then I can do it now itself.
    Can you please help?

    • Joost de ValkBy Joost de Valk on 4 September, 2010

      Well I like helping, but unfortunately lack the time to do that for everyone… You might ask for support in the WordPress support forums, there are people there who’d be glad to help.

  12. rednimerBy rednimer on 10 September, 2010

    Hi Joost,

    Great plugin. You have done a lot of work to it, and always quick to fixt things, which is great.

    Anyway, I am trying to use the plugin and also track search traffic from google images. I found some standalone analytics code that is supposed to work pretty well, like this

    try {
    var pageTracker = _gat._getTracker("UA-123456-78");
    var ref = document.referrer;
    if ( != -1 && != -1) {
    var regex = new RegExp("[^\/]+).*&prev=([^&]+)");
    var match = regex.exec(ref);
    pageTracker._addOrganic(""+ match[1],"q");
    pageTracker._setReferrerOverride("" + match[1] + unescape(match[2]));
    } catch(err) {}

    But I really like using the plugin. Is there a way to track the google image traffic while using your plugin.



  13. dekanBy dekan on 23 September, 2010

    please help me. this is error:
    Fatal error: Call to undefined method WP_Error::get_items() in on line 196

    could you help me?

  14. KellyBy Kelly on 23 September, 2010

    Hello Joost,

    I was recommended your plugin from a developer friend and after checking it up I was impressed with all the great features it offers.

    I installed it and after I authenticated with Google and then click the updatebutton I got the following error:

    Fatal error: Call to undefined method WP_Error::get_items() in /homepages/29/d239170245/htdocs/wp-content/plugins/google-analytics-for-wordpress/yst_plugin_tools.php on line 196

    The plugin version is 4.0.9. I am using WP 3.0.1 with Thesis theme version 1.8.

    Thanks for your help!



  1. [...] Yoast: Google Analytics for WordPress get’s a debug mode – Yoast ( Bookmark It Hide Sites $$('div.d399').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); [...]