Expand my Community achievements bar.

Help shape the future of AI assistance by participating in this quick card sorting activity. Your input will help create a more effective system that better serves your needs and those of your colleagues.
SOLVED

ECID Implementation in Web SDK

Avatar

Level 1

Hi Team,

Could you please help me implementing ECID using webs SDK?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

bjoern__koth_0-1733473449145.png

 

Cheers from Switzerland!


View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

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

bjoern__koth_0-1733473449145.png

 

Cheers from Switzerland!