From 71c6d202220ea0bd79e5ada30ae09979cc0725d0 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 28 Nov 2024 15:07:14 +0100 Subject: [PATCH 1/5] =?UTF-8?q?triggername=20=E2=86=92=20triggerName?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/personalization/api_reference/tracking_api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/personalization/api_reference/tracking_api.md b/docs/personalization/api_reference/tracking_api.md index 3c62742e24..9350154308 100644 --- a/docs/personalization/api_reference/tracking_api.md +++ b/docs/personalization/api_reference/tracking_api.md @@ -387,7 +387,7 @@ See [Recommendation API](recommendation_api.md) for more details. A trigger message includes requests for a Triggeropened and Clicktriggered event. The first is executed once, when the end user opens a trigger message (for example, embedded into a newsletter). The second is called each time the user follows a link to see the recommended item. -Both requests provide the `triggername` parameter, which passes a unique alphanumerical identifier of the trigger that initiated the message. +Both requests provide the `triggerName` parameter, which passes a unique alphanumerical identifier of the trigger that initiated the message. Example of a trigger message: From 338936796f546b2fe3411de2caf89bf3f40f1c48 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 28 Nov 2024 15:07:49 +0100 Subject: [PATCH 2/5] Remove unneeded space from end of line --- docs/personalization/api_reference/tracking_api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/personalization/api_reference/tracking_api.md b/docs/personalization/api_reference/tracking_api.md index 9350154308..55c702b946 100644 --- a/docs/personalization/api_reference/tracking_api.md +++ b/docs/personalization/api_reference/tracking_api.md @@ -444,7 +444,7 @@ The request parameters are: |`scenario`|Name of the scenario, where recommendations originated from. This parameter is required.|URL-encoded alphanumeric| The scenario parameter identifies the originating scenario to gain detailed statistics about the scenario that motivated the user to click on a recommendation. -This information comes with the recommendation from the recommendation controller.  +This information comes with the recommendation from the recommendation controller. The event is used for providing statistics about how often users accepted the recommendations of the configured recommendation scenario or considered them as valuable. From e087fc508049efed078bc5902b1b723eab90ce7f Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 28 Nov 2024 16:31:40 +0100 Subject: [PATCH 3/5] Fix recommendationItems JSON syntax To see if this is why my changes are marked as invalid by GitHub --- docs/personalization/api_reference/tracking_api.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/personalization/api_reference/tracking_api.md b/docs/personalization/api_reference/tracking_api.md index 55c702b946..3071d9b71f 100644 --- a/docs/personalization/api_reference/tracking_api.md +++ b/docs/personalization/api_reference/tracking_api.md @@ -358,7 +358,8 @@ Sending Rendered events causes as many requests as recommendations to be display Example of a recommendation response: ``` json -"recommendationItems": [ +{ + "recommendationItems": [ { "relevance": 23, "itemType": 1, @@ -372,7 +373,10 @@ Example of a recommendation response: "links" : { "clickRecommended" : "//event.perso.ibexa.co/clickrecommended/johndoe/1/100175717?scenario=also_clicked&modelId=37", "rendered" : "//event.perso.ibexa.co/rendered/johndoe/1/100175717" - }, + } + } + ] +} ``` | Field name | Description | 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 4/5] 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 | From 0f77e7665321fc5e5fc8330010d994207636b911 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Fri, 29 Nov 2024 09:14:28 +0100 Subject: [PATCH 5/5] tracking_api.md: Fix suspicious typo in trigger message example --- docs/personalization/api_reference/tracking_api.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/personalization/api_reference/tracking_api.md b/docs/personalization/api_reference/tracking_api.md index 4dde0c967f..170ab10115 100644 --- a/docs/personalization/api_reference/tracking_api.md +++ b/docs/personalization/api_reference/tracking_api.md @@ -380,7 +380,7 @@ Example of a trigger message: ``` json "customerID":"177751", "userExternalId":"user@ibexa.co", - "triggerType":"REACTIVATION|ABANDAONED_SHOPPING_CART", + "triggerType":"REACTIVATION|ABANDONED_SHOPPING_CART", "triggerName":"trigger_ref_code", "triggerOpenedLink":"//event.perso.ibexa.co/api/17751/triggeropened/johndoe?triggername=action_trigger_ref_code", "recommendations":[ @@ -389,8 +389,8 @@ Example of a trigger message: "itemType":46, "clickRecommended":"//event.perso.ibexa.co/api/17751/clicktriggered/johndoe/46/959?triggername=action_trigger_ref_code", "attributes":{ - "ses_name":"Minimalista Coffee Table", - "ses_image":["img_1", "img_2"] + "ses_name":"Minimalist Coffee Table", + "ses_image":["img_1", "img_2"] } } ]