Segmentation
Segmentation allows you to target specific groups of users. Each widget's payload includes a segmentation rule, which is evaluated against your user's profile data. If a user's profile meets the segmentation rule criteria, the widget is displayed.
Key requirements for segmentation
Reflection of available user data
For the segmentation feature to work correctly an example of the available user data needs to be reflected in the CMS. Importance here is that attribute and example value are named correctly and represent the type (see example below). This allows you to create targets and apply rules for each target individually.
Example: Available user data
This example shows that an attribute country of type string is available and can be used to build segmentation rules when creating targets.
{
"country": "AT",
"age": 30
}For a better understanding of how the emBET User Profile works, please read the User Profiles section.
Recommended best practiceFor the correct functioning of the Segmentation, the User Profile's location must be checked and in case updated at every access
E.g. A user accessing for the first time in Austria will have this country assigned as location, although if the user would accesses another time from a different location, that must be updated in the user profile, otherwise, the segmentation rules would not work adequately and the widgets might not show up.
Updating Profile Data
The profile segmentation data can be updated only on initialization.
import React from "react";
import { View } from "react-native";
import { EmBETWebView } from "@livelike/embet-rn-websdk";
const AnyComponent = () => {
const [isReady, setIsReady] = useState(false);
const [userProfileData, setUserProfileData] = useState("");
const userHandler = async () => {
const user = await getUserFromYourDatabase();
// if user have no token, it's his first initialisation
const userData = { country: user.country, age: user.age };
setUserProfileData(userData);
isReady(true);
};
useEffect(() => {
userHandler();
}, []);
return (
<View style={styles.container}>
{isReady && (
<EmBETWebView
clientId={clientId}
customId={customId}
userProfileData={userProfileData}
/>
)}
</View>
);
};This documentation provides a structured approach to configuring and using segmentation within emBET. Following these steps ensures accurate widget targeting, improving audience engagement and personalization.
Updated 2 months ago
