Mobile and Visitor IDs - alcazes/Adobe-Analytics-from-A-To-Z GitHub Wiki


Difference between the different types of Visitor ID services

First of all here is how a unique visitor is identified once we process the data: https://marketing.adobe.com/resources/help/en_US/sc/clickstream/datafeeds_visid.html

While Adobe Analytics implementation (javascript) and Adobe Mobile Services SDK implementation use different methods to set the default visitor ID (aid) and custom visitor ID (vid) the same logic is applied.

For AMS SDK implementation

  • If the following is present in the ADBMobileConfig.json: "marketingCloud" : { "org": "YOUR-MCORG-ID" }

Then the SDK will request an MID and use as unique identifier for all Adobe Analytics calls going forward. The MID is a unique Marketing Cloud Visitor ID that is generated and used across all Adobe Tools: Analytics, Target…. This allows then to tie all tools data together (i.e: A4T integration, Shared Audiences, Customer Attributes, Push Messaging…)

  • You can extract the Values of MID use the Marketing Cloud Visitor ID services methods:
  • If the MarketingCloud Settings are not set then the SDKs will automatically generate a default Analytics visitor ID that will be used in all Adobe Analytics calls under the query param aid. This Analytics ID only applies to Adobe Analytics and does not allow tools integration.
  • In some cases customers might want to set a custom visitor ID to any values that they wish. This value will be used by Adobe Analytics only and will be sent in the query param vid. This is mostly used in use cases where a login to a member part of the app is required. Nowadays we do not recommend using vid implementation with APP implementation if Timestamp is enabled or timestamp optional is enabled as it might result in out of order hits during processing.
  • It is important to notice that if a customer has more than one type of Visitor ID in an Adobe Analytics request, the order of processing in the table above is used. This means that if part of the website of app is not using the same visitor ID types then duplication of Visitor IDs is unavoidable.

Native to webview

To manage the switch between native and webview, if you are not using Cordova plugin then:

  • You need to check for each version of the visitor ID and append of values as query URLs to the URL that will be opened via Webview.

    • MID: The best solution is to use appendToURL method. If you have implemented Visitor ID services on the webview then it should capture the values appended automatically.
    • VID: The solution is to use method getUserIdentifier and append value to the URL as query param. Once the page is loaded in the doPlugins function call s.Util.getQueryParam to extract the value of vid and set it in s.visitorID
    • AID: The solution is to use method getTrackingIdentifier and append value to the URL as query param. Once the page is loaded, in the doPlugins finction call s.Util.getQueryParam to extract the value of aid and set it in s.analyticsVisitorID.
  • You will have to check in the app conditionally if each time of Visitor ID exist and call corresponding methods.

  • In the webview, apart from MID, it is advised to set values of the 2 others type of Visitor ID, vid and aid, in a cookie and extract these valuesfrom the cookie.