Personalization with User Properties
This guide shows how to personalize widget content with User Properties when using Storyly Placement SDK on iOS.
You can use personalized content for birthdays, personal offers by his or her name of a specific user, rewards, and so on. User Properties work with any widget rendered by Placement.
Before you begin
Make sure you have a working Placement integration (token, view, provider) as described in the Initial Setup.
Add User Properties in Storyly Dashboard
To be able to use user properties in your content, please go to Storyly Dashboard to add your properties.
Warning
Be sure to define unique property names in order to not to have problems while filling the user property fields in the application.
How to Use User Properties
You can use your defined user properties wherever you see the {} icon in the Storyly Dashboard and Studio.
Once you've added your user properties in the previous section, you can use them while creating your content. It is so simple to have a personalized cover image and title. Select Personalized instead of Static and choose your related user property from the dropdown.
In the Studio, you can add texts and media to your content. If you select edit on a text or media, you'll be given two options: Static and User Properties.
Setting User Property Data
This section shows you how to pass user property data to the Storyly Placement SDK.
You need to pass your user's property values as a key-value map using setUserProperties on STRPlacementConfig.Builder. The keys must match the property names you defined in the Storyly Dashboard.
placementDataProvider.config = STRPlacementConfig.Builder()
.setUserProperties(data: ["key": "value", "key1": "value1"])
.build(token: PLACEMENT_TOKEN)
The SDK substitutes these properties into the personalized content placeholders defined in the Storyly Dashboard and Studio.
Warning
If you miss a field of your user properties data, the content that uses that property will be ignored and will not be shown to the user.
Updated about 15 hours ago

