Welcome, Guest
Please Login or Register.
Lost Password?
New Google Analytics module (1 viewing)
Post Reply

TOPIC: New Google Analytics module

#4190
Joe (Admin)
Posts: 3939
graph
New Google Analytics module 2007/03/15 22:59  
Hi all,

Continuing our recent theme of "awesome things nobody has even thought of yet", I've just rolled out a new (somewhat experimental) module to make it easy for your users to make use of[a href="http://www.google.com/analytics/">Google Analytics. As you know, Virtualmin automatically sets up Webalizer and AWstats, which are cool packages. But, there's a lot of data about website usage that neither of those packages has easy access to. Conveniently, Google does, and they let you see it for free in the form of really nice looking graphs. All around Google Analytics rocks pretty good, but I don't know many people using it, because it requires a few tricky bits. This module takes away a couple of the tricky bits (you still have to sign up and get an ID).

The way this module works is it automatically adds a mod_perl filter to your Apache process for any domains for which Analytics is enabled. The filter injects the magic JavaScript string with the users ID in just the right place on every page, no matter how it was generated (static HTML put in place via FTP/SSH or the WYSIWYG editor, PHP script, Perl script, Ruby script, SSI, whatever). Your user doesn't need to know where to edit template files or even how to edit HTML, and they don't have to ask for any customer support, either (probably...we'll have to see if the UI provides enough guidance for folks).

Anyway, this module rocks and I've already started using it, and Jamie is a bloody genius (I watched him write it during dinner at YCombinator Tuesday night while James Hong was talking about[a href="http://hotornot.com">HOT or NOT).

Now, of course, you'd like to get on with it! So, to install it, first make sure you've got mod_perl. I believe this is kinda default for everybody except the Debian-ites and Ubuntuns. So, for you guys, we'll add an extra package to your install list (we might need to configure it too...I'll have to poke around a bit to see, and will post more to this thread in the news forum later).

To install on Red Hat based systems:

yum install wbm-virtualmin-google-analytics

On SUSE systems:

yast -i wbm-virtualmin-google-analytics

On Mandriva systems:

urpmi.update -a
urpmi wbm-virtualmin-google-analytics

And on Debian and Ubuntu systems:

apt-get update
apt-get install webmin-vritualmin-google-analytics libapache2-mod-perl2

To install on systems using .wbm and .wbt packages, download the module from:

http://software.virtualmin.com/wbm/virtualmin-google-analytics-1.0.wbm.gz

Using your serial number as the username and your license key as the password. Then install it using the Webmin Modules module.

Finally, you'll have to enable it for any domains that you'd like to use this feature on. Once enabled, the domain owner can click the Google Analytics option from the Services menu and fill in their UID (which is an identifier that looks like "UA-2498289-1", which you get by signing up at the Google Analytics page).

As always, let us know about any bugs you find. And let us know if you or your users find the UI uninformative or difficult to use. It's a sort of vague concept, but we believe it's a lot easier than figuring out which files need to be edited within your CMS, blog, wiki, issue tracker, whatever, as well as every static page you serve up. (Also, feel free to tell all of your web developer and system administrator friends how awesome Virtualmin is for automating this.)
  The topic has been locked.
#4191
tabletguy (User)
Posts: 51
graphgraph
Re: New Google Analytics module 2007/03/16 07:39  
"Once enabled, the domain owner can click the Google Analytics option from the Services menu"

This implies (to me) looking under "Virtualmin->Services".

I didn't find it there. After a lot of searching, I found it under Webmin->Servers->Google Analytics Reporting.

If I click on a domain name (to activate), it says Error 404, page not found for every domain, so it's not working for me...

  The topic has been locked.
#4194
ADobkin (User)
Posts: 183
graphgraph
Re: New Google Analytics module - WARNING! 2007/03/16 08:06  
Be careful - this module appears to be a bit buggy right now! See details below....

First, these are the steps I used to set it up:

1) Using the Virtualmin Framed Theme, expand the System Settings category and click on Plugin Modules. (If you're using another theme, this should appear as a button near the bottom of the main Virtualmin page.)

2) Control-click to enable the Google Analytics Tracking plugin, and click Save.

3) Select the domain you wish to add this feature to, and click on Edit Virtual Server.

4) Under the Enabled Features section, select "Enable Google Analyics tracking?" and click Save Virtual Server.

5) Now, under the Services category in the left frame menu, click on the new option for Google Analytics Account (for that same domain).

6) Click on Set To, enter your UID, and click Save.

Now, here's the bad part: ALL OF MY WEBSITES WERE COMPLETELY DOWN! Apache refused to start, with the following error:

failed to load Virtualmin::GoogleAnalytics package

... along with a long list of Perl errors prior to that, which I can post separately.

So, I quickly tried to disable this module to undo what it did so I could get Apache to start back up. First, I tried to disable the plugin entirely. That didn't work. Then, I re-enabled the plugin so I could disable it from the one server I added it to. That didn't work either. Finally, I found the lines that it added in apache.conf for that virtual server and commented them out:

#PerlRequire /etc/webmin/virtualmin-google-analytics/apachemod.pl
#PerlOutputFilterHandler Virtualmin::GoogleAnalytics
#PerlSetVar AnalyticsID UA-xxxxxxx-x

At that point, I was able to restart Apache successfully (without this feature).
  The topic has been locked.
#4200
sgrayban (User)
Posts: 562
graphgraph
Re: New Google Analytics module 2007/03/16 09:11  
I had the same problem that post #3 had and have completely removed this module. It is VERY unstable and should be considered ALPHA code and NOT BETA which would imply that it is pretty much stable and it isn't.

Needs much more testing before actual usage.

But really is this module needed? The GA code is so simple to put into the website pages I think this module is more of a toy then a helpful module.
Scott Grayban
BORGNET dot US Internet Hosting
VM Pro Reseller
  The topic has been locked.
#4201
ADobkin (User)
Posts: 183
graphgraph
Bug Reports Google Analytics Plug-In 2007/03/16 10:37  
FYI, I have submitted the following bug reports:

Bug #715: New Google Analytics Plug-in Breaks Apache

Bug #716:Error Disabling Google Analytics

Bug #717:Google Analytics Reporting Module Error

Bug #718:RFE: Google Analytics Reporting Module vs. Virtualmin Plugin
  The topic has been locked.
#4212
Joe (Admin)
Posts: 3939
graph
Re: Bug Reports Google Analytics Plug-In 2007/03/16 22:50  
New 1.1 has been released which refuses to break your Apache config if only the old mod_perl is available. I'm packaging mod_perl2 for everyone as we speak to correct remaining issues.
  The topic has been locked.
#4213
Joe (Admin)
Posts: 3939
graph
Re: Re: New Google Analytics module 2007/03/16 23:05  
Hey Scott,

I had the same problem that post #3 had and have completely removed this module. It is VERY unstable and should be considered ALPHA code and NOT BETA which would imply that it is pretty much stable and it isn't.

Needs much more testing before actual usage.


Yep, it freaks out with old mod_perl. Sorry for the inconvenience. There's a new version that won't freak out, and will safely refuse to work with mod_perl 1.99 and below. I'm packaging mod_perl2 for everyone now.

But really is this module needed? The GA code is so simple to put into the website pages I think this module is more of a toy then a helpful module.

For you and me, it's super easy. For someone who wants to run a blog or wiki or forum (and used Install Scripts to install it) while still getting good analytics, it's probably not easy at all...maybe even impossible. You have to know where to find the end body tag in the right templates directory within your application(s)--and you need to know how to edit HTML to insert it without breaking things.

These are assumptions that we can safely make about most of our current users--like you and Alan--but going forward we want everyone (everyone, everyone) to be able to make interesting, good looking, and useful web pages, and learn useful things about their readership. As you know, we're building tools for the hard core guys like you, and we've been doing that for years. But now, we're trying to make Virtualmin useful for the folks who have never built a website. Screwing up your Apache configuration is clearly not the right way to do that--so we went back to the drawing board quick-like--but allowing non-technical Virtualmin users to make use of cool tools like Google Analytics is definitely a win for most of those folks.

I actually find it pretty nifty too--because I no longer have to think about "OK, did I get that tag added to all of my various applications in all of my various templates and subdirectories". We'll be running several applications when the new website goes live (instead of the single platform we have now), and getting all of them into analytics is important to me. When it's working right it adds the tag to every page served by Apache for the entire domain--no thought or searching for where to add it needed.

I believe our botched roll-out has given you a bad impression of the whole idea. Hopefully, when we get it fixed, you'll come around. ;-)
  The topic has been locked.
#8506
PlayGod (User)
Posts: 90
graphgraph
Re: Re: New Google Analytics module 2007/11/16 06:38  
As far as I can tell, I've got the prerequisites...
mod_perl 2.0.2-6.3.el5
Google analytics account, functional

I removed the urchin script from the footer of my wordpress template (was working fine and allowing Google data collection).

I have entered my Google Analytics account ID in "Virtualmin Analyics" (sic) for the domain, however Tracking Status reports "Enabled but no account set"

I can't see any urchin script code inserted when I view source... is it inserted in apache header, or is supposed to be inserted in the html?
  The topic has been locked.
#8507
PlayGod (User)
Posts: 90
graphgraph
Re: Re: New Google Analytics module 2007/11/16 07:12  
Update: it apparently was "somewhat" working, because it was adding an abbreviated urchin script to standard HTML files... but not php files.
  The topic has been locked.
#8511
PlayGod (User)
Posts: 90
graphgraph
Re: Re: New Google Analytics module 2007/11/16 09:45  
"not php files" = "not Wordpress"

I haven't tried the analytics deal with other php scripts/templates yet. I mostly use phpBB, Wordpress and Joomla.
  The topic has been locked.
Post Reply
get the latest posts directly to your desktop

Talk and Get Help

Support
Forums
Bugs and Issues

Get Virtualmin

OS Support
Buy Online
Download
Copyright 2005-2007 Virtualmin, Inc. All rights reserved.