Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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

1 Answer 1

up vote 2 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.

_gaq.push(['_setCustomVar',
   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

 
discard

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.