Custom code in "Set Variable" section executing asynchronously
Hi All,
We have recently migrated our property from Adobe DTM to Launch. I have a direct call rule, in which evars and props are set using mapping at UI level in Launch, however events and products are set in the custom code of same section "Set Variables" under Action in launch.
Now , the call to DCR has been written like this in code controller :
try {
window._satellite.track('commonsPageLoad');
} catch (error) {
console.error(error);
} finally {
window.digitalData = {};
}
Here, before DCR fully gets executet ,i.e., before image request getting fired , datalayer gets emptied from finally block. It results in loss of data , when image request is fired
Is it due to custom code executing asynchronously ? Can anyone please help on this, what needs to be done.