Edit in GitHubLog an issue

Adobe Mobile Library (v4) to Experience Platform Analytics migration

Configuration

The Adobe Experience Platform Analytics extension uses tags to configure the Experience Platform SDKs. This replaces the ADBMobileConfig.json which the Mobile Services SDK used for configuration. To get started with the AEP SDKs:

  1. Create a mobile property on tags.
    See Set up a mobile property for more information.
  2. Configure your mobile app with the create mobile property.
    The AEP Mobile Core extension provides general functionality required by all the Adobe AEP extensions. The Configuration extension is built into the Mobile Core and contains the configureWithAppId API. This API is used to link the tag mobile property with your mobile app. The documentation for this API can be seen at the Configuration API Reference page. A code sample showing the usage of this API is provided below.
  3. Once all the Platform extensions are imported and configured correctly, remove the v4 Mobile SDK dependency.
    This step is mandatory and a mix of v4 and AEP API calls is not supported.

If using Gradle, remove the v4 Mobile SDK dependency:

Gradle

Copied to your clipboard
dependencies {
implementation 'com.adobe.mobile:adobeMobileLibrary:4.18.2'
...
}

Alternatively, if the v4 Mobile SDK library is linked as a jar, search for adobeMobileLibrary in your project and remove the jar file.

Analytics Migration Overview

For an overview of the API mapping between the Mobile Services SDK and Adobe Experience Platform SDKs, see the API Change Log. This section describes the Analytics-specific changes made with the AEP Analytics extension.

Deprecated API

APINotes
trackActionFromBackground
Deprecated
trackLocation:data:
This functionality is available in the Places extension.
trackBeacon:Data:
Support modified. See guide.
trackingClearCurrentBeacon
Support modified. See guide.
trackLifetimeValueIncrease:data:
This functionality can be recreated using the Analytics and User Profile extensions.
trackTimedActionStart:
This functionality can be recreated using the Analytics and User Profile extensions.
trackTimedActionUpdate:
This functionality can be recreated using the Analytics and User Profile extensions.
trackTimedActionEnd:
This functionality can be recreated using the Analytics and User Profile extensions.
trackTimedActionExists:
This functionality can be recreated using the Analytics and User Profile extensions.

Experience Platform extensions installation and setup

In your app's Application class add the mobile extension registration and configuration code:

Java

Copied to your clipboard
import com.adobe.marketing.mobile.MobileCore;
import com.adobe.marketing.mobile.Analytics;
import com.adobe.marketing.mobile.Identity;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
MobileCore.setApplication(getApplication());
MobileCore.registerExtensions(Arrays.asList(
Analytics.EXTENSION,
Identity.EXTENSION
), value -> {
// add your Environment file ID from Environments tab in Data Collection tags.
MobileCore.configureWithAppID("your-environment-file-id");
});
}

For more details, see Add Analytics to your application.

API changes

Track app states and actions

Adobe Mobile Library (v4)

Java

The Adobe Mobile Library (v4) syntax and usage examples for these API are:

Copied to your clipboard
// syntax
public static void trackState(final String state, final Map<String, Object> contextData)
// usage
Analytics.trackState("MainPage", new HashMap<String, Object>() {{
put("firstVisit", true);
}});
Copied to your clipboard
// syntax
public static void trackAction(final String action, final Map<String, Object> contextData)
// usage
Analytics.trackAction("linkClicked", new HashMap<String, Object>() {{
put("url", "https://www.adobe.com");
}});

Experience Platform Mobile SDKs

The Mobile SDKs have moved the trackAction and trackState APIs to the MobileCore extension. In addition, the context data Map has been changed from <String, Object> to <String, String>. The syntax is:

Java

Copied to your clipboard
// syntax
public static void trackState(final String state, final Map<String, String> contextData)
// usage
MobileCore.trackState("MainPage", new HashMap<String, String>() {{
put("firstVisit", "true");
}});
Copied to your clipboard
// syntax
public static void trackAction(final String action, final Map<String, String> contextData)
// usage
MobileCore.trackAction("linkClicked", new HashMap<String, String>() {{
put("url", "https://www.adobe.com");
}});

Privacy status changes in the Experience Platform SDK

The privacy APIs setPrivacyStatus and getPrivacyStatus can be found in the Mobile Core. Similar to the v4 SDK, the Analytics extension will follow these behaviors depending on the privacy status set:

  • Opted in: Analytics hits will be sent.
  • Unknown: Analytics hits will be queued.
  • Opted out: Analytics hits will be dropped.

Experience Platform Mobile SDKs

Java

The usage example for the setPrivacyStatus API is:

Copied to your clipboard
MobileCore.setPrivacyStatus(MobilePrivacyStatus.OPT_IN);
MobileCore.setPrivacyStatus(MobilePrivacyStatus.OPT_OUT);
MobileCore.setPrivacyStatus(MobilePrivacyStatus.UNKNOWN);

The usage example for the getPrivacyStatus API is:

Copied to your clipboard
MobileCore.getPrivacyStatus(new AdobeCallback<MobilePrivacyStatus>() {
@Override
public void call(MobilePrivacyStatus status) {
// handle current privacy status
}
});
Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.