1

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

2 Answers 2

0

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"]
1
  • I am using Universal Analytics so the custom vars are replaced by custom dimensions. Do you know how to set them? Commented Apr 2, 2013 at 13:07
1

If you're using Google Analytics with a SharePoint Intranet website, there are some usage limitations and data privacy issues to consider:

http://www.analyticsmarket.com/blog/sharepoint-and-google-analytics

Please note that you aren't able to store usernames in Google Analytics, as it violates the Terms of Service.

That said, you can import this information into GA by using a lookup table macro in GTM:

http://www.simoahava.com/analytics/google-tag-manager-lookup-table-macro/

You'll need a row for each username in the lookup table, with columns for each value: Managers / Barcelona / HR Dept / etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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