diff --git a/gatsby-config.js b/gatsby-config.js index d256b15848..7e837d53ea 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -620,8 +620,18 @@ module.exports = { path: "/home/base/mobile-core/identity/api-reference" }, { - title: "Push identifier sync", - path: "/home/base/mobile-core/identity/push-sync" + title: "Tutorials", + path: "/home/base/mobile-core/identity/tutorials", + pages: [ + { + title: "Mobile to web identity sharing", + path: "/home/base/mobile-core/identity/tutorials/id-sharing" + }, + { + title: "Push identifier sync", + path: "/home/base/mobile-core/identity/tutorials/push-sync" + } + ] } ] }, diff --git a/src/pages/home/base/mobile-core/identity/index.md b/src/pages/home/base/mobile-core/identity/index.md index 847629644e..1c502abd62 100644 --- a/src/pages/home/base/mobile-core/identity/index.md +++ b/src/pages/home/base/mobile-core/identity/index.md @@ -72,47 +72,3 @@ Flutter Previously known as MCID/MID/MCMID, the Experience Cloud ID (ECID) is a 38 character ID that uniquely identifies each visitor in the Adobe Experience Platform. After the configuration is complete, an ECID is generated and, where applicable, is included on all Analytics and Audience Manager hits. Other IDs, such as custom and automatically-generated IDs, continue to be sent with each hit. - -## Visitor tracking between an app and the mobile web - -If your app opens mobile web content, you need to ensure that visitors are not identified separately as they move between the native and mobile web. - -### Visitor IDs in apps - -The Mobile SDK generates a unique visitor ID when the app is installed. This ECID is stored in persistent memory on the mobile device and is sent with every hit. The ECID is removed when the user uninstalls the app or when the user sets the Mobile SDK global privacy status to `optedout`. - - - -When the Mobile SDK privacy status is set to `optedout`, and the ECID is removed, a new unique visitor ID (ECID) is generated when the user sets the global privacy status to `optedin`. - - - -App visitor IDs persist through upgrades. - -### Visitor IDs in the mobile web - -Typical mobile web implementations use the same standard analytics `s_code.js` or `AppMeasurement.js` that is used in desktop sites. The JavaScript libraries have their own methods of generating unique visitor IDs, which causes a different visitor ID to be generated when you open mobile web content from your app. - -To use the same visitor ID in the app and mobile web and pass the visitor ID to the mobile web in the URL, complete the following steps: - -### Implementing visitor tracking between an app and the mobile web - - - -Android - - - -iOS - - - - - -The ID service code on the destination domain extracts the ECID from the URL instead of sending a request to Adobe for a new ID. The ID service code on the destination page uses this ECID to track the visitor. On hits from the mobile web content, verify that the `mid` parameter exists on each hit, and that this value matches the `mid`value that is being sent by the app code. diff --git a/src/pages/home/base/mobile-core/identity/tabs/id-sharing.md b/src/pages/home/base/mobile-core/identity/tabs/id-sharing.md new file mode 100644 index 0000000000..ef5c08f1a4 --- /dev/null +++ b/src/pages/home/base/mobile-core/identity/tabs/id-sharing.md @@ -0,0 +1,148 @@ +--- +noIndex: true +--- + + + +#### Java + +To append visitor information to the URL that is being used to open the web view, call [appendVisitorInfoForUrl](../api-reference.md#appendtourl-appendvisitorinfoforurl): + +```java +Identity.appendVisitorInfoForURL("https://example.com", new AdobeCallback() { + @Override + public void call(String urlWithAdobeVisitorInfo) { + //handle the new URL here + //For example, open the URL on the device browser + // + Intent i = new Intent(Intent.ACTION_VIEW); + i.setData(Uri.parse(urlWithAdobeVisitorInfo)); + startActivity(i); + } +}); +``` + +Alternately, starting in SDK version 1.4.0 (Identity version 1.1.0), you can call [getUrlVariables](../api-reference.md#geturlvariables) and build your own URL: + +```java +Identity.getUrlVariables(new AdobeCallback() { + @Override + public void call(String stringWithAdobeVisitorInfo) { + //handle the URL query parameter string here + //For example, open the URL on the device browser + // + Intent i = new Intent(Intent.ACTION_VIEW); + i.setData(Uri.parse("https://example.com?" + urlWithAdobeVisitorInfo)); + startActivity(i); + } +}); +``` + + + +To append visitor information to the URL that is being used to open the web view, call [appendToUrl](../api-reference.md#appendtourl-appendvisitorinfoforurl): + +#### Swift + +```swift +let url = URL(string: "https://example.com") +Identity.appendTo(url: url) { appendedUrl, error in + if error != nil { + // handle error here + } else { + // handle appended url here + } +} +``` + +#### Objective-C + +```objectivec +NSURL *sampleUrl = [NSURL URLWithString:@"https://example.com"]; +[AEPMobileIdentity appendToUrl:sampleUrl completion:^(NSURL * _Nullable appendedUrl, NSError *error) { + if (error != nil) { + // Handle error here + } else { + // Handle appended url here + } +}]; +``` + +Alternately, you can call [getUrlVariables](../api-reference.md#geturlvariables) and build your own URL: + +#### Swift + +```swift +Identity.getUrlVariables { urlVariables, error in + if error != nil { + // handle error here + } else { + if let url = URL(string: "https://example.com?\(urlVariables ?? "")") { + DispatchQueue.main.async { + UIApplication.shared.open(url) + } + } + } +} +``` + +#### Objective-C + +```objectivec +[AEPMobileIdentity getUrlVariables:^(NSString * _Nullable urlVariables, NSError *error) { + NSString *sampleURLString = @"https://example.com"; + if (error != nil) { + // Handle variables being nil + } else { + NSString *stringWithData = [NSString stringWithFormat:@"%@?%@", sampleURLString, urlVariables]; + NSURL *appendedUrl = [NSURL URLWithString:stringWithData]; + dispatch_async(dispatch_get_main_queue(), ^{ + [[UIApplication sharedApplication] openURL:appendedUrl options:@{} completionHandler:nil]; + }); + } +}]; +``` + + diff --git a/src/pages/home/base/mobile-core/identity/tabs/index.md b/src/pages/home/base/mobile-core/identity/tabs/index.md index edbf380185..d689ad24b6 100644 --- a/src/pages/home/base/mobile-core/identity/tabs/index.md +++ b/src/pages/home/base/mobile-core/identity/tabs/index.md @@ -132,148 +132,3 @@ When using React Native, registering Identity with Mobile Core should be done in When using Flutter, registering Identity with Mobile Core should be done in native code, which is shown under the Android and iOS tabs. ---> - - - -#### Java - -To append visitor information to the URL that is being used to open the web view, call [appendVisitorInfoForUrl](#appendtourl-appendvisitorinfoforurl): - -```java -Identity.appendVisitorInfoForURL("https://example.com", new AdobeCallback() { - @Override - public void call(String urlWithAdobeVisitorInfo) { - //handle the new URL here - //For example, open the URL on the device browser - // - Intent i = new Intent(Intent.ACTION_VIEW); - i.setData(Uri.parse(urlWithAdobeVisitorInfo)); - startActivity(i); - } -}); -``` - -Alternately, starting in SDK version 1.4.0 (Identity version 1.1.0), you can call [getUrlVariables](#geturlvariables) and build your own URL: - -```java -Identity.getUrlVariables(new AdobeCallback() { - @Override - public void call(String stringWithAdobeVisitorInfo) { - //handle the URL query parameter string here - //For example, open the URL on the device browser - // - Intent i = new Intent(Intent.ACTION_VIEW); - i.setData(Uri.parse("https://example.com?" + urlWithAdobeVisitorInfo)); - startActivity(i); - } -}); -``` - - - -To append visitor information to the URL that is being used to open the web view, call [appendToUrl](./api-reference.md#appendtourl-appendvisitorinfoforurl): - -#### Swift - -```swift -let url = URL(string: "https://example.com") -Identity.appendTo(url: url) { appendedUrl, error in - if error != nil { - // handle error here - } else { - // handle appended url here - } -} -``` - -#### Objective-C - -```objectivec -NSURL *sampleUrl = [NSURL URLWithString:@"https://example.com"]; -[AEPMobileIdentity appendToUrl:sampleUrl completion:^(NSURL * _Nullable appendedUrl, NSError *error) { - if (error != nil) { - // Handle error here - } else { - // Handle appended url here - } -}]; -``` - -Alternately, you can call [getUrlVariables](api-reference.md#geturlvariables) and build your own URL: - -#### Swift - -```swift -Identity.getUrlVariables { urlVariables, error in - if error != nil { - // handle error here - } else { - if let url = URL(string: "https://example.com?\(urlVariables ?? "")") { - DispatchQueue.main.async { - UIApplication.shared.open(url) - } - } - } -} -``` - -#### Objective-C - -```objectivec -[AEPMobileIdentity getUrlVariables:^(NSString * _Nullable urlVariables, NSError *error) { - NSString *sampleURLString = @"https://example.com"; - if (error != nil) { - // Handle variables being nil - } else { - NSString *stringWithData = [NSString stringWithFormat:@"%@?%@", sampleURLString, urlVariables]; - NSURL *appendedUrl = [NSURL URLWithString:stringWithData]; - dispatch_async(dispatch_get_main_queue(), ^{ - [[UIApplication sharedApplication] openURL:appendedUrl options:@{} completionHandler:nil]; - }); - } -}]; -``` - - diff --git a/src/pages/home/base/mobile-core/identity/tutorials/id-sharing.md b/src/pages/home/base/mobile-core/identity/tutorials/id-sharing.md new file mode 100644 index 0000000000..542ea2e460 --- /dev/null +++ b/src/pages/home/base/mobile-core/identity/tutorials/id-sharing.md @@ -0,0 +1,73 @@ +--- +title: Mobile to web identity sharing +description: Learn how to add visitor tracking between an app and the mobile web. +keywords: +- Identity for Mobile Core +- Identity +- Mobile Core +- Tutorial +- Visitor tracking +- Troubleshooting +- Web application +- Mobile application +--- + +import Tabs from '../tabs/id-sharing.md' + +# Mobile to web identity sharing + +If your app opens mobile web content, you need to ensure that visitors are not identified separately as they move between the native and mobile web. + +## Visitor IDs in apps + +The Mobile SDK generates a unique visitor ID when the app is installed. This ECID is stored in persistent memory on the mobile device and is sent with every hit. The ECID is removed "when the user uninstalls the app, sets the Mobile SDK global privacy status to `optedout`, or calls the [resetIdentities](../api-reference/#resetidentities) API". + + + +When the Mobile SDK privacy status is set to `optedout`, and the ECID is removed, a new unique visitor ID (ECID) is generated when the user sets the global privacy status to `optedin`. + + + +App visitor IDs persist through upgrades. + +## Visitor IDs in the mobile web + +Typical mobile web implementations use one of the Adobe JavaScript libraries available for web platform, such as Adobe Experience Platform Web SDK, or `AppMeasurement.js`. These libraries have their own methods of generating unique visitor IDs, which causes a different visitor ID to be generated when you open mobile web content from your app. + +To use the same visitor ID in the app and mobile web and pass the visitor ID to the mobile web in the URL, complete the following steps: + +## Implementing visitor tracking between an app and the mobile web + + + +Android + + + +iOS + + + + + +The ID service code on the destination domain extracts the ECID from the URL instead of sending a request to Adobe for a new ID. The ID service code on the destination page uses this ECID to track the visitor. On hits from the mobile web content, verify that the `mid` parameter exists on each hit, and that this value matches the `mid`value that is being sent by the app code. + +## Troubleshooting + +To ensure that the visitor tracking was properly implemented, please verify the following conditions: + +* Ensure that the output from the [`appendToUrl`](../api-reference.md#appendtourl--appendvisitorinfoforurl) or [`getUrlVariables`](../api-reference.md#geturlvariables) API includes accurate ECID and Experience Cloud orgID values. Please note that the orgID set up for the Mobile SDK **must** match the orgID configured in the web implementation. +* Ensure the timestamp (`TS`) included in the [`appendToUrl`](../api-reference.md#appendtourl--appendvisitorinfoforurl) or [`getUrlVariables`](../api-reference.md#geturlvariables) result did **not** expire. Since the results expire five minutes after retrieval, you should **not** cache and re-use the results in your application. Instead, please retrieve the result on demand before loading the WebView. +* Ensure you do **not** re-encode the generated query string. The query string returned by the [`getUrlVariables`](../api-reference.md#geturlvariables) API is already URL encoded. + +Once you've confirmed the mobile setup, check your web implementation. + +If you're using the Adobe Experience Platform Web SDK, ensure that you're using the latest version of Web SDK. For further information, please read the guide on [mobile-to-web and cross-domain ID sharing](https://experienceleague.adobe.com/en/docs/experience-platform/web-sdk/identity/id-sharing) in Web SDK. + +If you're using the AppMeasurement.js library, ensure that you're using the latest version of the Visitor ID and the AppMeasurement libraries. For further information, please read the guide on the [overwriteCrossDomainMCIDAndAID API](https://experienceleague.adobe.com/en/docs/id-service/using/id-service-api/configurations/overwrite-visitor-id) in Identity Service. diff --git a/src/pages/home/base/mobile-core/identity/tutorials/index.md b/src/pages/home/base/mobile-core/identity/tutorials/index.md new file mode 100644 index 0000000000..3c8b8a0587 --- /dev/null +++ b/src/pages/home/base/mobile-core/identity/tutorials/index.md @@ -0,0 +1,18 @@ +--- +title: Tutorials overview +description: An overview that shows the available tutorials for the Mobile Core Identity extension. +keywords: +- Guides +- Tutorials +- Identity +- Identity for Mobile Core +- Mobile Core +- Troubleshooting +--- + +# Tutorials + +This page provides a list of available tutorials for the Identity extension in Mobile Core. + +* [Mobile to web identity sharing](./id-sharing.md) +* [Troubleshooting push identifier sync](./push-sync.md) diff --git a/src/pages/home/base/mobile-core/identity/push-sync.md b/src/pages/home/base/mobile-core/identity/tutorials/push-sync.md similarity index 87% rename from src/pages/home/base/mobile-core/identity/push-sync.md rename to src/pages/home/base/mobile-core/identity/tutorials/push-sync.md index 8892afb354..77b0931887 100644 --- a/src/pages/home/base/mobile-core/identity/push-sync.md +++ b/src/pages/home/base/mobile-core/identity/tutorials/push-sync.md @@ -8,7 +8,7 @@ keywords: - Troubleshooting --- -import Tabs from './tabs/push-sync.md' +import Tabs from '../tabs/push-sync.md' # Troubleshooting push identifier sync @@ -53,7 +53,7 @@ Launch your app with the device connected to an [Adobe Experience Platform Assur In the list of events, verify that you have an event with type `SetPushIdentifier`. In the details panel on the right, verify the value of the push token for this device. The value in `pushIdentifier` is the same value that is sent to the Adobe servers. -![Verify push identifier received by the SDK](./assets/push-sync/set-push-token-to-identity.png) +![Verify push identifier received by the SDK](../assets/push-sync/set-push-token-to-identity.png) ## Ensure user opt-in for push in Adobe Analytics @@ -61,7 +61,7 @@ Launch your app with the device connected to an [Adobe Experience Platform Assur In the resulting list of events, verify that you have an event with type `AnalyticsForIdentityRequest`. In the details panel on the right, you can see that there is a value that was sent to Analytics that opts this user in to receive push notifications. -![Verify push preferences are opted in](./assets/push-sync/push-analytics-optin.png) +![Verify push preferences are opted in](../assets/push-sync/push-analytics-optin.png) ## Confirm that the user ID is correctly set @@ -70,8 +70,8 @@ Launch your app with the device connected to an [Adobe Experience Platform Assur In the list of events, verify that you have an event with type `UPDATED_IDENTITY_RESPONSE`. In the details panel on the right, confirm that the following values are correct: * The value for `pushidentifier` should match the value that was sent in step 2 above. -* The value for mid should match the value for mid that is sent to Analytics. If you are using a [custom visitor identifier](../../../solution/adobe-analytics/api-reference.md#setidentifier), this payload should also contain a vid variable with a value that matches the value that was used to identify this user. +* The value for mid should match the value for mid that is sent to Analytics. If you are using a [custom visitor identifier](../../../../../solution/adobe-analytics/api-reference.md#setidentifier), this payload should also contain a vid variable with a value that matches the value that was used to identify this user. -![Verify push identifier synced](./assets/push-sync/push-identities.png) +![Verify push identifier synced](../assets/push-sync/push-identities.png) After completing these steps, your app is correctly configured and is ready to send push messages via the SDK and Adobe. diff --git a/src/pages/resources/user-guides/index.md b/src/pages/resources/user-guides/index.md index 7c88837ed1..dcdaabef62 100644 --- a/src/pages/resources/user-guides/index.md +++ b/src/pages/resources/user-guides/index.md @@ -10,7 +10,7 @@ keywords: ## Implementing Experience Cloud solutions in mobile Android and iOS Swift applications -This sections provides a starting point for mobile application developers who want to learn how to implement Adobe Experience Cloud solutions in their applications. You can complete the following sample Swift or Android tutorials to learn about implementing Experience Cloud in a controlled environment: +This section provides a starting point for mobile application developers who want to learn how to implement Adobe Experience Cloud solutions in their applications. You can complete the following sample Swift or Android tutorials to learn about implementing Experience Cloud in a controlled environment: * [Implementing the Experience Cloud in mobile iOS Swift applications](https://experienceleague.adobe.com/docs/launch-learn/implementing-in-mobile-ios-swift-apps-with-launch/index.html) * [Implementing the Experience Cloud in mobile Android applications](https://experienceleague.adobe.com/docs/launch-learn/implementing-in-mobile-android-apps-with-launch/index.html)