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

I am building an Intranet site and I am going to use Google Analytics for the statistics. I was wondering if there is any way to segment visitors using Google Analytics taking the information from some fields in the User Profile (Category of the employee, Office Location and Department among others). For example, I need to track all pages visited by "Managers AND/OR Barcelona AND/OR belonging to Human Resources department".

Any idea? Thank you

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

You can create Custom Varaibles for google analytics. You then just need to collect the information from the user profile and pass it to GA.

Example of setting a custom GA variable:

_gaq.push(['_setCustomVar',
      1,                   // This custom var is set to slot #1.  Required parameter.
      'Items Removed',     // The name acts as a kind of category for the user activity.  Required parameter.
      'Yes',               // This value of the custom variable.  Required parameter.
      2                    // Sets the scope to session-level.  Optional parameter.
   ]);

How to get User Profile properties:

var office = SP.UserProfiles.PersonProperties.get_userProfileProperties()["Office"]
share|improve this answer
    
I am using Universal Analytics so the custom vars are replaced by custom dimensions. Do you know how to set them? –  Alvmad Apr 2 '13 at 13:07
add comment

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.