ECID Implementation in Web SDK | Community
Skip to main content
New Member
December 6, 2024
Solved

ECID Implementation in Web SDK

  • December 6, 2024
  • 1 reply
  • 976 views

Hi Team,

Could you please help me implementing ECID using webs SDK?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by bjoern__koth

Hi @shashi15 

may I ask first how you are intending to use it? Do you want to send it to for instance Adobe Analytics or do you want to use it in other non-Adobe tools?

 

You can find the documentation here

 

Basically, you have two options

 

1. Using a Launch Data Element

  • this is a little tricky since alloy calls are asynchronous, so there is a chance that this call has not been finished if you are trying to evaluate it on the fly
  • typically, you will want to execute this as early as possible i.e., when the Launch library loads. Also, to not have to make this call every single time, it's recommended to persist this value in e.g., sessionStorage or a cookie and only make the call when it's not set. This will also improve the async problem a little
alloy("getIdentity") .then((result) => result?.identity?.ECID) .catch((error) => { // The command failed. // "error" will be an error object with additional information. _satellite.logger.error(">>> alloy ecid error", error); });

 2. Using datastream mapping via Data Prep (recommended)

  • every call from the Web SDK into the Experience Platform automatically contains the ECID value
  • if you want to map the ECID to a prop or eVar in Adobe Analytics, you can simply set up the mapping in the datastream. Note that the prefix "_experience.analytics.customDimensions" will make sure that anything below is properly mapped into AA

 

1 reply

bjoern__koth
Community Advisor and Adobe Champion
bjoern__kothCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
December 6, 2024

Hi @shashi15 

may I ask first how you are intending to use it? Do you want to send it to for instance Adobe Analytics or do you want to use it in other non-Adobe tools?

 

You can find the documentation here

 

Basically, you have two options

 

1. Using a Launch Data Element

  • this is a little tricky since alloy calls are asynchronous, so there is a chance that this call has not been finished if you are trying to evaluate it on the fly
  • typically, you will want to execute this as early as possible i.e., when the Launch library loads. Also, to not have to make this call every single time, it's recommended to persist this value in e.g., sessionStorage or a cookie and only make the call when it's not set. This will also improve the async problem a little
alloy("getIdentity") .then((result) => result?.identity?.ECID) .catch((error) => { // The command failed. // "error" will be an error object with additional information. _satellite.logger.error(">>> alloy ecid error", error); });

 2. Using datastream mapping via Data Prep (recommended)

  • every call from the Web SDK into the Experience Platform automatically contains the ECID value
  • if you want to map the ECID to a prop or eVar in Adobe Analytics, you can simply set up the mapping in the datastream. Note that the prefix "_experience.analytics.customDimensions" will make sure that anything below is properly mapped into AA

 

Cheers from Switzerland!