Hello Adobe Experts,
I hope everyone is doing well.
I would like to get your insights as to why the data that are passing to the Network Payload and adobeDataLayer console are showing 2 different results.
In the screenshot in Green Box, it shows that the dealers containing 5 array results. But the one in Red Box, the array value is empty [].
Do you know any possible scenarios as to why this issue is happening?
Thank you in advance.
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
The payload in the Network request is most likely due to the value being obtained from ACDL's computed state.
When you push arrays into ACDL, ACDL computes the final array state as the concatenation of all previous array pushes for the same key. For example:
adobeDataLayer.push({
myArr: ['foo']
});
adobeDataLayer.push({
myArr: ['bar']
});
adobeDataLayer.push({
myArr: ['baz']
});
/**
* Resulting ACDL computed state:
*
* {
* myArr: ['foo', 'bar', 'baz']
* }
*/
If your intention is to clear out your array, then you should push "null", i.e.:
adobeDataLayer.push({
myArr: ['foo']
});
adobeDataLayer.push({
myArr: ['bar']
});
adobeDataLayer.push({
myArr: ['baz']
});
/**
* Resulting ACDL computed state:
*
* {
* myArr: ['foo', 'bar', 'baz']
* }
*/
adobeDataLayer.push({
myArr: null
});
/**
* Resulting ACDL computed state:
*
* {}
*/
Read the doc for more info: https://github.com/adobe/adobe-client-data-layer/wiki#pushing-an-object-to-delete-data
Views
Replies
Total Likes
Hi @Herder ,
I could think of two reasons for this to happen,
1. The data element used to populate the network payload is persisting the previously stored value
2. adobeDataLayer is getting cleared after the payload shown in network is sent
I'd suggest trying few things,
1. Console log the adobeDataLayer and Data Element values before sending the call to validate if they both have values and they match
2. Try resetting the data element before sending the call
Cheers!
Views
Replies
Total Likes
The payload in the Network request is most likely due to the value being obtained from ACDL's computed state.
When you push arrays into ACDL, ACDL computes the final array state as the concatenation of all previous array pushes for the same key. For example:
adobeDataLayer.push({
myArr: ['foo']
});
adobeDataLayer.push({
myArr: ['bar']
});
adobeDataLayer.push({
myArr: ['baz']
});
/**
* Resulting ACDL computed state:
*
* {
* myArr: ['foo', 'bar', 'baz']
* }
*/
If your intention is to clear out your array, then you should push "null", i.e.:
adobeDataLayer.push({
myArr: ['foo']
});
adobeDataLayer.push({
myArr: ['bar']
});
adobeDataLayer.push({
myArr: ['baz']
});
/**
* Resulting ACDL computed state:
*
* {
* myArr: ['foo', 'bar', 'baz']
* }
*/
adobeDataLayer.push({
myArr: null
});
/**
* Resulting ACDL computed state:
*
* {}
*/
Read the doc for more info: https://github.com/adobe/adobe-client-data-layer/wiki#pushing-an-object-to-delete-data
Views
Replies
Total Likes
Hi @Herder,
Were you able to resolve this query with the help of the provided solutions, or do you still need further assistance? Please let us know. If any of the answers were helpful in moving you closer to a resolution, even partially, we encourage you to mark the one that helped the most as the 'Correct Reply.'
Thank you!
Views
Replies
Total Likes
Views
Likes
Replies