If you are looking to personalize Klevu product recommendations on your store based on user segments, this guide will help you achieve exactly that. By utilizing your own user segments, you can leverage Klevu's smart recommendation engine to create a more personalized shopping experience for your website users.
If you use Klaviyo to segment your users, you can use our Klevu <> Klaviyo connector to use Klaviyo segments to merchandise recommendations. Read more here.
Setting Up Custom Segments with Klevu
- Define Your Segments and Get Them Configured in KMC
- Start by identifying the customer segments you want to use for personalization. These segments could be based on shopping behavior, demographic information, or any other criteria specific to your business. Alternatively, If you use an existing CDP, you may export a list of your existing segments names to use in Klevu Merchant Center.
- Once defined, share these segment details with Klevu support. The support team will help set up these segments within your Klevu Merchant Center (KMC) account.
- Provide the segment details in this format: Sample File for Segment Details
- The support team, after setting up, will provide you with unique IDs for each segment. It is crucial to retain these IDs, as they will be used in subsequent steps to fetch relevant recommendations for your users.
- Create Segmented Rules for Recommendations in KMC
- Once your segments are configured, you can begin setting up recommendation rules in KMC tailored to these segments. Please refer to this detailed guide.
- For example, you might create a rule that promotes certain products to users who have previously shown interest in a specific category, such as "electronics" or "sports apparel."
Implementing Custom Segments on Your Website
- Identify and Pass Segment IDs for Each Visitor
- On your website, you will need to implement logic to determine the applicable segment(s) for each user. This determination could be made using your own CRM system, marketing database, or any custom segmentation logic you use.
- After identifying the user's segment(s), use the corresponding Klevu segment ID(s) to configure your recommendation requests. This can be done through the Klevu Recommendation Configuration API, ensuring each user gets a customized set of product recommendations based on the segments they belong to.
- Fetch Personalized Recommendations Using Segment IDs
- Once the segment IDs are available, include them in the request to the Klevu Recommendation Configuration API.
- Klevu will use these segment IDs to serve a relevant configuration payload, which will then power the personalized recommendations displayed to the user.
- Endpoint to Fetch Recommendations Based on Segment IDs:
- Full reference: https://docs.klevu.com/apis/smart-recommendations-configurations
- Endpoint (GET): https://config-cdn.ksearchnet.com/recommendations/<KLEVU_API_KEY>/settings/<KLEVU_RECS_KEY>
- Parameters:
sids=<SEGMENT_ID_A>,<SEGMENT_ID_B> (Segment IDs) - Response Example:
{ "metadata": { "title": "Recommended For You", "recsKey": "<KLEVU_RECS_KEY>", "pageType": "HOME", "logic": "RECENTLY_VIEWED", "maxProducts": 10, "spotKey": "<KLEVU_SPOT_KEY>", "segmentKey": "<SEGMENT_ID_A>" }, "search": { "basePath": "<KLEVU_SEARCH_DOMAIN>.ksearchnet.com/cs/v2/search", "payload": "{\"recordQueries\":[{\"id\":\"klevuRECSItemList\",\"typeOfRequest\":\"SEARCH\",\"settings\":{\"typeOfRecords\":[\"KLEVU_PRODUCT\"],\"limit\":10}}]}" } }
Optimizing Performance with Segment Mapping and Caching
- Maintain Segment Mapping for Efficiency
- To make the process efficient, it's recommended that merchants maintain a mapping of their custom segments with the Klevu segment IDs in their system.
- Implementing client-side caching, such as using local storage, can help store this mapping for each visitor. This approach reduces the need to recalculate the segments for every page visit, improving the page loading speed and the overall user experience.
- For instance, when a user revisits your site, you can quickly retrieve their segment information from local storage and use it to configure the recommendation request, avoiding repeated API calls and reducing server load.
Tracking Analytics Events for Proper Monitoring
To ensure that you are capturing valuable insights from your personalized recommendations, it is crucial to send analytics events to Klevu. This allows you to track impressions, user interactions, and the overall effectiveness of the recommendations.
- Recommendation Impressions
- Endpoint: https://stats.ksearchnet.com/analytics/collect
- Payload:
[ { "event": "view_recs_list", "event_apikey": "<KLEVU_RECS_KEY>", "user_profile": { "session_id": "<KLEVU_SESSION_ID>" }, "event_data": { "tags": [ "recsPageType:HOME" ], "list_id": "<KLEVU_RECS_KEY>", "list_name": "Recommended For You", "list_logic": "RECENTLY_VIEWED", "spot_id": "<KLEVU_SPOT_KEY>", "segment_id": "<SEGMENT_ID_A>", "items": [ { "item_id": "12345", "item_name": "Product Name", "price": "25.0", "currency": "USD" } ] } } ]
- Purpose: This event tracks the impressions of the recommendation banner to monitor how often it is being viewed by users.
- Product Clicks from Recommendations
- Endpoint: https://stats.ksearchnet.com/analytics/collect
- Payload:
[ { "event": "select_recs_list", "event_apikey": "<KLEVU_RECS_KEY>", "user_profile": { "session_id": "<KLEVU_SESSION_ID>" }, "event_data": { "tags": [ "recsPageType:HOME" ], "list_id": "<KLEVU_RECS_KEY>", "list_name": "Recommended For You", "list_logic": "RECENTLY_VIEWED", "spot_id": "<KLEVU_SPOT_KEY>", "segment_id": "<SEGMENT_ID_A>", "items": [ { "item_id": "12345", "item_name": "Product Name", "price": "25.0", "currency": "USD" } ] } } ]
- Purpose: This event records whenever a user clicks on a product from the recommendations, providing insights into user engagement.
Conclusion
Following this approach allows you to leverage your existing segmentation strategies, improve efficiency with local caching, and create more meaningful interactions with your customers.