The Experience Cloud Identity (ECID) is a persistent identifier for a visitor to your website. In certain circumstances, you might prefer to access the ECID (to send it to a third party, for example).
To access the ECID within tags, Adobe recommends the following:
Ensure your property is configured with rule component sequencing enabled.
Create a new rule.
Add a Library Loaded event to the rule.
Add a Custom Condition action to the rule with the following code (assuming the name you’ve configured for the SDK instance is alloy
):
return alloy("getIdentity")
.then(function(result) {
_satellite.setVar("ECID", result.identity.ECID);
});
Save the rule.
You should then be able to access the ECID in subsequent rules using %ECID%
or _satellite.getVar("ECID")
like you would any other data element.