Skip to content

Commit

Permalink
Move recommendationItems JSON to included file
Browse files Browse the repository at this point in the history
  • Loading branch information
adriendupuis committed Nov 28, 2024
1 parent e087fc5 commit c553a15
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
19 changes: 19 additions & 0 deletions code_samples/personalization/response-body.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"recommendationItems": [
{
"relevance": 23,
"itemType": 1,
"itemId": 100175717,
"origin": {
"itemIds" : [10, 11],
"itemType" : 1,
"source" : "REQUEST"
},
"category" : "Men/Shirts",
"links" : {
"clickRecommended" : "//event.perso.ibexa.co/clickrecommended/johndoe/1/100175717?scenario=also_clicked&modelId=37",
"rendered" : "//event.perso.ibexa.co/rendered/johndoe/1/100175717"
}
}
]
}
22 changes: 2 additions & 20 deletions docs/personalization/api_reference/tracking_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,28 +355,10 @@ The first one is executed when a recommendation is shown to the user.
The second is called when a recommendation is clicked or otherwise accepted.
Sending Rendered events causes as many requests as recommendations to be displayed, a Clickrecommended event is usually sent only once (when a user clicks on a specific recommendation item).

Example of a recommendation response:
Sample of a recommendation response:

``` json
{
"recommendationItems": [
{
"relevance": 23,
"itemType": 1,
"itemId": 100175717,
"origin": {
"itemIds" : [10, 11],
"itemType" : 1,
"source" : "REQUEST"
},
"category" : "Men/Shirts",
"links" : {
"clickRecommended" : "//event.perso.ibexa.co/clickrecommended/johndoe/1/100175717?scenario=also_clicked&modelId=37",
"rendered" : "//event.perso.ibexa.co/rendered/johndoe/1/100175717"
}
}
]
}
[[= include_file('code_samples/personalization/response-body.json', 1, 16) =]]
```

| Field name | Description |
Expand Down

0 comments on commit c553a15

Please sign in to comment.