Hi @michael_soprano ,
To synchronize the ECID (Experience Cloud ID) between native app screens and WebViews, the app development team needs to append the visitor information to the URL of the page load request.
SDK Method Reference:
https://developer.adobe.com/client-sdks/home/base/mobile-core/identity/api-reference/#appendtourl--appendvisitorinfoforurl
This method appends the necessary visitor info to the URL so that WebViews can share the same ECID as the native app.
Note: This approach only works if both native app tracking and WebView tracking are configured to send data to the same Adobe Analytics report suite.
Implementation Insight and Issue Observed
In a recent implementation involving WebViews within the app (the underlying tech stack may differ, but it doesn't impact the analytics behavior), I encountered an issue where one of the WebViews was loaded without the visitor info appended to the URL.
As a result:
The WebView generated a different ECID from the native app.
This led to inflated visit and visitor counts.
Even after fixing the URL to include the correct visitor info, the ECID in the WebView was not overwritten in subsequent sessions.
Resolution:
After further investigation, we discovered that the web page must have a specific flag enabled to allow the ECID to be overwritten.
Flag: overwriteCrossDomainMCIDAndAID = true
This flag ensures that the ECID received via the appended URL will replace the existing one in the WebView session, allowing proper continuity in user tracking.
Here’s the community post I created during my research on overwriting the ECID in WebViews:
https://experienceleaguecommunities.adobe.com/t5/adobe-analytics-questions/issue-with-the-adobe-visitor-id-between-native-app-and-webviews/m-p/679728
Thanks,
Nitesh