Expand my Community achievements bar.

SOLVED

How can I insert custom code into the Adobe Experience Platform Web SDK - Send event action?

Avatar

Level 1

Hi everyone, right now I'm migrating my old implementations with data element XDM object. I'm working on inserting the list var and I'm currently having some implementation and data collection problems.

 

First step I have a list var that contains 11 items. I set the data element containing the reference array inside the xdm object.

 

Second step I then loaded the xdm object data element into the rule action by selecting Adobe Experience Platform Web SDK - Send event. I have specific conditions for listvar tracking and I would need to insert a custom javascript code that finalizes the tracking.

 

Can anyone tell me if there is a way to insert a custom code inside the Adobe Experience Platform Web SDK - Send event or if we need to use some other type of action in addition?

1 Accepted Solution

Avatar

Correct answer by
Level 2

Hello,

I think the better to do what you want is to use conditions on a rule to update your XDM.
More info in this Jim Gordon's video
https://www.youtube.com/watch?v=PdV8c2lmd-0

 

Best regards

View solution in original post

3 Replies

Avatar

Correct answer by
Level 2

Hello,

I think the better to do what you want is to use conditions on a rule to update your XDM.
More info in this Jim Gordon's video
https://www.youtube.com/watch?v=PdV8c2lmd-0

 

Best regards

Avatar

Level 2

@cosneg  The best way to handle list var in Web SDK is to create a data element that ingest list values from your data layer (let's say array), parse and transform into the format that Web SDK expects.

 

 

 

if (yourList && yourList.length > 0) {
  return yourList.map(item => ({ value: item }));
}

 

 

 

 

Above data element will transform your array such as ["item1", "item2", "item3"] to 
[ { "value": "item1" }, { "value": "item2"}, { "value": "item3"} ]

Now just map your above data element to your web sdk list var. Refer the attached screenshot:

rajdsingh_0-1709772458039.png

 

 

Avatar

Employee

Hi @cosneg - May be you can use the Data option as shown in screenshot and merge the other object (Merged Object Data Element) with XDM object before sending data.

ArijitAJ_0-1710409859770.png

ArijitAJ_1-1710409914052.png