0

We have profile pages for members of our website. I want to show our members who has visited their profile page. I currently implement this by recording traffic in our database. Some of the visitors aren't logged in and some are. When the profile page visitor is logged in, I can show the profile page owner a link to the person who visited their profile page.

I want to simply retrieve this information from Google Analytics instead. It's bound to be significantly more accurate (real people, not bots, uniques are far better handled, etc) and it'll be much easier to then implement more detailed statistics.

So is this possible with the GA API? To get a list of visitors for a particular webpage in a date range where some visitors will be logged in during their visit and I can get their username? I guess I would have to pass the visitor's username to GA upon login (I already do that by sending a login event with the username to GA) or at each webpage visit (don't know how to yet).

If this is not so easy with GA, I'm happy to use another analytics tool or service.

at.
  • 50,922
  • 104
  • 292
  • 461
  • 2
    Keep in mind that it is a violation of the Google Analytics terms of service (TOS) to collect Personally Identifiable Information (PII) in GA that probably includes username: [google.com/analytics/tos.html](http://google.com/analytics/tos.html) – jk. Jul 29 '11 at 00:47

2 Answers2

1

It's still a bit fuzzy on what is and what is not considered "Personally Identifiable Information". We've had some people reach out to Google directly, and even then we receive mixed answers.

That being said, this is fairly easy to do by saving a visitor-level custom variable containing the UserID of the person that has logged in. This will tie all of their actions to that particular userID, including the pages they visit. If you query the google API for the value of that custom variable for visitors who hit that page, you'll get what you're looking for.

Alec Sanger
  • 4,442
  • 1
  • 33
  • 53
  • Technically, it sounds like what I'm looking for. Easy enough for me to add a userId to each page tracking call. I'm not too keen on testing Google's vague TOS (haven't read it, just assuming it's vague based on what you wrote above) on an important feature of my website. Is there another service that isn't so vague? – at. Jul 29 '11 at 03:05
  • 2
    Well from what you described in your original post, it sounds like you're moving to analytics because you think it will be more accurate than what you're currently doing. If your only intention is to display the username or userID of logged in users who view a profile, I don't see why saving these values to your own database would be any less accurate than analytics. All you would need to do is save the userID of the person viewing the page, the unique ID of the page, and a timestamp for when the visit was. You can retrieve the results with a single query, avoiding the fuzzy analytics ToS. – Alec Sanger Jul 29 '11 at 10:29
0

If you have your site setup as you have specified then you do not require GA in anyway. I guess you want to uniquely stamp every entry on the page to avoid duplication, by day or by month you may just need to put these on paper/board and see which fits well.

webb
  • 215
  • 1
  • 5
  • 12