Skip Navigation
Details
Author: Jake Howlett
Date: Tue 5 Aug 2008

Permalink

Comments / Add / Subscribe

« What Happens When Your Users Get Married? | Blogs | Survey Result: Should CodeStore Be Hosted on Windows? »

Google Analytics on Secured Domino Websites

The other day I got asked:

This might seem like a silly question, but can we use google analytics on a private (login access only) site? The way I've seen it work so far is only on public facing sites.

Not a silly question at all. Well, maybe it is, but I didn't know the answer either. In reply I said that I couldn't see any reason why not and that I'd take a look.

From the way I understood it to work you just need to load the external Google-hosted JavaScript file in to your page and that's all it takes. Although there is one step in the sign-up process which limits where you can use Analytics. Before Google will start tracking a site it takes a look at the site in question to make sure you've added your unique tracking code to the bottom of the page found at the domain you want to track. For this reason the site must be Internet-facing.

If you want to track hits to a site not available on the Intranet using the Analytics code this answer from the Google site might help:

If you have content behind a security firewall or on an intranet or internal network that prevents you from using the Google Analytics service, Urchin 5 software is for you.

Now, assuming the site is accessible from the Internet, what happens if you require a login to access the site? Well, Google will only ever see the login form, so you just need to make sure your tracking code is on the bottom of the login form. When Google "pings" the site you're trying to setup to see if it can find the tracking code it gets a login form. This doesn't matter though. As long as the code is in the HTML returned.

To test the theory I tried if on a site of my own. If you look at clients.rockalldesign.com you'll see a login page for my home-made CRM package. Look at the bottom of the source and you'll see the Google tracking code. It all works as expected and I can now see how much use the CRM is getting -- even though Google itself can't get past the login form and/or see any of the actual content beyond it.

If you host lots of sites and want to track them in different Anayltics accounts then you'll need to either use multiple custom Login forms or have the code which displays at the bottom of the login form compute itself based on the Server_Name field and the site being accessed when the login form appears.

Hope that helps.

Comments

Hugo Alves (Tue 5 Aug 2008 10:24 AM) e-mail

I`ve been using Analytics not only on login form and it works fine. The only problem I have is that i didn`t figure out how to consolidate information. All the stuff that comes after the ?openform& separates the results (as if it were different pages) when it shouldn`t.

Frank Brefere (Tue 5 Aug 2008 12:12 PM) website / e-mail

We've been using Google Analytics on every page of our new site, which requires everyone to login, and it works great! Being able to generate reports based on the Window Title and/or the URL has been really powerful to highlight the hotspots.

Paul (Wed 6 Aug 2008 01:31 AM) e-mail

I haven't found out yet how to preform analytics based on usernames.

In an older log-reporting tools we used different usergroups in notes to generate reports to see which web-applications/part of our intranet are used the most by people with role X or people with Role Y.

Frank Brefere (Wed 6 Aug 2008 03:26 PM) website / e-mail

Tracking by username is quite easy to implement. Just add the following code to the end of your GA script block. The <Computed Value> below is your username formula (@username or equivalent).

pageTracker._setVar("<Computed Value>");

To parse the results by username, assuming you allowed a day for the new code to report to their servers, just select "User Defined Value" from the SEGMENT field combobox within any specific report.

bhaidaya (Fri 8 Aug 2008 10:53 AM) e-mail

when you set pageTracker._setVar("<Computed Value>");

make sure the user has already authenticated...

you are only allowed one variable per user per session.. so if you add this on your login page (before they authenticate) every user will track as Anonymous

you can also choose not to track the normal page statistics and only capture spoofed urls... some computed value like

pageTracker._trackPageview('/userlog/BhaidayaBaker/DatabaseName/DocumentTitle/08-08-2008');

or

to track all user activity by date

pageTracker._trackPageview('/userlog/BhaidayaBaker/08-08-2008/DatabaseName/DocumentTitle/');

etc... keep in mind if you are tracking both.. then you'll be receiving twice as many page views...

Add your response here:

Name *:
E-mail:
Protected from spambots!
Website:
rel="nofollow"

Comment *:
HTML is not allowed!

Note: This blog entry is more than 7 days old so your comment, as an anti-spam measure, will need to be approved.