Hi there,
I am trying to use Event Forwarding to send data to other systems dynamically. The scenario is multi-brand, so I have different XDM schema fields referring to the same concept (e.g.: identities.brand1.ecid, identities.brand2.ecid). I want Event Forwarding to adapt the request depending on the origin (brand) of the data, so I have decided to create a dynamic Data Element via custom JS code:
let ecid;
var xdmObject = getDataElementValue('arc.event.xdm');
if(xdmObject){
if (url.includes("brand1.com")) {
ecid = xdmObject._sandboxname.identities.brand1.profile.ecid.id;
} else if (url.includes("brand2.com")) {
ecid = xdmObject._sandboxname.identities.brand2.profile.ecid.id;
} else {
// Handle cases where the URL does not match any known hosts
console.warn('Unknown host in URL:', url);
ecid = "";
}
}
return ecid
Nevertheless, when I try to Build the code I get the next error:
There was an error minifying your custom code.
Referenced DataElements are not added to the build: arc.event.xdm
Where am I doing wrong? I was assuming "arc.event.xdm" could be directly accessed from Event Forwarding custom code. Could you please provide some guidance on this?
Thanks in advance