Do you know a way how to use a browser console in order to debug productListItems array?
Maybe there is another way?
I would like to create abandon basket mailing and even though I put there a loop I constantly see in the email only last product ...
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Well I would say it depends on your business use case if your business would like to know what specific product users are adding to their cart then only send product info of product which user are adding to the cart(single event), you need to trigger an event on click of Add to Cart button on the page, the next action will depends on the UI/UX of the your website if after adding a product to cart cart page is also loading by default then you can trigger a cart view event and send all the items details available in the cart.
You can refer to the schema document for more details on eventType field.
I hope this will help.
In the WebSDK extension, there is a "on before event send" section where you can print out the data that is to be sent to the edge network before the request is made.
maybe a good starting point.
Cheers,
Björn
but productListItems is the array so only last product is visible not the whole array
if you set all products in the array they should be visible there, or do I not fully get the question?
Do you mean products from previous calls?
Views
Replies
Total Likes
You can use alloy("setDebug", {"enabled": true}); command on console to enable debug mode and filter console with XDM and validate your schema on the console however you can also use network tab or debugging tools like Omnibug for a better readability and view.
Also, if you are only getting a single item in the productListItems variable it seems like like there is an issues in the code you've configured to capture product details, I would recommend using JavaScript map() function to loop through the array in the data layer and create a data element to capture before setting it into XDM variable.
few links for reference.
How to Use the JS .map() Function freecodecamp
Let me know if you need an example code if can create a sample as well which you can refer to will happy to share if required.
Thank you for your reply.
Could you advise me how you would implement add to cart event?
Assuming that I have 2 products already in the cart. If the user add the third one then I should iterate through data layer cart item and send with the thrid one also two previous ones to productListItems? How you would do that? Unfortunately in my org we dont have yet any AEP master so I do appreciate your help!
Views
Replies
Total Likes
Well I would say it depends on your business use case if your business would like to know what specific product users are adding to their cart then only send product info of product which user are adding to the cart(single event), you need to trigger an event on click of Add to Cart button on the page, the next action will depends on the UI/UX of the your website if after adding a product to cart cart page is also loading by default then you can trigger a cart view event and send all the items details available in the cart.
You can refer to the schema document for more details on eventType field.
I hope this will help.
Hi @Michael_Soprano ,
no, if you have previously sent two products in an add to cart event, you only have to send the third one in that additional call.
Thanks. But to understand that 100% correctly one more thing. If I would like to make abandon basket using AJO then AEP stores at the back-end all products added to the cart?
Views
Replies
Total Likes
Yes, that should be the case with AEP being the data lake that AJO is working with.
here are a bunch of diagrams about data flows in the AEP. In general, I think it's safe to say that events and profiles are accessible in AJO.
Views
Replies
Total Likes
Views
Likes
Replies