I've created two custom dimensions in my GA properties: one called employees (internal traffic) and another call non-employees (external traffic).
In my Angular code base, I have an if check flag that puts a user in either category based on their email in my Auth service.
if(res.loginName.match(/@someemail.com/g)) {
//send user UID to google analytics
(<any>window).ga('set', 'employees', 1, res.id);
(<any>window).ga('send', 'pageview');
}
else {
(<any>window).ga('set', 'non-employees', 2, res.id);
(<any>window).ga('send', 'pageview');
}
I'd like to create a custom segment/report based on these dimensions. How do I set up my segment? Employees below is the custom dimension...
edit: does the below segment seem correct? I am pulling information which is accurate, just like to make sure that my custom dimension and segment are set up properly.
To setup a segment based on a custom dimension looks like you are in the right place and know how to do that part.
But I think there is something you should change about your custom dimensions.
You should have ONE user scope custom dimension(CD) called "Employee Type" or "User Type".
Under this CD, you would send or set the value to "employees" or "non-employees".
Also, the code you use to set should be:
ga('set', 'dimension1', 'employee');
or ga('set', 'dimension1', 'non-employee');
replace "dimension1" with "dimensionXX" where XX represents the index number of the CD, it is NOT the displayed name of your CD.