The Adobe Experience Platform - Analytics Extension is required for sending interaction data from the mobile application to Adobe Analytics.
- Log into Adobe Experience Platform Data Collection.
- From Tags, locate or search for your Tag mobile property.
- In your mobile property, select Extensions tab.
- On the Catalog tab, locate the Adobe Analytics extension, and select Install.
- Type the extension settings.
- Click Save.
- Follow the publishing process to update SDK configuration.
The Analytics extension depends on the Core and Identity extensions:
-
Installation via Maven & Gradle is the easiest and recommended way to get the Mobile SDK. Add a dependency on Analytics and Mobile Core to your mobile application. To ensure consistent builds, it is best to explicitly specify the dependency version and update them manually.
implementation(platform("com.adobe.marketing.mobile:sdk-bom:3.+")) implementation("com.adobe.marketing.mobile:core") implementation("com.adobe.marketing.mobile:identity") implementation("com.adobe.marketing.mobile:analytics")
implementation platform('com.adobe.marketing.mobile:sdk-bom:3.+') implementation 'com.adobe.marketing.mobile:core' implementation 'com.adobe.marketing.mobile:identity' implementation 'com.adobe.marketing.mobile:analytics'
Warning
Using dynamic dependency versions is not recommended for production apps. Refer to this page for managing Gradle dependencies.
-
Import MobileCore, Identity and Analytics extensions:
import com.adobe.marketing.mobile.MobileCore; import com.adobe.marketing.mobile.Identity; import com.adobe.marketing.mobile.Analytics;
import com.adobe.marketing.mobile.MobileCore import com.adobe.marketing.mobile.Identity import com.adobe.marketing.mobile.Analytics
-
Import the Analytics library into your project and register it with
MobileCore
public class MainApp extends Application { private final String ENVIRONMENT_FILE_ID = "YOUR_APP_ENVIRONMENT_ID"; @Override public void onCreate() { super.onCreate(); MobileCore.setApplication(this); MobileCore.configureWithAppID(ENVIRONMENT_FILE_ID); List<Class<? extends Extension>> extensions = Arrays.asList( Analytics.EXTENSION, Identity.EXTENSION); MobileCore.registerExtensions(extensions, o -> { Log.d(LOG_TAG, "AEP Mobile SDK is initialized"); }); } }
class MyApp : Application() { val ENVIRONMENT_FILE_ID = "YOUR_APP_ENVIRONMENT_ID" override fun onCreate() { super.onCreate() MobileCore.setApplication(this) MobileCore.configureWithAppID(ENVIRONMENT_FILE_ID) val extensions = listOf(Analytics.EXTENSION, Identity.EXTENSION) MobileCore.registerExtensions(extensions) { Log.d(LOG_TAG, "AEP Mobile SDK is initialized") } } }
Get familiar with the various APIs offered by the Analytics extension by checking out the API reference.