Expand my Community achievements bar.

Join us on September 25th for a must-attend webinar featuring Adobe Experience Maker winner Anish Raul. Discover how leading enterprises are adopting AI into their workflows securely, responsibly, and at scale.
SOLVED

Hybrid mobile app: Mobile SDK vs Web SDK

Avatar

Level 10

My customer has hybrid mobile app: web view (in mobile app) + native app (kotlin etc) 

I suppose that some web view needs to use web sdk and native app has to use mobile sdk?

Did anybody do something like that recently? How to share the ECID? What might be the risks?

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 3

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--a...

 

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-visi...

 

Thanks,

Nitesh

View solution in original post

1 Reply

Avatar

Correct answer by
Level 3

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--a...

 

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-visi...

 

Thanks,

Nitesh