Weekly live AEP workshops every Friday - reserve your seat →
Student question · Web SDK

How to capture ECID in an Adobe Tags data element

How to read ECID with Web SDK getIdentity, store it with _satellite.setVar, expose it as a data element and validate it in the browser console.

Quick answer

To use ECID in Adobe Tags, call Web SDK getIdentity, store the returned ECID with _satellite.setVar in a rule, and create a custom-code data element that returns _satellite.getVar('ECID'). Reference it as %ECID% in other rules, and validate it in the browser console with _satellite.getVar and the Tags debugger.

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:

Ready to move your Adobe MarTech program forward?

Consulting for enterprise teams, training for professionals. Tell us where you are today.

WhatsApp