TABLE OF CONTENTS
- What is User Segmentation?
- How to perform User Segmentation?
- Other methods for User Identification and Segmentation
- Best Practices
What is User Segmentation?
User segmentation is the act of grouping users based on their characteristics, roles, departments, division, etc. Segmentation is one of the most important features provided by Apty. Here are a few reasons why,
- You can target different user experiences at different user segments.
- Segments are reusable so you don't have to write conditions manually every time you want to use them.
- Segmentation helps admins analyze and keep track of user engagements per segment. So, you can plan and build effective knowledge content for your users.
How to perform User Segmentation?
|PATH: Select the application > Click on the gear icon to open the Manage Current Application section >Segmentation
For every application, the admin gets the option to create segments from Segmentation under the Manage Current Application section. There are no limits on the number of segments you can create for an application.
What is User Identification?
In order to group some users out of all users, you need to identify them correctly. So, the first step of the User Segmentation process would be to identify unique users. And this process is called User Identification. You can use the User Identification method to correctly recognize the user and Apty provides you with the following identifiers to do so:
- Apty ID
- Application ID
Note: Apty team will assist you to configure the user identification during the customer onboarding process. Based on those identifiers Apty shows different analytics on the number of unique users, the number of workflows that are being played, etc.
In this article, we will take the use case of the CA PPM application to create segments with the help of different options available in the admin console. Let us see how identifiers help us fetch user data which we can use for segmentation.
It is a unique ID automatically generated by Apty which is stored in the Local Storage. The Apty ID acts as a unique identifier for a particular Apty Widget extension. The ID remains the same for an application across all tabs in the browser. It is also application-specific.
Following are scenarios where Apty ID can change, in other words, a new Apty ID will be generated for you:
- when you change the browser
- when you clear the local storage and refresh the tab, and
- when you change the application
Note: When the identifier is Apty ID, userId will be used for user identification.
Application ID is related to the application type. Apty executes custom logic to fetch the user Id based on the login session Id.
Note: When you choose Application ID as your identifier, we will give you a few default configurations for some of the most used applications across our customer base. Although the way of fetching the user-id varies depending upon the application type. For CA PPM, Apty takes the session Id of the logged-in user from cookies or session storage and makes an API call to get the user details.
When you select Application ID, you get a few additional application-specific data, as shown below.
Step 1: Go to the Manage Extensions in your browser, and click on the background page of the client extension.
Step 2: Make some clicks on the application page. Then go to the background page. Click on Network. From the left side Name panel, select the log (used for CA PPM). Go to Header. Under app Specific Data you can find the following data:
- application Type
Note: When you use Application ID as the identifier, Apty treats the id inside app Specific Data as the userId
The id inside app Specific Data will reflect the User Name of logged-in user, as shown below.Important:
- If you are using the application id to identify the unique user, the type must not be “generic”.
- Note that even when you use Application ID to identify users, the apty_user_id (the Apty ID) will still be generated as a backup.
|Note: When the identifier is Application ID, app Specific Data will be used for user identification.
Fetching data from Local Storage
Let us take a look at the Local Storage data for the CA PPM application we are using for this example.
First, we will write a custom JS to fetch the user data from Local Storage and return the data in the form of an object.
Save and publish the script in all your running environments.
The above script returns an object with two key-value pairs. We can use this data for user identification and segmentation.
User Identification using Local Storage
Let us use userId from the key-value pair as our Identification Key. Now go to User Identification. Note that the key name, or the property name of the key-value pair from the object, must match with the Identification Key.
Save the Identification Key. And that is how you use Local Storage data for user identification.
User Segmentation using Local Storage
Now let us create a segment of RnD department using the Local Storage data. In order to do so, we will use the department Id data from the custom JS object. Go to Segmentation. Click on New Segment.
Add a Segment Name. The condition to form the RnD segment looks like this "if Custom department Id equals to RnD", then the consider the user as a part of the RnD department segment.
Note that the key name from the Custom JS object must match with the custom condition.
Enable the segment to activate it and save the changes. That is how you create user segmentation using Local Storage.
Adding knowledge items to User Segmentation
In order to add toolset items (such as workflows, announcements, validations, tooltips, launchers, knowledge center, etc.) go to the following path.
|PATH: Select the application > Click on Manage > Click on User Segmentation
Other methods for User Identification and Segmentation
Similarly, we can use other options, such as session storage, on-screen elements, etc. to create user identification and segmentation. The user identification and segmentation steps will be the same for other options as well. But the data fetching custom JS will be different.
Fetching data from Session Storage
Here is the Custom JS for fetching data from Session Storage:
Fetching data from on-screen elements
In case the application does not have user data stored in local storage or session storage, then you can use the user data from the screen. Here is how you can do so.
Fetching data from Cookie Storage
Here's how you can write the Custom JS to get the Cookie data:
These are just a few examples of how you can perform user identification and user segmentation on the CA PPM application. The use cases may vary depending upon the business requirement. But the mechanism of performing user identification and segmentation remains the same. For instance:
- If the hosted application stores user details inside session storage, then, in that case, we can use session storage for segmentation.
- If the application stores user data inside local storage, then, in that case, we can use local storage for segmentation.
For more details contact our CS team.
- Script which is written for segmentation must be error free and in working condition.
- Scripts must be saved and published in all your active environments.