visitor id mid is not consistent across domains when i login from app and then from moving from app to web

848 Views Asked by At

Experience cloud vistor id is used. App, web are using same adobe launch library. When I login into app url change and mid changes and then if I navigate from app to web responsive page mid is changed and I am not seeing any cross-domain pathing report from app to web ?

anything do I need to do with s.cookiedomainperiod or anything to make this work?

1

There are 1 best solutions below

5
On

The Experience Cloud Visitor ID is not automatically carried over from the native mobile app to a (mobile) web page. The long story short is native apps don't really store data locally in the same way as web browsers, so there's no automatic ability to use the same local storage mechanism/source between the two.

In order to do this, you must add some code to the mobile app to append the mid value to the target URL, e.g. :

Android

String urlString = "http://www.example.com/index.php";
String urlStringWithVisitorData = Visitor.appendToURL(urlString);
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlStringWithVisitorData));
startActivity(browserIntent);

iOS

NSURL *url = [NSURL URLWithString:@”http://www.example.com/index.php"];
NSURL *urlWithVisitorData = [ADBMobile visitorAppendToURL:url];
[[UIApplication sharedApplication] openURL:urlWithVisitorData];

If implemented properly, you should now see a adobe_mc= parameter appended to the target URL. Then on page view of the target page, if you have the Adobe Analytics javascript and Experience Cloud Visitor ID libraries implemented, they will automatically look for and use that value instead of generate a new value (should not require any config / coding on this end).

Update:

@Ramaiyavraghvendra you made a comment:

Hi @Crayon, mny thanks for your profound answer. I am sorry that i missed to inform that this app is not native one but this is a SPA app. so the implementation of entire app is also done through launch. Could you pl help in this case then.

I'm not entirely sure I understand your issue. If you are NOT moving from a native mobile app to web page, and your mobile app is really a web based SPA that outputs Launch as regular javascript code throughout the entire app, then you shouldn't have to do anything; the Experience Cloud ID service should carry over the id from page to page.

So it sounds to me like perhaps your Experience Cloud Visitor ID and/or Adobe Analytics collection server settings are not configured correctly. the cookie domain period variables may be an issue, if logging in involves moving from say www.mysite.com to www.mysite.co.uk or similar, but shouldn't be a problem if the TLD has the same # of periods.

Or, the trackingServer and trackingServerSecure variables may not be configured properly. In practice, I usually do not set trackingServerSecure at all. These variables get kind of confusing and IMO buggy in different scenarios vs. what you are using, so I tend to use the "secure" value in the trackingServer field and leave the trackingServerSecure blank, and then Experience Cloud Visitor ID and Adobe Analytics will just use the secure version 100% of the time.

Or..it could be a number of other config variables not properly set. It's hard to say if any of this is off, without access to the app and Launch container.

Also you may want to check the response headers for your logged in pages. It may be that they are configured to reject certain existing non-https cookies or something else that effectively causes the existing cookies to be unreadable and make the Experience Cloud ID service generate a new ID and cookies.

Or.. maybe your app kind of is a native mobile app but using an http wrapper to pull in web pages, so it is basically a web browser but it is effectively like moving from one web browser to another (e.g. starting on www.site.com/pageA on Chrome, and then copy/pasting that URL over to Internet Explorer to view). So effectively, different cookie jar.

Launch (or DTM) + Experience Cloud ID (Javascript methods)

In cases such as the last 2 paragraphs, you have to decorate your target links the same as my original answer, but using the Launch + Experience Cloud ID Service javascript syntax:

_satellite.getVisitorId().appendVisitorIDsTo('[your url here]');

You write some code to get the target URL of the link. Then run it through this code to return the url with the parameters added to them, and then you update your link with the new URL.

Super generic example that just updates all links on the page. In practice, you should only do this for relevant link(s) the visitor is redirected to.

var urls = document.querySelectorAll('a');
for (var i = 0, l = urls.length; i < l; i++) {
    if (urls[i].href) {
        urls[i].href = _satellite.getVisitorId().appendVisitorIDsTo(urls[i].href);
    }
}