Add to Google Add to Bloglines Add to Newsgator Add to Yahoo! Contact ROI Revolution Sign Up for the ROI Newsletter Unofficial Google Analytics Blog Feed Unofficial Google Analytics Blog
Unofficial Google Analytics Blog by ROI Revolution

Categories Search This Blog Blogroll Archive

| |

November 20, 2006

Tracking Individual Clients on Database-Driven Pages Using Google Analytics

By Shawn Purtell, Google Analytics Support Tech

Clients.jpg
Here's a question we have been asked recently:

We run a centralized application that manages different websites. It's a database driven set of pages that, depending on a URL variable, displays a specific client's content.

(ex. clients-domain-A.com/index.asp?ID=93874X6E830T displays client A's content
clients-domain-B.com/index.asp?ID=76UHHEI8769 displays client B's content)

A critical note is that each client's domain name is not configured as a website in IIS; we simply direct all domain names to the same IP and use a script to associate the domain name with a client's ID. Currently, we have about 100 clients, but the implementation must be scalable to as many as 400.


So the questions we have are...

1. Is there a way for us to use Google Analytics to track statistics independently for each client?
2. Would I have to install all Google Analytics tracking codes in the same page?
3. Can Google Analytics track a profile based on the domain name only?

Well, there a couple of solutions to this particular problem that you could try (they haven't been tested). Both of them involve creating separate profiles for each client.


Database copy.jpg
Creating a new field (in MS Access)

One solution is to add a field to the customer database that is being used to generate the pages, called 'Google Analytics ID' or some appropriate field name. This field should consist of the account ID given to you in the implementation script of the corresponding profile.

Tableview.jpg
The New Database

In the script that generates the page, you need to include a section that writes the Google Analytics script into the page. In this section, you can have the __uacct variable set using the 'Google Analytics ID' field from the database.


script.jpg
Code Generated For John Doe

This way, you only have to include the script once (to answer part 2), and it will be appropriately written depending on the client's ID. This, of course, depends entirely on how your website is generated (what language, etc). Our example uses ASP, so we're fine.

To answer the third part of the question, Google Analytics by default tracks pages using the URI, not the domain name. This allows us to ignore the dynamically generated domain names.

An important thing to keep in mind is that Google currently only allows 50 separate profiles per Google Analytics account. In order to track more than 50 clients, you would need to create a different account for every 50 clients you wish to track.

Fortunately, using the database method, you would not have to alter anything in order to integrate these new accounts, as long as you correctly identify the appropriate Analytics ID in the database for each client. You would not need to create a new database for each Google Analytics account.

Alternatively, you could use an include filter for each separate profile that grabs the particular client's ID number from the query string. This would be fine if the number of clients will remain small, but since we're looking at potential growth up to 400 clients, it's really not an option.

So, as we've illustrated, even though Google Analytics may not track large-scale website configurations right out of the box, with a little forethought and proper planning, it can support more complex and/or dynamic sites.

Posted by Shawn Purtell at 3:28 PM









Filed under:

TrackBack

TrackBack URL for this entry:
/mt/mt-tb.cgi/184.

Comments

Is there a way to create an individual user cookie that can be used to filter a single computer from Google Analytics reporting?

Posted by: Wilson at June 6, 2007 3:10 PM

@Wilson:

You don't necessarily need to create a cookie to do this, but there are two ways to go about this depending on the IP of the computer.

The method will defer depending on whether the IP of the computer is static (always the same), or dynamic (changing).

Michael Harrison wrote a great blog article on this.
Michael's Article

Posted by: Shawn Purtell at June 7, 2007 9:08 AM

Post Your Comments

Post a comment

Contacting ROI Revolution

Telephone Number:
(919) 954.5955 ext. 306
ask for Meredith Smith

Office Fax:
(919) 954.4767

Address:
3109 Poplarwood Ct.
Suite 219
Raleigh, NC 27604


Authorized Google Analytics Consultant

Google Analytics Certified Service and Support Consultant


Free Webinar!

Join a Live FREE Google Analytics Training Webinar
Register now to learn how to
turn Google Analytics into
pure profit! You'll learn how to use many of the key reports, a ten-step system for properly configuring Google Analytics on your website, and how to apply what you learn to the attainment of your online goals. Register for our free Google Analytics training webinar today.


Subscribe to the
ROI Revolution Google
Analytics Newsletter today

Free monthly email publication that contains valuable, practical tips, secrets, and much more! Subscribe to our free Google Analytics newsletter today.


Looking to Purchase
Urchin 5 Software or Fee
Based Support?

We are a Urchin software certified service and support partner! Buy Urchin 5 software, profile packs, load balancing modules, campaign tracking, or fee-based support today.