jkevan commented on code in PR #10:
URL: https://github.com/apache/unomi-tracker/pull/10#discussion_r982579842
##########
src/apache-unomi-tracker.js:
##########
@@ -728,7 +728,18 @@ export const newTracker = () => {
event.initCustomEvent(name, canBubble, cancelable, detail);
document.dispatchEvent(event);
},
-
+ /**
+ * Fill the window.digitalData.displayedVariants with the javascript
event passed as parameter
+ * @param {object} jsEvent javascript event
+ * @private
+ * @return {undefined}
+ */
+ _fillDisplayedVariants: (jsEvent) => {
+ if (!window.digitalData.displayedVariants) {
+ window.digitalData.displayedVariants = [];
+ }
+ window.digitalData.displayedVariants.push(jsEvent);
Review Comment:
digitalData is not stored in the window like it use to be when the tracker
was in wem.js in jExperience.
Now the digitallData is stored in the tracker itself.
So this cannot work properly if the tracker is used outside jExperience.
(jExperience is using a callback to store it in the window, but this should
not be done in the tracker directly.)
So you could just replace **window** by: **wem** here.
And it should work properly.
Take a look at jExperience callbacks to si how jExperience is catching the
result of wem.digitallData.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]