We use Google Analytics and Drupal at work. We have been tracking our website usage for quite a while now, but we had no idea what percentage of our visitors were staff. We have 13 main locations, so IP filtering could’ve gotten us most of the way, but staff members do work from home and on the road quite a bit too. In the end I decided that the best route would be to use Google Analytics _setCustomVar funcitons to record the data we wanted.
Staff members at work have the role “staff”, so that’s what I wanted to select on.
I decided to set two custom vars. The first one would be a session level scope which should roughly identify if the user is logged in to the website. The second is a visitor level var which will track the user even if they log out or reboot their computer.
Wait a few hours for some data to show up in Google Analytics and you can create custom segments based on these custom vars we just set up!