Rule action: read and store ECID
alloy("getIdentity").then(function (result) {
if (result && result.identity && result.identity.ECID) {
_satellite.setVar("ECID", result.identity.ECID);
}
});Data element: custom code
return _satellite.getVar("ECID");Use it anywhere as %ECID%.
Validate
_satellite.setDebug(true)to enable Tags debugging_satellite.getVar("ECID")in the console- Check the identity section of the Edge request in the AEP Debugger
Timing matters
ECID is available only after the identity call resolves. Rules that need it should run after the rule that stores it, or wait for a custom event.
Frequently asked questions
Why does my ECID data element return undefined?
The rule using it ran before getIdentity resolved, or consent blocked identity. Sequence the rules or fire a custom event after storing it.
Last updated: