Difficulty Implementing "user.endpoint.lastPurchasedEntity" and Creating Cart Addition List in Web SDK via Tags | Community
Skip to main content
ZvoidZ
New Participant
January 8, 2024
Solved

Difficulty Implementing "user.endpoint.lastPurchasedEntity" and Creating Cart Addition List in Web SDK via Tags

  • January 8, 2024
  • 1 reply
  • 917 views

I am encountering challenges with the implementation of "user.endpoint.lastPurchasedEntity" using the Web SDK via tags in Adobe Target. My approach involves creating a new XDM (Experience Data Model) object and integrating it within a 'send event' function.

Within this XDM object in the 'send event', I am including several key elements:

  • 'priceTotal' and 'purchaseID' within the commerce field.
  • Setting the 'purchases' value to 1.
  • Integrating an identity map.
  • Adding 'productListItems'.

     

Despite closely following the Adobe documentation (Adobe Experience League), I am not seeing the desired result. The 'lastPurchasedEntity' is not being reflected in the user profile as it did when I was using at.js, where parameters such as orderId, orderTotal, and productPurchasedId were passed effortlessly.

 

I would greatly appreciate any insights or advice on setting up these features correctly using the Web SDK.

Thank you very much for your assistance.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by alexbishop

My understanding is that the event will only be shared downstream to the Target service if it includes a value in the decisionScopes array. So the documentation looks like it might be misleading.

A code example would be:

 

alloy("sendEvent", { "xdm": { "commerce": { "order": { "purchaseID": "ABC123", "priceTotal": 1337.89 }, "purchases": { "value": 1 } }, "productListItems": [{ "SKU": "SKU-00002" }] }, decisionScopes: ["purchase"] });

 

 
If you're configuring it via the tag manager then you would just need to ensure your sendEvent action has a decisionScopes value. I've tested this in my sandbox environment and I see the user.endpoint.lastPurchasedEntity parameter being populated as expected

1 reply

alexbishop
alexbishopAccepted solution
Employee
January 18, 2024

My understanding is that the event will only be shared downstream to the Target service if it includes a value in the decisionScopes array. So the documentation looks like it might be misleading.

A code example would be:

 

alloy("sendEvent", { "xdm": { "commerce": { "order": { "purchaseID": "ABC123", "priceTotal": 1337.89 }, "purchases": { "value": 1 } }, "productListItems": [{ "SKU": "SKU-00002" }] }, decisionScopes: ["purchase"] });

 

 
If you're configuring it via the tag manager then you would just need to ensure your sendEvent action has a decisionScopes value. I've tested this in my sandbox environment and I see the user.endpoint.lastPurchasedEntity parameter being populated as expected

ZvoidZ
ZvoidZAuthor
New Participant
January 18, 2024

Hi Alex, you're absolutely right. I've been implementing this through tags and included the decisionScopes, but the user.endpoint.lastPurchasedEntity parameter still wasn't appearing for some reason. So, I created an activity with a code offer and used the value: ${user.endpoint.lastPurchasedEntity}. After this change, it started to populate correctly. Additionally, I found that even after deactivating the activity, it continued to function normally.

Thanks once again for your guidance!