This quickstart guide gives a basic overview of how the personalization engine works and how it is typically enabled. Following is an example for the integration in an e-commerce shop.
How it works¶
The idea of the recommendation engine is quite simple and built upon four main steps.
A User visits an online shop, navigates through it and leaves some footprints. The most popular footprints are selecting and purchasing products (1). This information is sent to the event tracker service of the recommendation engine every time these events happen (2). The recommendation engine accumulates the tracked events, categorizes them and calculates recommendations for every product and every user in the shop (3). All recommendations are available over the recommender service. They can be fetched and presented to users during their sessions or sent out e.g. as a newsletter (4).
Integration is based on the following:
- activation of user tracking (we respect privacy rules and never store any data related to a person, every event is anonymized)
- embedding recommendations into a website.
Below we use the mandator ID '00000' for creating requests. You must substitute it with your own ID which is generated and sent to you by mail at the end of a successful registration process under https://admin.yoochoose.net.
Step one is called tracking. Every page must call special tracking URL. The simplest way is to place a tiny image on every product page, just as it is usually done for analytic tools or visitor counter. It looks like this:
<img href="https://event.yoochoose.net/ebl/00000/click/john.smith/1/123" width="1" height="1">
Replace "john.smith" with the user ID or session ID of the user currently signed in on your website (any URL encoded string is allowed). Replace "123" with the ID of the content you want to track and later on recommend.
The following code snippets provide example code for the integration of a click event:
1 2 3 4 5
1 2 3 4 5 6
A similar tracking image must be placed on the confirmation page after the payment process.
1 2 3 4 5
Depending on the page impressions/visits the recommendation engine has soon collected enough events and is able to generate recommendations. The more tracking data is available, the better and sharper the recommendations will be. Recommendations can be fetched using following calls, the response is returned as JSON.
Returns the most popular products.
https://reco.yoochoose.net/api/v2/00000/john.smith/cross_sell.json?contextitems=OWNS,CLICKED Returns products the current user (here "
john.smith") is most probably interested in, so-called personalized recommendations.
Returns products most probably interesting for any user who is interested in product 123.
Example result with two recommendations:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
Here is a small PHP snippet for making request and parsing results:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
For the most simple but still very effective recommendations the steps described above are sufficient. Tracking more events, using additional parameters and custom scenario configurations enable features like:
- Filtering recommendations based on category
- Getting usage and revenue statistics
- Recommendations based on the shopping basket
- Filtering repeated recommendations
Additional features are available for the Advanced edition of the recommendation engine:
- A/B testing
- Personalized Search
- Using "rate" and "like" events
- Additional models such as content-based, random, history etc.
- Multiple product types (for example food/non-food or article/image/video) and cross-type recommendations
- Price-based filtering (do not recommend cheap products)
- Grouping products by custom attributes (size, color, source, theme etc.)
More detailed information can be found in the User Guide.