Skip to content

Latest commit

 

History

History
109 lines (80 loc) · 3.92 KB

getting-started.md

File metadata and controls

109 lines (80 loc) · 3.92 KB

Getting Started with Adobe Analytics Android Extension

The Adobe Experience Platform - Analytics Extension is required for sending interaction data from the mobile application to Adobe Analytics.

Configure the Analytics extension in Data Collection UI

Analytics Extension Configuration

  1. Log into Adobe Experience Platform Data Collection.
  2. From Tags, locate or search for your Tag mobile property.
  3. In your mobile property, select Extensions tab.
  4. On the Catalog tab, locate the Adobe Analytics extension, and select Install.
  5. Type the extension settings.
  6. Click Save.
  7. Follow the publishing process to update SDK configuration.

Add Analytics extension to your app

The Analytics extension depends on the Core and Identity extensions:

  1. 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.

    Kotlin

    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")

    Groovy

    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.

  1. Import MobileCore, Identity and Analytics extensions:

    Java

    import com.adobe.marketing.mobile.MobileCore;
    import com.adobe.marketing.mobile.Identity;
    import com.adobe.marketing.mobile.Analytics;

    Kotlin

    import com.adobe.marketing.mobile.MobileCore
    import com.adobe.marketing.mobile.Identity
    import com.adobe.marketing.mobile.Analytics
  2. Import the Analytics library into your project and register it with MobileCore

    Java

    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");
             });
         }
     }

    Kotlin

    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")
            }
        }
    }

Next Steps

Get familiar with the various APIs offered by the Analytics extension by checking out the API reference.