From c553a1570d9f86370da67e902409639d60258f54 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 28 Nov 2024 17:05:15 +0100 Subject: [PATCH] Move recommendationItems JSON to included file --- .../personalization/response-body.json | 19 ++++++++++++++++ .../api_reference/tracking_api.md | 22 ++----------------- 2 files changed, 21 insertions(+), 20 deletions(-) create mode 100644 code_samples/personalization/response-body.json diff --git a/code_samples/personalization/response-body.json b/code_samples/personalization/response-body.json new file mode 100644 index 0000000000..1e061db4b9 --- /dev/null +++ b/code_samples/personalization/response-body.json @@ -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" + } + } + ] +} diff --git a/docs/personalization/api_reference/tracking_api.md b/docs/personalization/api_reference/tracking_api.md index 3071d9b71f..4dde0c967f 100644 --- a/docs/personalization/api_reference/tracking_api.md +++ b/docs/personalization/api_reference/tracking_api.md @@ -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 |