Google Analytics for WordPress MU – single blog AND sitewide!

February 24, 2009  | 
14 Comments

The bane of many a WPMU site owners life has been the question of how to give your users access to Google Analytics, while being able to use it yourself for sitewide statistics.

Well, we’re about to let you have your cake and eat it too :)

Presenting – Google Analytics for WordPress MU – a plugin that does exactly what you’ve always weanted it to do :)

Essentially it allows you to simply enter your ‘UA’ code into a new field in Site Admin > Options AS WELL AS allowing your users to enter their code in Settings > Google Analytics.

And, they will both work together! Oh frabjous day etc. :)

And if that’s not enough to make you go ‘Callooh! Callay!’ – well, we’ve also integrated this into our ‘Supporter’ framework – so you can restrict access to the individual stats to to paying users only (if you wish). Just visit Site Admin > Supporter once it’s installed to set it to free / paid.

Enjoy the statistical goodness!

google analytics for wordpress mu in action

Featured Plugin - Send beautiful html email newsletters, from WordPress!

Now there's no need to pay for a third party service to sign up, manage and send beautiful email newsletters to your subscriber base - this plugin has got the lot.
Find out more

Featured Plugin - WordPress + Google Maps = Perfect

Simply insert google maps into posts, sidebars and pages - show directions, streetview, provide image overlays and do it all from a simple button and comprehensive widget.
Find out more

Featured Plugin - Turn any WordPress page into a fully featured wiki!

To get a wiki up and running you used to need to install Mediawiki and toil away for days configuring it... not any more! This plugin gives you *all* the functionality you want from a wiki, in WordPress!!!
Find out more

Featured Plugin - Add bottom corner (or anywhere else) chat to your site

No javascript required, no third part chat engine, just fully featured chat right in your own database on your own WP sites - couldn't be easier.
Find out more

Featured Plugin - Start Your Own Powerful Membership Site

If you're thinking about starting a paid, or just private, membership site then this is truly the plugin you've been looking for. Easy to use, massively configurable and ready to go out of the box!
Find out more

Featured Plugin - Every great SEO tweak you need, in one snazzy bundle

Fully integrated with the SEOMoz API, complete with automatic links, sitemaps and SEO optimization of your WordPress setup - this is the only plugin you need to help you rank your site number 1 on Google - nothing else compares.
Find out more

Featured Plugin - Open an Online Store with MarketPress

Out of all the WordPress ecommerce plugins available, this has got to be the winner - easy to configure, powerful functionality, multiple gateways and more. A simply brilliant plugin!
Find out more

Featured Plugin - Start your own Quora / StackOverflow / Yahoo Q&A site

It's now incredibly easy to start your own Q&A site using nothing more than WordPress - The Q&A plugin simply and brilliantly transforms any site, or page, into a perfect support or Q&A environment.
Find out more

Featured Plugin - Host sites, get paid, just like WordPress.com

If you've ever wondered how you could offer a paid site management and hosting service, then this is the plugin for you. Offer a freemium or paid service, for any niche you like, it's powered Edublogs.org to success already!
Find out more

14 Responses to Google Analytics for WordPress MU – single blog AND sitewide!

  1. FANTASTIC! I’ve been thinking of building something like this myself – but the works been done for me! Thanks.

  2. Actualy – i take that back.. paid plugin for a free service :/

    I think i’ll build my own.

  3. No worries, if you don’t want to sign up for a massive timesaver (btw, the fee covers all 50 plugins and themes on the site) then that’s your call, no-ones forcing ya to.

  4. Nice plugin James, we had a go at this and found we couldn’t get both sets of stats working at the same time in MU (that was before the last GA code update).

    Jamie, good luck with your plugin development effort. Just because WPMU might look easy from the outside doesn’t mean it is.

  5. By working :) And supporter integration, general support etc.

  6. by working?… that plugin works quite fine. Been using it for some time on our WPMU install.

    even modified it a bit to pass on subdomain info. to google so the main site analytics aren’t filled relative URLs owned by other sites.

  7. @Kong Can I see how your mods?

  8. I’ll second that Kong :) We’d be happy to chuck you a free 12 month membership for sharing too!

  9. Oh.. sure.. it’s not really hard to do, but here it goes –

    Using the following plugin:
    http://wpmudev.org/project/Google-Analytics-Plugin-For-Wordpress-MU—Revised–English

    …edit rafik_ga.php

    Starting after lines 38, and 53, you will notice the following code:
    var firstTracker = _gat._getTracker(“‘.$site_urchin.’”);

    …insert after that,
    pageTracker._setDomainName(“.your.domain.here.com”);

    …then, after line 67, where it says:
    var firstTracker = _gat._getTracker(“‘.$site_urchin.’”);

    …insert:
    firstTracker._setDomainName(“.your.domain.here.com”);

    Keep the first period before the domain! It’s there on purpose…
    Now, go into Google Analytics, and setup the following ADVANCED filter:
    Filter Type: Custom filter > Advanced
    Field A: Hostname
    Extract A: (.*)
    Field B: Request URI
    Extract B: (.*)
    Output To: Request URI
    Constructor: /$A1$B1

    ..more google documentation can be found at
    http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=55524

    Then, when viewing your google analytics for your WPMU sites, you will get to see traffic for all content with that sites subdomain preceeding it’s page URL. e.g.: instead of seeing content as /2009/02/some-page/, you will see someonesblog.mywpmusite.com/2009/02/some-page/

    ..makes it easy to tell which sub-sites on your WPMU are really popular.

    This, however, will also record hits from your logged in users as well. I plan to add a logic check that will not display the google code if the user is logged in. I do this on other independent WP installs.

  10. …so where do I cash in my free membership :)

  11. Just create an account (remember not to pay) and email me yr details – you’ll be a valuable member of the community too I reckon, we’re looking forward to your perspective on things.

  12. So James, did he won? Or you can’t say because he presented a fine free solution that does the same as your paied solution. I am sorry, but it’s really hard to me see someone get paid because he do things for free plattaformns… and that keep saying how cool is WPMU. oh well, i know.. it’s me that are wrong.

Click on a tab to select how you'd like to leave your comment

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting