AEP - Marketing Cloud Visitor ID question | Community
Skip to main content
Franc_G
Level 4
June 25, 2024
Solved

AEP - Marketing Cloud Visitor ID question

  • June 25, 2024
  • 1 reply
  • 2367 views

Hi all, I have a tag in our custom implementation, which sets the marketing cloud id . Can someone explain me what happens in case of marketing cloud ids in case of web sd. Thanks

 

Custom code from the tag is provided below. 

 

var sendAdobePageViewCall = function () { setTimeout( function () { if ( typeof window.AdCloudEvent === "function" && typeof this.exec === "function" && this.pre && this.pre.length ) { try { // Forces use of SSL in all cases window.AppMeasurement.getInstance(window.s.account).ssl = true; // Persists MID using 'mid' query parameter, cookie or localStorage var mid = location.href.match(/mid=([^&\?]+)/i) || Bootstrapper.Cookies.get("aa_mid") || window.localStorage.getItem("ens_mid") || window.localStorage.getItem("marketingCloudVisitorId"); if (mid && mid.length) { var forcedMid = Array.isArray(mid) ? mid[1] : mid; window.visitor.setMarketingCloudVisitorID(forcedMid); } } catch (e) {} Bootstrapper.AF.push(["call", "s", "exec"]); Bootstrapper.FILSPA.initialAdobePageViewFired = true; setTimeout(window.s.resetCustomActivityMap, 500); } else Bootstrapper.AF.push(["call", "s", "safelyExec"]); }.bind(this), 250 ); }; Bootstrapper.AF.push(["set", "s", "safelyExec", sendAdobePageViewCall]); /* Triggers the Adobe page view for flat sites *and* SPAs */ Bootstrapper.AF.push(["call", "s", "safelyExec"]);

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

This should be possible using the identityMap in the XDM, providing your custom id as separate namespace.

Afterwards, you can set up the datastream's Analytics configuration to use this separate namespace for the Adobe Analytics VisitorID.

 

see also

 

https://experienceleague.adobe.com/en/docs/experience-platform/xdm/field-groups/profile/identitymap

https://experienceleague.adobe.com/en/docs/analytics/implementation/vars/config-vars/visitorid

https://experienceleague.adobe.com/en/docs/experience-platform/datastreams/configure

 

1 reply

bjoern__koth
Community Advisor and Adobe Champion
bjoern__kothCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
June 25, 2024

This should be possible using the identityMap in the XDM, providing your custom id as separate namespace.

Afterwards, you can set up the datastream's Analytics configuration to use this separate namespace for the Adobe Analytics VisitorID.

 

see also

 

https://experienceleague.adobe.com/en/docs/experience-platform/xdm/field-groups/profile/identitymap

https://experienceleague.adobe.com/en/docs/analytics/implementation/vars/config-vars/visitorid

https://experienceleague.adobe.com/en/docs/experience-platform/datastreams/configure

 

Cheers from Switzerland!
Franc_G
Franc_GAuthor
Level 4
July 1, 2024

@bjoern__koth 

In our custom AA custom implementation there was a need to wipe and reconstruct the s object before the adobe call was made. Now, in case of the web sdk we don't have such a necessity.

Question - can we rely on the web sdk base code to set the marketing cloud ID ? Can you foresee any issues with this approach ?

bjoern__koth
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
July 1, 2024

Hi @franc_g 

the marketing cloud id being the ECID is automatically set from the WebSDK.

 

If you have the need to assign it to a prop or eVar, I would recommend using datastream mapping. Implemented it for a different client and it works super.

https://experienceleague.adobe.com/en/docs/experience-platform/tags/extensions/client/web-sdk/accessing-the-ecid

 

 

Cheers from Switzerland!