Skip to main content

How to enable personalised feed?

Introduction

In this guide, you'll learn how to enable and configure a personalized feed for users in your Android app using the LikeMinds Feed Android 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 Feed Android SDK: The SDK must be properly installed and initialized in your Android project. Refer to the Installation Guide.
  • Basic knowledge of Postman or equivalent API testing tools.

Steps to enable Personalised Feed

Step 1: Enable Personalised Feed Setting

  1. Open your LikeMinds Admin Dashboard.
  2. Navigate to Feed Settings
  3. Enable "Personalised Feed" Settings.

Step 2: Set weigths for different metrics

  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 Guide. Make sure to log in with the Community Manager's credentials.
  2. Configure weights on 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
}
}
}'
info

The sample values in the cURL are subjective in nature, please change it as per your user group.

Step 3: Configure in Android Feed SDK

In the last step of Getting Started Guide, send feedType as LMFeedType.PERSONALISED_FEED in getInstance() functions of the Fragments.

// pass this successCallback to LMFeedCore.showFeed()
val successCallback = { response : UserResponse? ->
// inflate social feed fragment in your activity
val containerViewId = R.id.frame_layout
val fragment = LMFeedSocialFeedFragment.getInstance(LMFeedType.PERSONALISED_FEED)

val transaction = supportFragmentManager.beginTransaction()
transaction.replace(containerViewId, fragment, containerViewId.toString())
transaction.commit()
Unit
} // callback triggered when the initiate user call is successful