How to enable personalised feed?
Introduction
In this guide, you'll learn how to enable and configure a personalized feed for users in your React Native app using the LikeMinds Feed React Native SDK. A personalized feed helps enhance user engagement by tailoring the content they see based on their preferences, interactions, and other metrics.
Prerequisites
Before you begin, ensure the following:
- LikeMinds Chat React Native SDK: The SDK must be properly installed and initialized in your React Native project. Refer to the installation guide if needed.
- Basic Understanding of React Native Components: Familiarity with React Native components concepts.
- Basic knowledge of Postman or equivalent API testing tools.
Steps
Step 1: Initiate a user session
Authenticated API calls to the LikeMinds backend require an authorization token. This token can be generated using this Getting Started doc. Make sure to log in with the Community Manager's credentials.
Step 2: Enable personalised feed
To enable the personalized feed, go to your likeminds dashboard and enable personalized feed from feed settings.
Step 3: Set weigths for different metrics
The personalized feed relies on various metrics such as likes, comments, recency, and user interactions. Set the weights for these metrics using the following cURL request:
curl --location --request PATCH 'https://auth.likeminds.community/community/configurations' \
--header 'Content-Type: application/json' \
--header 'Authorization: {cm_access_token}' \
--data '{
"description": "Personalised feed weights metadata for the community",
"type": "personalised_feed_weights",
"value": {
"comments_metrics": {
"max_threshold": 200,
"weight": 10
},
"likes_metrics": {
"max_threshold": 100,
"weight": 5
},
"post_dampening_metrics": {
"max_threshold": 100,
"weight": 5
},
"recency_metrics": {
"max_threshold": 100,
"weight": 5
},
"user_groups_metrics": {
"max_threshold": 50,
"weight": 2
},
"user_topics_metrics": {
"max_threshold": 100,
"weight": 5
},
"user_connection_metrics": {
"max_threshold": 100,
"weight": 5
}
}
}'
The sample values in the cURL are subjective in nature, please change it as per your user group.
Step 4: Initiate React Native Feed SDK and Navigate to Personalised Feed Screen
- Follow the Getting Started doc to initialize React Native Feed SDK.
- To navigate to the personalized feed screen, use the
UniversalFeed
screen withLMSocialFeedScreen
component with the feedType set toLMFeedType.PERSONALISED_FEED
.
<Stack.Screen
name={"UniversalFeed"}
component={LMSocialFeedScreen}
initialParams={{
feedType: FeedType.PERSONALISED_FEED,
}}
/>