user277813
user277813

Reputation: 159

Using Google Analytics to Track User Session

I have a PHP (5+) based website.

I want to track registered users of my site using Google Analytics. I basically just wish to grab their session id (or some way to identify each specific user)and view their movements and site usage from my Google Analytics dashboard.

Can this be done? If so, any guidance would be most welcome.

Upvotes: 5

Views: 4675

Answers (2)

Andrew C
Andrew C

Reputation: 562

Technically you are able to store the username as a custom variable, but doing so violates the Google Analytics Terms of Service (ToS). Among other things, the (paraphrased) ToS states that you aren't allowed to store anything in Google Analytics that allows you to identify who the visitor is. This typically applies to usernames, IP addresses, phone numbers, etc.

If you decide to ignore the ToS and store the data anyway, it exposes YOU (not Google) to all kinds of data protection & PII laws. Especially in the EU.

If you have some budget money to work with, the best way to see the information you're looking for is to use an on premises web analytics software package that can process Google Analytics data. When you keep your data on premises, it alleviates many of the data privacy / protection / PII laws.

Upvotes: 0

chris.f.jones
chris.f.jones

Reputation: 485

I believe the best way to do this is via a custom variable: _setCustomVar(index, name, value, opt_scope)

It would be up to you to identify the 'value' as a unique session id for the user. The scope in your case would be either session(2) or visitor(1) depending on how you want to track it. http://code.google.com/intl/en/apis/analytics/docs/tracking/gaTrackingCustomVariables.html#setup

Upvotes: 5

Related Questions