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 component 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 (21)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: +2

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

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

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

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

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

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

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