In UserGuiding, segmentation means to divide end-users into groups, or segments. Later on, each group you've created can be matched with a specific guide or a hotspot.
By this way, you can set the right coupling in which your guide appears before its right spectator.
For instance, when you create a guide to welcome people who've just signed up to your platform, the guide's match should be the new user segment. People who're already familiar to your platform, don't need to see this guide.
Let's say we want to create a user segment containing people who have signed up to our platform after a specific date, and match this segment with its relative guide.
From now on, we'll call this user segment the "New User Segment" and, each end-user who signs up after the specific date we're gonna define, will fall into this segment.
Our first job is to create a custom attribute for the segment;
Find the segmentation in UserGuiding Panel and and select Custom Attributes tab. Then click + NEW ATTRIBUTE button.
In the image below, the ‘signUpDate' is the key field in your event layer and we call it identifier of the custom attribute.
Data format could be Text, Number, Boolean or Date. We have chosen the date along with the UserGuiding as the data source.
2. Now, switch to the Segmentation tab and create a segment by using the new custom attribute, which you're able to see on the dropdown menu of properties.
According to the above exemplary segment above, if a user signs up after 01/01/2020, s/he will be considered as a new user and be part of the "New User Segment".
3. In the Guide's page, find the guide that you want it to be seen by people belonging to the New User Segment, go to its setting page via the gear icon on the right side of the row.
4. Then, find the Segmentation section and select the "Custom Segmentation" option. From the dropdown menu, select the "New User Segment". (Do not forget to click Publish Changes button)
Save your action and click on green PUBLISH CHANGES button from the header section.
5. Now, it is time to set the code that belong to the custom attribute we've previously created.
We can see the code of the attribute in Segmentation > Custom Attributes tab by clicking on the code icon on the right side of its row.
Copy the code snippet inside the popup window and insert it into your application (A developer can decide on the snippet's location).
As you can see in the above example, there might be other custom attributes in the code snippet, let's delete the parts that you won't plan to use.
6. As an example, we've used the code snippet as follows:
With user e-mail and password, we send login request to the server. In response, we invoke callback function ‘loginCallback’ to identify the custom attribute to the UserGuiding code.
7. From now on, for people whose signup date is after 01/01/2020, "Welcome Guide for New Users" is going to show up. And the rest of them, won't be able to see this guide.