I am interested in analyzing the behaviour of different user roles on my site.
Is it possible to submit the users role(s) for segmentation (like the profile fields)?
At the same time I need the selection of roles to be tracked, this still makes sense.

What happens if a user has more than one role - can Google Analytics handle multi-value segmentation fields?

Cheers
Daniel

Comments

budda’s picture

if i understand you correctly, yes you can select what roles to track. These are included in the user segmentation tracking variable in the footer of your pages.

You just need to select all roles you want to track on the module settings page.

gpk’s picture

Unless I'm mistaken only User ID, Username and any defined profile fields can be tracked. (But yes, you can easily select which roles are tracked by having the Google Analytics tracking code added to the HTML.)

So one way to track roles might be to define a profile field(s) to contain the roles.

Another way would be to hack the .module file to add this information automatically.

Multi-value segmentation fields are not handled very well by Google Analytics. The module does the best it can, so if for example you want to track 2 profile fields, e.g. suppose you had set up profile fields of user age range and gender, then the segments would be shown in the form 26-35:F 36-45:F 36:45M etc. i.e. different segments are separated by a colon. However, Google analytics treats these as distinct segments, and if you wanted to get results for the entire segment M (any age range) or the entire segment 36-45 (both genders) you would probably have to set up different Analytics profiles and do some custom filtering/manipulation on the user segmentation field value to strip out the part you don't want.

Good luck!

gpk
www.gelst.com

budda’s picture

Version: 5.x-1.2 » 5.x-1.x-dev

Maybe tracking of a users role could be injected in to the segmentation field.
If a user has multiple roles should they be comma seperated to give something like:

<script type="text/javascript">
_uacct = "UA-12345656565656565";__utmSetVar('superuser:male:admin,member');urchinTracker();
</script>

In the above example the 'admin,member' are the two roles.

budda’s picture

Status: Active » Fixed

Committed to 5.x-dev branch.

Anonymous’s picture

Status: Fixed » Closed (fixed)