Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am building a social media site that is similar is structure to twitter and facebook.com where unauthenticated users who go to https://mysite.com will see a login + sign-up page, and authenticated users who go to https://mysite.com will see their timeline.

My question is, what is the best practice (using Google Analytics) for tracking these two different types of users who are viewing completely different content but are visiting the same URL.

I tried searching the Google Analytics docs but couldn't find what they suggested for this scenario. Perhaps I just don't know what keywords to search for.

share|improve this question
up vote 3 down vote accepted

I finally found it in the Google Analytics Docs:

Use session-level custom variables to distinguish different visitor experiences across sessions.

For example, if your website offers users the ability to login, you can use a custom variable scoped to the session level for user login status. In that way, you can segment visits by those from logged in members versus anonymous visitors.

   1,             // This custom var is set to slot #1.  Required parameter.
   'User Type',   // The name of the custom variable.  Required parameter.
   'Member',      // Sets the value of "User Type" to "Member" or "Visitor" depending on status.  Required parameter.
   2              // Sets the scope to session-level.  Optional parameter.
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.