views:

29

answers:

1

Hey, I've got a website that needs user logged in before they can use, I want to track the behavior of each single user. Is it possible to do this? Any advice? Thanks very much!

+3  A: 

Yes this is possible.

The simplest way might be to define a Custom Variable scoped to the visitor, and bind it to the value equal to the (obfuscated) user's ID (the one you assigned them when they registered):

pageTracker._setCustomVar(1, "Registered" "TempID", "345X34RT", 1)

The four arguments that you pass into a Custom Variable are: slot number (any integer 1 through 5, which won't change in this case; 'TempID' which is a variable name i chose for this variable; 'TempID', the value for that variable that maps to (but must not not personally identify or it will violate Google's Privacy Policy) a registered user; the final argument '1' is the scope, which i is '1' in this case because this variable is scoped to the visitor).

This new variable is sent to the GA server via a call to *_trackPageview()* so make sure you the custom variable is set before trackPageview() is called.

There are a several excellent resources, including step-by-step tutorials on GA Custom Variables, including a blog post by ROI Analytics, which is think is one of the best.

Once you've done to view this Custom Variable in the Google Analytics Web Client, go to the left-hand panel and click on the Visitor heading; the last item under this heading (and just before the next major heading which is Traffic Sources) you will see the Custom Variables subheading.

This is where you can view the data for the custom variables you set. For instance, the panel will look something like this:

alt text

doug
The quotes in your code sample seem wrong? Interesting answer tho, will try it sometime.
James
the second argument had an unpaired quote, fixed now.
doug
HI, thanks very much. Buts my website has some sort of special condition. I want to track each single user's usages: Do they like or not like this website, how often do they use, and the important thing is get the tracking data from each single user, does this violate Google's rules? All the users are my clients anyway.