Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix perso event names #2554

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

Fix perso event names #2554

wants to merge 5 commits into from

Conversation

adriendupuis
Copy link
Contributor

@adriendupuis adriendupuis commented Nov 28, 2024

Question Answer
JIRA Ticket
Versions
Edition

Fix personalization event names capitalization and code style.

Preview: https://ez-systems-developer-documentation--2554.com.readthedocs.build/en/2554/personalization/api_reference/tracking_api/

Checklist

  • Text renders correctly
  • Text has been checked with vale
  • Description metadata is up to date
  • Redirects cover removed/moved pages
  • Code samples are working
  • PHP code samples have been fixed with PHP CS fixer
  • Added link to this PR in relevant JIRA ticket or code PR

Comment on lines 361 to 362
{
"recommendationItems": [
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should provide a full response here, in an external file, not an extract. And, if needed, highlight lines related to the topic.

}
}
]
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -387,7 +373,7 @@ See [Recommendation API](recommendation_api.md) for more details.
A trigger message includes requests for a Triggeropened and Clicktriggered event.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use the properties of the trigger message below, triggerOpenedLink and clickTriggered?

@@ -355,24 +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).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not "clickRecommended" has in the example below?

Suggested change
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).
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).

It's probably its label name instead of its property name. Could be "Click recommended" in this case, a bit like "Clicked recommended" from its summary https://github.com/ibexa/personalization/blob/v4.6.14/src/lib/Value/Performance/Summary/Event.php#L19

Or all-caps "CLICKRECOMMENDED" like in https://doc.ibexa.co/projects/userguide/en/master/personalization/event_types/

Comment on lines 378 to 379
Example of a trigger message:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is again a JSON sample without consideration for parse errors.
I didn't find a test or other reference for this one.

Copy link

code_samples/ change report

Before (on target branch)After (in current PR)

code_samples/personalization/response-body.json


code_samples/personalization/response-body.json

docs/personalization/api_reference/tracking_api.md@360:``` json
docs/personalization/api_reference/tracking_api.md@361:[[= include_file('code_samples/personalization/response-body.json', 1, 16) =]]
docs/personalization/api_reference/tracking_api.md@362:```

001⫶ "recommendationItems": [
002⫶ {
003⫶ "relevance": 23,
004⫶ "itemType": 1,
005⫶ "itemId": 100175717,
006⫶ "origin": {
007⫶ "itemIds" : [10, 11],
008⫶ "itemType" : 1,
009⫶ "source" : "REQUEST"
010⫶ },
011⫶ "category" : "Men/Shirts",
012⫶ "links" : {
013⫶ "clickRecommended" : "//event.perso.ibexa.co/clickrecommended/johndoe/1/100175717?scenario=also_clicked&modelId=37",
014⫶ "rendered" : "//event.perso.ibexa.co/rendered/johndoe/1/100175717"
015⫶ }

Download colorized diff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant