BIGSHOT Google Analytics Plugin for Joomla! 1.5
Written by Kenneth Crowder   
Monday, 06 October 2008 09:19

One day while adding Google Analytics code to a site, I thought to myself, "There has to be an easier way". Yes, I know that adding the Tracker Code to a template is easy, but still, I knew that it could be automated a little. So, I did what any good Joomla! citizen would do. I checked the extensions site. While there, I found a couple modules that would insert the Tracker Code, but a module is not the ideal way to go about it. In fact, I would go so far as to say that it is a bad way to do it. What I needed was a Plugin. To my surprise, there was not one. So, I wrote my own.

Did I mention that it is free?

I will not be so bold as to say that I am the first person to write a Joomla! 1.5 Plugin that performs this action, however I will say that I am the first to release it as GPL on the Joomla! Extensions site.

The extension is called "BIGSHOT Google Analytics". Very original, I know.

The Plugin is a System Plugin that searches your page for "</body>" and adds the code right above it, just like Google recommends.

Let's take a look at the Plugin, shall we?

Once you have installed the Plugin, navigate to: "Extensions" -> "Plugin Manager". This is a System Plugin, so it is probably towards the bottom of the list (or on page 2). Once you click on "System - BIGSHOT Google Analytics", you will see the following screen:

This Plugin is so simple, all it asks for is the "Web Property ID".

Web Property ID is the Google Analytics Web Property ID. It should be in the format of: "UA-XXXXXXX-X".

Once BIGSHOT Google Analytics is Enabled and your have filled out "Web Property ID", it will start adding the Google Analytics Tracking Code to your site.

Want to try this Plugin for yourself? Download "BIGSHOT Google Analytics"!

Download BIGSHOT Google Analytics

Update: 1.5.3

  • Against my better judgement, plugin is now PHP4 compatible.
  • Slight performance boost (although no one will notice)

Update: 1.5.2

  • Updated to Google's new and improved Analytics code that now includes a try-catch block.
  • Better handling when website is in a subdirectory.
  • $params issue on some servers fixed. (Special thanks to Rob Valk for providing an environment to reproduce this issue)

Update: 1.5.1

  • Plugin will no longer run in the administrator.
  • Plugin will no longer run on index2.php.

 

Kenneth Crowder has been involved in the Joomla! Community since the days of Mambo. He has volunteered many hours to help out the Open Source Project. He is considered an expert in all things related to Joomla!. He was a Technical Reviewer for Joomla! A Users Guide, as well as another book currently in the editing phase. Learn more about Ken.

Trackback(0)
Comments (72)add comment

Jake said:

Hello,

Well done. I haven't implemented it yet, but I'm excited to see a plugin.

Cheers and thanks,

Jake

 
report abuse
vote down
vote up
October 06, 2008
Votes: +5

Mike said:

Thanks for doing this, i have always wanted to use Google Analytics, but I am not a code money and could never get it to work. So far this is working perfect!
Thanks Again!
smilies/grin.gif
 
report abuse
vote down
vote up
October 06, 2008
Votes: -1

Jason Hull said:

Had a customer request for this today... checked JED and behold a new plugin that fit my needs! Trying it out now. Thanks for being a contribution.
 
report abuse
vote down
vote up
October 06, 2008 | url
Votes: +1

Techwild said:

Kick Butt! I was waiting for someone to make a plug-in for Google Analytics. You are the man. I had been using a module version. It wouldn't work on the last site I made. That drove me to look for a different solution. Found yours and it works great. Thanks for adding it to the extensions page!
 
report abuse
vote down
vote up
October 06, 2008
Votes: +5

humza said:

hi,
with CB 1.2 there is an ajax username availability checker... as soon as you enter the username and press tab, it turns the screen blank and starts contacting analytics site for some reason smilies/cry.gif

disable the plugin and it is back to normal ??

[Please try the latest version of this Plugin. It should address that issue - Kenneth Crowder]
 
report abuse
vote down
vote up
October 11, 2008
Votes: +2

Ryan Jin said:

Thank you!
gread plugin
 
report abuse
vote down
vote up
October 13, 2008 | url
Votes: +1

hagia sophia said:

Very usefull
 
report abuse
vote down
vote up
October 14, 2008 | url
Votes: +2

MasviL said:

Kenneth, you are the man!

Thanx for effort.
 
report abuse
vote down
vote up
October 24, 2008
Votes: +1

Mark said:

I'm getting the above error on the page .... I've seen references to this on the web. Do you know if there is anyway to correct that? Apparently it is know problem with the way Google is generating the code...

Thanks for the get plug-in!
 
report abuse
vote down
vote up
November 13, 2008
Votes: -1

Joris said:

Thank you for the plugin! It looks promising and it's better than a module solution!
 
report abuse
vote down
vote up
November 14, 2008 | url
Votes: +1

Rob Valk said:

This is one of the few extentions on Joomla that is realy creating user-value without having to learn all kinds of technical stuff.
This is high-level analytical coding for dummies (like me) smilies/wink.gif
Kenneth, keep up the good work.

Rob
 
report abuse
vote down
vote up
November 17, 2008 | url
Votes: +0

Rob Valk said:

This is real high level out of the box analytics.
Even for a dummy like me smilies/wink.gif
Thanks Kenneth, keep up the good work.

Rob
 
report abuse
vote down
vote up
November 17, 2008 | url
Votes: +2

stan said:

Ok it's turns out my installer was broken. but i got it fixed. Does it sometimes take a while before google analytics starts tracking??

[Yes, Google updates Analytics in a batch process. Normally, you have to wait until the next day to see today's data. - Kenneth Crowder]
 
report abuse
vote down
vote up
December 05, 2008
Votes: +0

stan said:

Is there a way to check my joomla site to see if is inserting the code unto the different pages? i ask this because after waiting a while google analytics recognized my ID to track, but doesn't seem to be registering any visiors.

[Can you email a link to your site to me? I will take a look. - Kenneth Crowder]
 
report abuse
vote down
vote up
December 05, 2008
Votes: +1

Bridgit said:

I installed this and entered my code and it seemed to work as I can see it in the source code. However, I continue to try to verify it with google and I keep getting the error message below. Any ideas?

Tracking Unknown (Last checked: PST.)
The Google Analytics tracking code has not been detected on your website's home page. For Analytics to function, you or your web administrator must add the code to each page of your website.

[You need to give Google 24 hours to detect your website's use of the code. Also, the data for today will not show up in Google Analytics until tomorrow. - Kenneth Crowder]
 
report abuse
vote down
vote up
December 06, 2008
Votes: +2

Tim said:

Will this extension work in a Joomla 1.5 site running in 1.0 legacy mode?

[Yes, it does. smilies/smiley.gif - Kenneth Crowder]
 
report abuse
vote down
vote up
December 08, 2008 | url
Votes: +0

will key said:

why don't people just put the code inside their template's index.php page? then it shows on every page automatically!

[Actually, this plugin does the same thing. It is intended to make it easier for Novice users who are not sure how to add it to their template. - Kenneth Crowder]
 
report abuse
vote down
vote up
December 10, 2008 | url
Votes: +0

Rob said:

Awesome plugin. Only took about 30 seconds to install and Google starting tracking in about 5 minutes. Thanks for the great plugin. Much better then the other I've tried.
 
report abuse
vote down
vote up
December 11, 2008
Votes: +0

Mandy Nichols said:

Great idea - thanks for this. I've just installed and am waiting untill tomorrow to get the results.
 
report abuse
vote down
vote up
December 20, 2008 | url
Votes: +0

Rodolfo said:

hello, thanks for your effort! Merry Chrystmas to you!
 
report abuse
vote down
vote up
December 24, 2008
Votes: +0

Will said:

Beautiful First time install, took about 1 minute from woe to go. Has an extension ever been so easy to implement.
 
report abuse
vote down
vote up
December 31, 2008
Votes: +0

jl said:

After trying 4, this one did the trick.
 
report abuse
vote down
vote up
January 13, 2009
Votes: +0

Tim said:

thanks a lot. Works fine smilies/smiley.gif
 
report abuse
vote down
vote up
January 14, 2009
Votes: +0

Happy said:

YOUR PLUG IN KICKS A$$ AND THANK YOU FOR CREATING IT!

yeah.. I'm shouting! because I'm stoked!

 
report abuse
vote down
vote up
January 23, 2009
Votes: +0

Leo Romanovsky said:

Thanks, that was very easy to install
 
report abuse
vote down
vote up
February 09, 2009 | url
Votes: +0

Cobus Zwiegelaar said:

We were just starting to get ready for the tedious task of inserting the analytics code into every page of our site when we came across your plugin!

THis is really awesome! Saves an enormous amount of time and works perfectly.

Great work
 
report abuse
vote down
vote up
February 21, 2009 | url
Votes: +0

Francesca said:

I just installed it in my website www.agriturismotoscana.ws and it works flawlessy, thank you very much for the nice job!
Francesca from Italy
 
report abuse
vote down
vote up
March 04, 2009 | url
Votes: +0

Anthony Hollander said:

I just installed the plugin and need to wait 24 hours to see if it's correctly working. Thanks. Installation was real easy compared to other similar products. I uninstalled all and am using this one.
 
report abuse
vote down
vote up
March 14, 2009
Votes: +1

Jim said:

The code is not appearing above the body tag, but below it. I don't know why. I'd appreciate any help.
 
report abuse
vote down
vote up
March 23, 2009 | url
Votes: +0

Kenneth Crowder said:

@Jim
This typically happens if you are using PHP4. I am not sure if you are aware, but PHP4 hit its End of Life on 12-31-2007 and development completely stopped on 08-08-2008 for security releases. That means that if a major security flaw in PHP4 comes out, it will not be fixed. You should speak with your host about upgrading to PHP5 as soon as possible.
 
report abuse
vote down
vote up
March 23, 2009 | url
Votes: -1

Stéphane said:

Thanks man !
It's a good gift !
 
report abuse
vote down
vote up
April 02, 2009
Votes: +0

Tina said:

Thank you for an excellent plug in!! Very much appreciated. smilies/grin.gif
 
report abuse
vote down
vote up
April 07, 2009 | url
Votes: +0

Jacob said:

Your efforts are most appreciated. smilies/smiley.gif
 
report abuse
vote down
vote up
April 09, 2009 | url
Votes: +0

DanFromOhio said:

As a total newbie I am testing out an installation problem, but did not want to pay for things that I may not ever use if I don't continue with Joomla. Thanks for this free, and very useful plugin. It installed with no problems at all, which can't be said about every 'free' thing I've found online. smilies/smiley.gif
 
report abuse
vote down
vote up
April 14, 2009
Votes: +0

HighPoint said:

Just wanted to say thanks for developing this plugin. Installation was easy and works well. Much appreciated.
 
report abuse
vote down
vote up
May 16, 2009 | url
Votes: +0

Don said:

The old saying:
Says what it does ... Does what it says.

That's professionalism, quality, and ease of use all in one. What more can you ask for.

Kudos!! .. and many thanks...
 
report abuse
vote down
vote up
May 20, 2009
Votes: +0

Nicholas Samuel Adams said:

I was skeptical only because I have struggled so much installing analytics with my Joomla sites. It really is as easy as it looks. Installed, entered my ID and thats it. One small tip is that if it is not verified immediately don't panic. I had to wait the full 48 hours for the install to be verified by google. One way I verified it for myself was just to check the view source and see that the script was there! Great Job!
 
report abuse
vote down
vote up
May 21, 2009 | url
Votes: +0

Alex said:

Thanks for this nice GPL plugin
 
report abuse
vote down
vote up
May 24, 2009 | url
Votes: +0

Nick said:

Thank you for this useful plugin! smilies/smiley.gif
 
report abuse
vote down
vote up
June 07, 2009 | url
Votes: +0

Nick said:

Thank you for this useful plugin! smilies/smiley.gif
 
report abuse
vote down
vote up
June 07, 2009 | url
Votes: +0

Lost Lion said:

I installed the plug-in, enabled it, and configured it exactly as shown in the screenshot using my web property ID. So why isn't it showing up when I view page source?
 
report abuse
vote down
vote up
July 24, 2009 | url
Votes: +0

Sam said:

Thanks heaps from Melbourne Australia! smilies/wink.gif
 
report abuse
vote down
vote up
July 30, 2009
Votes: +0

Duncan Wright said:

Looks like a great plugin.

Google analyitics is a must for all sites IMHO so its great that it so easy to implement
 
report abuse
vote down
vote up
August 03, 2009 | url
Votes: +0

AKMT said:

Great plugin. Thanks for efforts.
 
report abuse
vote down
vote up
August 09, 2009
Votes: +0

Syd said:

When I installed the plug-in it worked great, however, when I looked at my source code, the analytics code at the bottom of the page, right before the closing body tag. Also, I am running php version 5.2.4.

What should I do to get the code to appear above the body tag?
 
report abuse
vote down
vote up
August 14, 2009 | url
Votes: +0

zakimi said:

This is cool! I'm looking forward to use it for my new website. Thanks!
 
report abuse
vote down
vote up
September 13, 2009 | url
Votes: +0

Anthony said:

Installed this plugin successfully, however it seems to putting the code below the tag so im not getting any verification from google obviously. why is this happening?
 
report abuse
vote down
vote up
September 25, 2009
Votes: +0

Mark said:

Great plugin... Thank you so much! smilies/cool.gif
 
report abuse
vote down
vote up
October 02, 2009 | url
Votes: +0

Scott said:

I installed it but like many others, when I view source the js is not at that top. Running PHP 5 (latest version). let me know if I am missing something.
 
report abuse
vote down
vote up
October 07, 2009 | url
Votes: +0

Kenneth Crowder said:

@Scott,

The JavaScript should not be at the top. It should be at the bottom of the page just above the ending body tag. I viewed the source code on your site and it appears to be working just fine.
 
report abuse
vote down
vote up
October 08, 2009 | url
Votes: +0

xiaozhi said:

thank you , it is great. I really appreciate you do us a good favour
 
report abuse
vote down
vote up
October 20, 2009 | url
Votes: +0

Andrew Hoffman said:

worked like a charm with no problems at all smilies/cheesy.gif thank you so much!

-drew
 
report abuse
vote down
vote up
October 23, 2009 | url
Votes: +0

Zacko said:

I know it is meant for PHP5, but I don't have a choice and we are still running PHP4. Waht would be the simplest way to 'modify' your script to work in PHP4? Am I allowed to modify it?

Thanks, this looks awesome.
 
report abuse
vote down
vote up
November 11, 2009 | url
Votes: +0

emo girl said:

i use this tool. It's quite useful and saves some time.
 
report abuse
vote down
vote up
November 12, 2009 | url
Votes: +0

Patrick said:

I think this is a cool plugin, but it isn't working for me. I put set it up correctly, but it puts the javascript call after the tag, rather than before? Any idea why this would happen?
 
report abuse
vote down
vote up
November 24, 2009 | url
Votes: +0

Mike said:

This plugin simplifies the addition of Google analytics so much I hardly have anything to say about it except its great smilies/grin.gif


Thank you,
Mike
 
report abuse
vote down
vote up
December 03, 2009
Votes: +0

Kalimati said:

Kenneth,
Thanks for the great plugin. Have you updated it with the new asynchronous tracking code?
 
report abuse
vote down
vote up
December 08, 2009 | url
Votes: +0

Andrew said:

I've noticed, that sometimes the script appeares after the closing body tag. Kenneth Crowder mentioned, that is's because of PHP4. The problem really appear on PHP4 but it's problem of non ASCII characters in utf-8. I recommend to replace strrpos and substr with Joomla utf8_strrpos and utf8_substr functions and everything will be perfect. It's problem with most of Joomla extensions, that they don't fully use Joomla framework.
 
report abuse
vote down
vote up
December 09, 2009
Votes: +0

Batman said:

hi kenneth,

when aktivating SEO Urls the code is only pasted in the startpage. the other pages dont have the code inside.
 
report abuse
vote down
vote up
December 09, 2009 | url
Votes: +0

Gio said:

installed an enabled plugin, seems to be working but i get the lil yellow triangle with a question mark and no stats. Please help!
Gio
 
report abuse
vote down
vote up
January 06, 2010 | url
Votes: +3

Rob said:

Thanks for this easy to use plugin. Works excellent!
 
report abuse
vote down
vote up
January 07, 2010
Votes: +0

Web Design Kent said:

Seems to have installed fine, before the /body tag. Hopefully, when I switch over to my new Joomla install it will carry on stats for me. My current site work fine with analytics but thats pure plain static css.

For those using php V4+ you can upgrade to php if your server supports it by change the default setting by adding the following line to a .htaccess file;

AddType x-mapp-php5 .php

http://www.kent-website-designer.co.uk/
 
report abuse
vote down
vote up
January 14, 2010 | url
Votes: +0

Tariq said:

Fantastic. Keep up the good work.
 
report abuse
vote down
vote up
January 25, 2010
Votes: +0

Jeremy Janzen said:

Hi,

Does this track downloads as well as pageviews?
 
report abuse
vote down
vote up
January 31, 2010
Votes: +0

Kenneth Crowder said:

@Jeremy Janzen

No it does not. At this time, there are no plans to add any new features to this plugin.

Thank you!
 
report abuse
vote down
vote up
January 31, 2010
Votes: +0

Morten said:

Thanks - this is good work smilies/smiley.gif
 
report abuse
vote down
vote up
February 04, 2010 | url
Votes: +0

Jay Valencia said:

the pluggin now works! thanks
 
report abuse
vote down
vote up
February 04, 2010 | url
Votes: +0

Philippe said:

I first downloaded a module from someoune else. This didn't work properly because we use several templates plus a different front page.
Your plugin catches ALL.

WELL DONE. Thanks for this fine plugin.
smilies/smiley.gif smilies/smiley.gif smilies/smiley.gif
 
report abuse
vote down
vote up
February 05, 2010 | url
Votes: +0

L Uppal said:

Thank you for this plugin. I was going to do coding for this task but I took a chance to see someone has thought of this autonomous task and automate this already.

I found it easy to go through.

Thank you
 
report abuse
vote down
vote up
February 07, 2010 | url
Votes: +0

Claude said:

Hello Kenneth
Everything works great, but I have a question...maybe you know how to do that? What about external links?

I found this on Google Analytics help:



But do you know how I will add this to my external links? It has to be easy smilies/wink.gif
 
report abuse
vote down
vote up
February 22, 2010 | url
Votes: +0

BIGSHOT said:

Claude,

Thank you for your inquiry about the BIGSHOT Joomla! Google Analytics plugin. Unfortunately we no longer support this plugin. It's creator, Ken Crowder is unfortunately no longer with this firm. We will miss Ken and wish him and his family all the best. Ken is a Joomla! expert of the highest regard and a leader in the Joomla! community. You can find his information on the Joomla! website by following this link: http://community.joomla.org/se...owder.html
 
report abuse
vote down
vote up
February 23, 2010 | url
Votes: +0

Adam said:

I have installed and it is just what I needed. I will wait 24 hours and hopefully be getting the power of Google Analytics. Thank you for this.
 
report abuse
vote down
vote up
March 01, 2010 | url
Votes: +1

Write comment
quote
bold
italicize
underline
strike
url
image
quote
quote
smile
wink
laugh
grin
angry
sad
shocked
cool
tongue
kiss
cry
smaller | bigger

security image
Write the displayed characters


busy