Contents
- What are Predict Product Recommendations
- Product Recommendations AI Logics
- Recommendation Filters
- Set Limit
- Result Listener
- Click Tracking
Resources
What are Predict Product Recommendations
Predict is a recommendation engine which analyses the behaviour data collected from your store by our JavaScript API (web) and Emarsys SDK (mobile) and uses this to deliver personalised recommendations to all your customers across email, mobile and web.
The Emarsys SDK supports this feature by providing the behavioural tracking in the standard SDK installation guide and the ability to retrieve/display the AI recommended products. The details on how to pull the product recommendations is documented below.
Product Recommendations AI Logics
The Emarsys SDK facilitates the request of product recommendations based on different recommendation logics used within the call. Below is confirmation of the supported logics available.
recommendProducts
is also going to track the value attached to the logic on the backend, so no additional tracking needed when using recommendations!
Suggested App Screen | Logic | Description |
---|---|---|
Home | Home | Personalized recommendations for product categories and products within these categories. |
Product | Related | Related/similar product recommendations. |
Product |
Also_Bought | Complementary product recommendations for the currently viewed product. |
Cart | Cart | Complementary product recommendations matching the cart contents. |
Category | Category | Personalized recommendations in a given category. |
Search Results | Search | Personalized recommendations matching the search term entered. |
Home | Personal | Personalized recommendations to match current recent behavioural tracking of the contact. |
Category | Popular | A simple list of top-selling products in a given category. |
It is possible to pass the values to the chosen recommendation logic. In the event that the values are not supplied in the call, the Emarsys SDK uses the last tracked values.
Recommendation Filters
This is an optional parameter of the recommendProducts
method.
You can filter product recommendations with the SDK by building RecommendationFilters
. There are two types of filters: Exclude or Include.
In every case there are four types of comparators you can use to compare your chosen field to expectationValue
:
-
isValue
- checking if the field is matching the value -
inValues
- any of the values has a match with the field -
hasValue
- One of the field values is equal to expectation value(applicable only to fields containing multiple values) -
overlapsValues
- One or more of the field values are found in expectation values(applicable only to fields containing multiple values)
For further information please check the predict documentation.
Set Limit
This is an optional parameter of the recommendProducts
method.
You can limit the number of recommended products received by defining a limit. This is an optional parameter, by default its value is 5.
Result Listener
This is a required parameter of the recommend Products method.
The SDK is going to retrieve recommended products via the resultListener
Java
RecommendationFilter filter = RecommendationFilter.exclude("category").isValue("SHIRT");
List<RecommendationFilter> filters = new ArrayList();
filters.add(filter);
Emarsys.getPredict().recommendProducts(RecommendationLogic.category(), filters, new ResultListener<Try<List<Product>>>() {
@Override
public void onResult(@NonNull Try<List<Product>> result) {
if (result.getResult() != null) {
List<Product> recommendedProducts = result.getResult();
}
if (result.getErrorCause() != null) {
Throwable cause = result.getErrorCause();
Log.e(TAG, "Error happened: " + cause.getMessage());
}
}
});
Kotlin
val filter = RecommendationFilter.exclude("category").isValue("SHIRT")
Emarsys.predict.recommendProducts(RecommendationLogic.category(), listOf(filter)){
it.result?.let { result ->
val recommendedProducts = result.result
}
it.errorCause?.let { cause ->
Log.e(TAG, "Error happened: ${cause.message}")
}
}
Click Tracking
The Emarsys SDK does not automatically track recommendationClicks
, therefore it is required to call manually trackRecommendationClick
when an interaction happens with any of the recommended products.
Java
Emarsys.getPredict().trackRecommendationClick(Product clickedProduct);
Kotlin
Emarsys.predict.trackRecommendationClick(clickedProduct: Product)
Variants
Variants are used by the HOME and PERSONAL logic types. By adding a list of Strings used as suffixes to logic names, recommendations are grouped by the variants provided.