-
Notifications
You must be signed in to change notification settings - Fork 42
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
Add storefront events SDK and collector #21
Conversation
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
|
|
…nto event-collector
@@ -0,0 +1,5 @@ | |||
const fs = require('fs'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@herzog31 you can probably add this file to the .hlxignore
list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion. Fix available in #45.
@@ -29,5 +30,9 @@ | |||
"eslint-plugin-import": "2.29.1", | |||
"stylelint": "16.1.0", | |||
"stylelint-config-standard": "36.0.0" | |||
}, | |||
"dependencies": { | |||
"@adobe/magento-storefront-event-collector": "^1.7.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@herzog31 Is it ok to use versions 1.8.0 for @adobe/magento-storefront-event-collector
and @adobe/magento-storefront-events-sdk
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you can use newer versions.
|
||
// Load events SDK and collector | ||
import('./commerce-events-sdk.js'); | ||
import('./commerce-events-collector.js'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@herzog31 Since this is all delayed, does it mean that any event occurring after 3s will not be collected ? E.g. if the user clicks away or closes the window before this is loaded ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a user leaves the page before this is loaded, the events will not be collected. That's correct and unfortunately a known limitation.
There are some ideas to fix this in https://git.corp.adobe.com/mabecker/acdl2 which can persist events in session storage to make sure they can be collected on the next page. But this will take some more work and will be added to the mainline ACDL in the near future.
@adobe/magento-storefront-event-collector
.@adobe/magento-storefront-events-sdk
(only as dependency for collector)./scripts
folder to allow for easy updating.eventInfo
field which contains a copy of the current ACDL state. This field does not exist when writing to ACDL directly. This is addressed in Add recommendations block with ACDL #11 which needs to be merged beforehand.Test URLs: