WordPress Google Analytics Plugin
This plugin allows you to use the powerful Google Analytics to track your Wordpress stats. It’s easily configurable to:
- Not log anything in the admin area
- Log 404 errors as /404/{url}?referrer={referrer}
- Log searches as /search/{search}?referrer={referrer}
- Log outgoing links as /outgoing/{url}?referrer={referrer}
- Not log any user roles (administrators, editors, authors, etc)
Changelog
- 06/11/2008: 1.2.2
-
- Fixed problem with code affecting Admin Javascript such as the TinyMCE editor
- 06/08/2008: 1.2.1
-
- Bug fix for the stats gathering
- 06/08/2008: 1.2.0
-
- No longer parses outgoing links in the admin section.
- Uses get_footer instead of wp_footer. Too many themes aren’t adding the wp_footer call.
- Options page updated
- Added optional anonymous statistics collection
- 04/23/2008: 1.1.0
-
- Major revamp to work better with the new Google Tracking Code. It seems that outgoing links weren’t being tracked properly.
- 04/17/2008: 1.0.0
-
- Released to wordpress.org repository
- 07/03/2007: Version 0.0.2
-
- Fixed problem with themes that do not call wp_footer(). If you are reading this and you are a theme developer, USE THE HOOKS! That’s what they’re there for!
- Updated how the admin section is handled
Related Posts:
118 Responses to “WordPress Google Analytics Plugin”
Leave a Reply
Pings/Trackbacks
-
[...] Google Analytics: This plugin is crucial to me, perhaps above any of the others I use. I love Google Analytics – it’s so easy to use, and it gives you so much information. However, I sometimes get a little frustrated with it in conjunction with Wordpress. When I decide I want to switch themes, I have to go through and manually paste the tracking code into each appropriate theme file, which can be frustrating, especially when I realize days later that I missed one. Also, since I’m a frequent visitor to my own blog to make a new post or whatever other reason, that can skew the accuracy of the data being presented. I’ve used the filter feature in Analytics before, but I’m not always at the same location when I access my blog, so for me it’s not that effective. The Google Analytics plugin solves both these problems. It automatically inserts the tracking code you provide into all the pages, making sure that no page view is overlooked – except, of course, for the ones you tell it to ignore. It allows you to choose what user levels not to gather tracking data from, so you won’t see all the visits you (or other authors/admins) make to the site, resulting in a more accurate reflection of the visitors to your blog. This is a must-have for any serious Wordpress user. [...]
-
WordPress Google Analytics Plugin…
This plugin allows you to use the powerful Google Analytics to track your Wordpress stats….
-
[...] trójca Google", czyli kolejno: All in One SEO Pack, Google XML Sitemaps oraz WP Google Analytics. Pierwsza z nich wspomaga optymalizację dla wyszukiwarek (nie tylko Google, ale wszyscy wiemy, [...]
-
[...] by W3Counter ก็ต้องมี ID เว็บ W3Counter , Google Analyticator หรือ WP Google Analytics ก็ต้องมี ID ใช้งาน Google Analytics ก่อน ( ID [...]
-
[...] WP Google Analytics 1.0.0 [...]
-
[...] also set up the Google Analtyics Plugin, which sets up some pretty neat tracking features. It’s even supposed to track outgoing [...]
-
[...] also set up the Google Analtyics Plugin, which sets up some pretty neat tracking features. It’s even supposed to track outgoing [...]
-
[...] WP Google Analytics 1.1.0 by Aaron D. Campbell [...]
-
[...] WP Google Analytics: Use Google Analytics to track site statistics [...]
-
[...] I’ve managed to migrate my articles, add Google Syntax Highlighter, Google Sitemap, and Google Analytics along with some simple PHP tweaks to this cool theme over the course of 2 short nights. This entry [...]
-
[...] WordPress Google Analytics Plugin · Xavisys (tags: wordpress google plugin) [...]
-
[...] 5. WP Google Analytics [...]
-
[...] discuss this plugin on the WordPress Google Analytics Plugin [...]
-
[...] discuss this plugin on the WordPress Google Analytics Plugin [...]
-
[...] WP Google Analytics [...]
-
[...] WP Google Analytics : The feature of this plugin is that it lets you add the code through the options and on top of it, [...]
-
[...] 50. WordPress Google Analytics Plugin [...]
-
[...] WP Google Analytics(link) [...]
-
[...] Backup – Again, no need to open anything other than my dashboard to back up my site. Good stuff. WP Google Analytics – A really simple way of getting your Analytics account into WordPress, also allows for [...]
-
[...] WP Google Analytics: assim como o AdSense Manager, simplifica ao extremo o ato de inserir o código do analytics no seu site. [...]
-
[...] kita memiliki blog dengan domain dan hosting sendiri, gunakan saja plugin seperti WP Google Analytics. Cukup praktis dan mudah konfigurasinya. Kita tinggal mengkopikan kode tracking di form yang [...]
-
[...] WP Google Analytics by http://xavisys.com/wordpress-google-analytics-plugin/ [...]
-
[...] Wordpress Google Analytics Plugin is another Google Analytics plugin which you can configure to log 404 errors, searches and outgoing links. [...]
-
[...] the code direct into the theme than you have to change it everytime you can use a wp plugin like WordPress Google Analytics Plugin Xavisys this will help you to have no problem with changing design it seems that there is no tracking [...]
-
[...] Provides an easy way to integrate Google Analytics into your WordPress Blog Download: http://xavisys.com/2007/02/wordpress-google-analytics-plugin/ [...]
-
[...] just set up a new account and get the tracking code pasted on your blog. Thanks to friendly Google Analytic Plug-in, I managed to set the tracking code up successfully. Now I can start tracking my traffic [...]
-
[...] Not as flash as the two plugins before, but can spherically be configured to track stuff like searches (as /search/{search}?referrer={referrer}), not track user roles (administrators, editors, authors, etc) and log anything in the admin areas in Wordpress. » Plugin Home [...]
-
[...] 3.- WordPress Google Analytics Plugin [...]
-
[...] HTML solusi mudahnya adalah memasang plugin WP Google Analytics yang bisa kamu dapatkan disini dan disini. Cara ini cukup mudah karena kita hanya perlu mengaktifkan saja plugin ini dan langsung otomatis [...]
-
[...] In: Wordpress plugins 16 Jun 2009 Go to Source [...]
-
[...] Wordpress Google Analytics: permet d’insérer facilement votre code de suivi fourni par Google et d’enclancher le [...]
-
[...] (4) Now download wordpress plugin from here. [...]
Great idea! I am going to give this a try, thanks.
Hi ! It seems the link to your file is broken.
Where can i download to try it ?
Sorry, the links were broken from when I moved this from xavisys.com/blog to aaron.xavisys.com. They should be fixed now.
I have installed your plug in and entered my Google code in the Options section on wp, but after over an hour I am still being told that Google cannot find the code. Whenever I have used analytics before the code has activated within minutes, am I dong something wrong?
Did you paste the whole code that Google provides? It should look like this:
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
<script type="text/javascript">
_uacct = "UA-XXXXXXX-X";
urchinTracker();
</script>
You should see immediate results, meaning that you should see the Google Analytics code appear in the code of the site. If you don’t, send me the address to the site through the Xavisys contact us form, and I’ll take a look.
As it turns out, the problem Jane was having was with her template, which did not include a wp_footer() call. She fixed her template, but I also made some changes to the plugin. If wp_footer is never called, it will use output buffering to insert the code just before your closing body tag.
super.
I am an idiot at this stuff. I have analytics on my normal site (i did not install it myself, but i use it a lot), and i am trying to get it to work on the blog. Where (exactly) do I paste the code? There are many php pages on the theme editor. Any help would be appreciated.
If you are using this plugin, you don’t need to mess with your theme. Install the plugin, then go into your admin section to settings and “Google Analytics.” Paste the Google supplied code in the box, and set the setting however you want. Click “Update Options”
same problem as Jane .. i pasted the code and no response from Google Analytics .. pls help
thanks!
problem solved .. is was google latency i suppose .. thx anyway!
cheers!
Glad to hear it Andrei!
Aaron, thanks, a breeze to get working in 2.5. Keep up the good work.
installed the plugin, set my options, pasted google code, yet they cant verify. I have tried both the “new tracking code” and the “legacy code”. will the plugin work with the new code? what do you think the issue is?
thanks
never mind, the plugin conflicts with the slideshow on the front page and our galleries. i uninstall ed
thanks
Brian: Sometimes it takes a while for Google to verify that they are receiving data, but if you view the source of a page, you should see the Google Analytics code being added to the page.
The plugin works with both the new and legacy code.
How exactly did it conflict? What did it do? I’ll send an E-Mail to you as well, so you can reply there if you prefer.
Thanks. I do not know how i did not see that. It still does not work though. One question, my blog is located at myurl.com/blog. i already have analytics working on myurl.com. Do i need to register a different tracking address for myurl.com/blog????? Please help.
Ryan
Good Explanation
Ryan: No, you don’t need to register a different key for the same domain. You have checked the source code of a page on your blog to make sure? You should see either the Google code, or something like:
<!-- Google Analytics Plugin is set to ignore your user role -->It hooks into the wp_footer hook, so you’ll need to make sure that your theme includes the proper wp_footer() call in the footer of the page (before the </body>).
Hopefully the last three lines of the footer.php file in your theme look like this:
<?php wp_footer(); ?></body>
</html>
Your Information made me easy
Thanks Aaron this is a great Plugin, just thought i’d post and say the last four lines of my footer looked like this:
Put in the line like so:
and everything appears to be working
oops..
Thanks Aaron this is a great Plugin, just thought i’d post and say the last four lines of my footer looked like this:
Put in the line like so:
and everything appears to be working
Great plugin! An additional feature that I would be interested in would be to be able to block out certain IP address (or even better dynamic dns names) from reporting. That way my statistics won’t be skewed by my own viewing from home or work.
Good work ppl!!
Hi,
Great plug-in! Thanks for sharing!
I face a little problem with it. I have the blog on a dedicated domain (let’s call it http://www.myblueblog.com) and I have headers linking to this domain on a different site (let’s call it http://www.thatothersiteofmine.com). Now when the user clicks the banner on that other site and visits the blog, Google Analytics shows all page views originating from my blog site (www.myblueblog.com) which is wrong. Any idea what might be the cause?
Many-many thanks!
Robbie: Thanks for the idea, I added it to my list of TODOs for this plugin!
Chris: Thanks.
Orange: I’m not sure I followed exactly, maybe you could contact me directly and give me links to the sites in question?
hi aaron,
i installed the plug-in and pasted the analytics code into the options area, but for some reason google analytics is telling me that the tracking code is not verified. i have the whole:
in my footer.php file and i can’t figure out the problem. help! (please)
I had a weird issue, when the google analytics plugin was enabled, tinymce was stuck in html editting mode.
Hi. I’ve read all the posts here.
I wont get it to work. Ive waited, I’ve tried reinstalling everything and installing and wating again. It wont work. The code don’t appear in the template page as you say it would. I currently have my site being built so you cant explore it sorry. I use a theme and everything is up and running. But the plugin wont work.
What do you think the problem could be?
I have like 5 other sites on google analytics.
Installed the Wordpress plugin and it works great after adding the
line before thein the footer.php file.Thank you.
OK…here’s my issue..
I’ve updated the plugin into the most updated version.
I’ve installed, tried both of analytics tracking code and it doesn’t work. The status in my analytics mentioned to be not verified. I don’t understand what’s the problem. I’ve checked the php code of footer.php and the code (footer.php())is there…
The only thing is I’m using others created template and can’t modify the template. there’s some docs at codex explaning about chmod and .htaccess file. I don’t really understand it at all and haven’t try anything yet.
Is there any possibility of this became the main issue why analytics code using this plugin doesn’t work??
Hoping for any enlightment…Thx
Getting an error after updating to v1.2.2:
Warning: include_once(/xxx/public/wp-content/plugins/wp-google-analytics/) [function.include-once]: failed to open stream: Inappropriate ioctl for device in /xxx/public/wp-settings.php on line 357
Warning: include_once() [function.include]: Failed opening ‘/xxx/public/wp-content/plugins/wp-google-analytics/’ for inclusion (include_path=’.:/xxx/apps/php5/lib/php/:/xxx/apps/php/lib/php/’) in /xxx/public/wp-settings.php on line 357
ChuckMcB: It looks like that might be a problem with safe mode (something set up by your host), and as far as I know is not specific to my plugin. Try making sure that the permissions are right on the files, and if you updated using the automatic update option, be careful of using it on other plugins, or you could have the same problems with them.
Hello there everyone, I am completely new at wordpress. I have downloaded and activated your plugin in my wordpress blog. But when i log in to my google analytics account, in the status, google says Tracking code not verified.
Could you please help me on this? I’m a complete beginner.
Thanks in advance
zplits: It can take a little time, I usually give it a day. However, depending on how you have the settings, you will also need to make sure that you visit your blog in such a way that the code it loaded. So, if you ignore admins and you are an admin, you will need to visit the site when not logged in to make the plugin load the Google JavaScript.
I visited the site you linked to, and the code is being inserted correctly, so now just give it a little time.
Hello Aaron, good day.
thank you very much. The script is already running. I really appreciate your help. thank you very much
I suggest that you change the code a bit.
There is a & sign in line 181 and to get valid xhtml code you should change it to
&:$char = (strpos($track['data'], '?') === false)? '?':'&';oh great… this allmost worked…
The change should be & amp;
Hello together,
thanks for that great plugin! Just a short question:
In the Admin Area I did NOT checked ” Log outgoing links as /outgoing/{url}?referrer={referrer}”.
But in Google Analytics I find the following pageviews:
/outgoing/www.ulm.de?referer=http://www.test.de
Is this a bug or do I not understand the function?
Thanks and regards
Howdy,
Love the plugin, just one quick question. No matter how many times I check the “Do not log Administrator|User roles when logged in”, it never stays checked. I really don’t feel like logging myself. Is this something unique to me?
Hi,
thanx for the plugin, but I have problems getting it to work:
in the settings -> google analytics menue I can insert my UA-string but not the whole .js-code. google analytics does not track my site and I really don’t understand where else to put the whole code beause you mentionend one doesn’t have to change anything in the template.
I would appreciate your friendly support.
The whole code goes in that box.
Hi Aaron,
the following is all the only snippet from the code that can be putten in the box where it’s said: Analytics User Account:
+var gaJsH+ (without the +) there is no possibility to add more.
Perhaps I am blind but I can’t figure out another box where to put in the code.
Thx again for your help.
You should see a config page like this: http://xavisys.com/wp-content/uploads/2008/07/google_analytics_plugin-1.png
*banging my head against the next wall*
Aaron, I donwloaded another google analytics plugin and when I tried to get help with installation, the good old google directed me to your site..
I understood suddenly with your screenshot. And of course I switched to your plugin which is in fact really easy to understand and handle
Sorry for not using my brain enough and thx for the great job!
I have installed the plugin. Activated it. It does put the below code onto each page … but it is not being seen by google analytics – google is still telling me “Tracking Not Installed”
note that the script is appearing within a couple of tags – could this be the problem?
i also tried using the site scan on http://www.sitescanga.com/ (very handy tool) … this isn’t “seeing” my google analytics code either
var gaJsHost = ((”https:” == document.location.protocol) ? “https://ssl.” : “http://www.”);
document.write(unescape(”%3Cscript src=’” + gaJsHost + “google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E”));
var pageTracker = _gat._getTracker(”UA-XXXXXXX-X”);
pageTracker._trackPageview();
Karen: It looks to be working fine. It could take 24+ hours (but often is a fraction of that) before Google Analytics starts logging data and shows that the code is working.
Karen: I’m not so sure on that sitecanga.com site either. I just checked xavisys.com and it says that the tracking code isn’t installed, but it definitely is and I’ve been using the stats it creates for quite some time.
It is now working… It took a couple of hours for google to “find” my code. Looking at some of the youtube tutorials on google analytics, this appeared to happen within minutes… I guess that is no longer the case.
Thanks for the excellent plug-in!
I am totaly new in wordpress, I try to aktivate google analitycs plug in but analitycs doesnt recognized him, can you help me?
danko: As I just told Karen “It could take 24+ hours (but often is a fraction of that) before Google Analytics starts logging data and shows that the code is working.” It often takes at LEAST a few hours (depending on how much traffic your site is getting). That is completely normal.
I have installed the plugin but nothing happens. I can’t see de ga.js code in the pages. My footer.php has wp_footer call.
Can you see where is the problem?. Do I have to add permission to files?
http://sitescanga.com/results/17b9ab376abbed4d09bb3820c787f1e7aa
Sorry for my bad english.
Best Regards,
Raul.
Raul: You can’t trust sitescanga, but in your case it’s correct…you don’t have the code on your page. Make sure that the plugin has been uploaded and activated. Then make sure you copy/paste the WHOLE ga.js code from google (look through the comments here for plenty of examples). However, just so you know the plugin no longer uses the wp_footer hook because there were too many themes that didn’t fire the action like they should. It has used get_footer (fired by the get_footer function call) since version 1.2.0.
Hi Aaaron,
I use these theme:
http://cssrockstars.com/blog/free-wordpress-theme-charade/
I have checked the theme and it not call get_footer. I include the call function and now works!!! ^_^
http://sitescanga.com/results/1fa9acf44cdb81980d62dae48b781c8754
Thanks for your support.
Regards,
Raul.
Hi!
It seems that your plugin inserts tracking code (for outgoing links) into rss feeds too.
I think that it is little bit wrong…
Thanks buddy, this is what I needed.
Regards,
Geo
Thanks Dr. X.,
This was the third plugin I tried, and it was the easiest for me to install. I was having a problem with the plugin which wordpress listed. Probably not the plugin as much as the newb user (me).
Cheers,
JamieTeacher
Great plugin, Aaron. Best Google Analytics plugin for Wordpress out there by far.
Any chance you will be able to help resolve the incompatibility between this plugin and the WP-Cache functionality in the WP-Super Cache plugin?
Thanks!
Пока еще полностью непонятно, что там происходит, но точно могу сказать, что это не в лучшую сторону!
where’s the download link??
The plugin posts are being re-worked in our new site design. Please find all the publicly released plugins in my WordPress.org profile.
I’ll try it out. Thanks!
Where do I get my google analytics code from?
how can I get any widget? First , I download and then? thank you.
It's working really great…I have installed this plugin in around 100+ blogs..and Really its working great…thanks Mate…Please do let me know if you launch any plugin..My Email id is hardip.seo@gmail.com…Thanks Mate.:)
This is awesome! thank you for posting this excellent plugin! I have been using stat press for a longtime and I hate it!
Seems to work great! Thanks!
tem em portugues?
Is there a way to view the stats through my WP dashboard or account? Or do I need to login to Google to view stats?
Thanks for this plugin. I used version 1.1.0 for a while, and upgraded to 1.2.3 today. In the new versions however it seems my settings for what not to track aren't stored properly. If I select all but the bottom option and save the settings, only the top one is selected when the form is reloaded.
Using this plugin creates a non-valid feed: See here: http://feedvalidator.org/check.cgi?url=http%3A%2F...
Seems like using the onclick JavaScript function is not allowed in Feeds.
Is there any bugfix yet?
No, but I'll add it to the TODO list.
Hello. And Bye.
Good plugin. Thanx!
The time has come when advertising in some hands has reached the status of a science with google analytics as the math.
A Web site that breaks the old Web usability rules but yet, is successful in terms of attracting and keeping visitors is possible with google website optimizer and analytics.
I downloaded this today, and will post again onc I get it setup! I'm excited to find this script.
Nick
After installing the WP Super Cache plugin a few days ago on all my WP sites to speed them up, I see that it is messing up all my stats by making it look like I have a lot less traffic. I googled this and apparently others are having this stat issue too. I know my traffic is up because my Adsense CTR has been up. Anyway, I'm currently using the Statpress plugin and have a few questions about your Google Analytics plugin please…
1) Will your plugin give me true stats in spite of having WP Super Cache installed?
2) After installing your plugin, can I see my stats within my WP admin area or do I have to login to my Google account?
3) Does your plugin work well with WP 2.7.1?
Thank you very much!
Great plugin, simple to use, works without problems.
Wow, this is what i looking for. Thanks
Thank you for the help! Now the plugin works well.
Hi, Aaron.
Sorry, I jnow you must answered this question a million times but… it’s not working. I installed the plugin right now and, at least on my admin page, nothing happens.
Another thing is about the widget. It also doesn’t goes out of it’s box to the sidebar.
Would you be kind to take a look?
Thanks in advance.
cjt: I looked at the site you linked to, and my Google Analytics plugin isn’t being used. You’re using Google Analyticator: http://plugins.spiralwebconsulting.com/analyticator.html
Also, you mentioned a widget, but this plugin doesn’t have any widgets.
Hi Aaron… ok, sorry – I’m getting hard on plugins
I’m going to unplug Analycator and try it once more.
Thanks for your soon reply!
Regards,
cjt
When I activate Google Analytics on WP, I sometimes find than the “Plugin” Bad Behavior is blocking the Google Analytics verify. When this happens, I either have to deactivate “Bad Behavior” or whitelist the Google Analytics addresses.
I found your blog on google and read a few of your other posts. I just added you to my Google News Reader. Keep up the good work. Look forward to reading more from you in the future.