Monetate
Firebase
Remote Config
Monetate recommendations feature flag has been added on remote config
{
.
.
"feature_flags": {
.
.
"recommendations_monetate": true
}
}
Monetate API
We created monetate service class which use monetate package, you can find that package in the App's project root directory. This Monetate package has the Monetate API implementation and model classes which is used to fetch personalized product recommendations and to send analytics events back to Monetate for tracking purposes.
Base URL
- Production:
https://engine.monetate.net/api/engine/v1/decide
Channels
Monetate provides different channel strings for each region and language. This channel parameter is essential in the API request payload as it determines the recommendation and analytics context, helping to deliver region-specific content.
Example Channel Format:
channel: "a-a77f9577/p/toolstation.prod.app.nl.en"
API Request Overview
Monetate uses a single API endpoint for both recommendation requests and analytics tracking. This is made possible by including various events within the request payload. The events specify the purpose of the request, whether it's to request recommendations or to record an action, such as viewing a product or making a purchase.
Monetate Events
The events array in the API payload contains objects representing specific actions or contexts. Each event is identified by an eventType that tells Monetate what kind of data is being submitted. Here are a few commonly used event types:
- Recommendation Request:
monetate:decision:DecisionRequest - IP Address Context:
monetate:context:IpAddress - Page View Context:
monetate:context:PageView - Product Detail View:
monetate:context:ProductDetailView - Cart Context:
monetate:context:Cart - Purchase Context:
monetate:context:Purchase - Impressions Tracking:
monetate:record:Impressions - Click Tracking:
monetate:record:RecClicks - Recommended Product Impressions Tracking:
monetate:record:RecImpressions
Check all events here
You can refer to the following example request payload for guidance on formatting:
- Product details page recommendation request
{
"channel": "a-a77f9577/p/toolstation.prod.app.nl.en",
"deviceId": "c889e532-9bb7-4432-8912-0ef0922f4c11",
"events": [
{
"eventType": "monetate:decision:DecisionRequest",
"requestId": "3112671459",
"includeReporting": true
},
{
"eventType": "monetate:context:IpAddress",
"ipAddress": "86.190.197.51"
},
{
"eventType": "monetate:context:ProductDetailView",
"products": [
{
"productId": "36781"
}
]
},
{
"eventType": "monetate:context:PageView",
"url": "https://www.toolstation.nl/",
"pageType": "also_like_products"
}
]
}
- Trolley page recommendation request
{
"channel": "a-a77f9577/p/toolstation.prod.app.nl.en",
"deviceId": "c889e532-9bb7-4432-8912-0ef0922f4c11",
"events": [
{
"eventType": "monetate:decision:DecisionRequest",
"requestId": "2634429199",
"includeReporting": true
},
{
"eventType": "monetate:context:IpAddress",
"ipAddress": "86.190.197.51"
},
{
"eventType": "monetate:context:Cart",
"cartLines": [
{
"pid": "36781",
"sku": "36781",
"quantity": 1,
"currency": "EUR",
"value": "0.56"
}
]
},
{
"eventType": "monetate:context:PageView",
"url": "https://www.toolstation.nl/",
"pageType": "trolley"
}
]
}
Note
Page-Specific Recommendations: The pageType field within the PageView event indicates the page for which we want recommendations, such as also_like_products for product details pages or trolley for the cart page.
Methods
The functions that call the Monetate API end points and return the Recommended Product Ids as a List of Strings are:
/// Returns a list of recommended products based on the given [productCodes] list
Future<RecommendedProductsResponse> getRecommendedHomeProducts(
List<String> productCodes,
Region currentRegion,
);
/// Returns a list of related products based on the given [productCodes] list
Future<RecommendedProductsResponse> getRelatedProducts(
List<String> productCodes,
Region currentRegion,
);
/// Returns a list of related products based on the given [productCodes] list
Future<RecommendedProductsResponse> getRecommendedProducts(
List<String> productCodes,
int departmentId, {
List<String> excludeIds = const [],
int fallbackRecommendationsRowCount = 0,
});
Future<RecommendedProductsResponse> cartRecommendations(
List<TrolleyItem> cartItems,
Region currentRegion,
);
Analytics
Monetate helps us deliver personalized product recommendations based on what users do in the app, making it easy for them to find items they’re interested in. Our app sends user activity data to Monetate, which then provides recommendations in return. We keep track of clicks, views (impressions), and purchases from these suggested products.
How We Track Interactions
We capture three main types of interactions with recommended products: clicks, views (impressions), and purchases after users engage with recommendations.
- Clicks:
- Whenever a user taps a product in any recommendation carousel (like on the homepage, the product detail page, or in the trolley), we send an API request to Monetate.
- This request includes a
monetate:record:RecClicksevent and arecClicksparameter, which contains therecTokenvalue from the Monetate recommendation response. This token uniquely identifies the product clicked.
- Views (Impressions):
- If a user scrolls through products in a recommendation carousel on the homepage, product detail page, or trolley page, we log these views as impressions.
- We send an API request to Monetate with a
monetate:record:RecImpressionsevent and arecImpressionsparameter, which also holds therecTokenfor each product viewed.
- Purchase:
- When user purchase, when order is successfully created, we call Monetate API and log the current purchase.
- We send an API request to Monetate with a
monetate:context:Purchaseevent.