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.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 (40)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: +2

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: +4

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: +0

hagia sophia said:

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

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: +0

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: +1

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: +0

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: +0

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

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