Configuring and Implementing AEP Mobile SDK

HomeInsightsBlogs | Last Updated July 5, 2023 - by rajdeep singh under digital analytics

Published onSeptember 22, 2020

This article is the 1st post of the AEP Mobile SDK blog series.

Through this post, we are going to cover the steps one needs to configure and install the new AEP Mobile SDK. I will also conduct a deep-dive on mobile data tracking APIs. After going through this blog, you will be able to:

  • Configure Mobile property in Tags (formerly Adobe Launch).
  • Install Mobile SDK v5 in your app.
  • Track data into Adobe Analytics.
    • Lifecycle
    • States and Action
    • Map variables via processing rules

Alright, let’s get started.

1. Configure Mobile property in Tags

  1. Log into Experience Cloud > Tags > Create a “Mobile Type” Property
  2. Give it a name e.g. “Sandbox Mobile Tracking” and save it.
    Configuring and Implementing AEP Mobile SDKhover-icon
  3. Install Adobe Analytics Extension, and provide valid report suites and tracking server information.
    Note: Do not install Adobe Analytics Mobile Services Extension.
    Configuring and Implementing AEP Mobile SDKhover-icon
  4. Now, create a library, and add your resources in it and build it.

2. Install Mobile SDK v5 in your app

  1. Once you have built your library, go to the environments tab in Tags.
    Configuring and Implementing AEP Mobile SDKhover-icon
  2. Copy Gradle dependencies and paste it in Gradle Scripts folder > build.gradle (Module:bus) > Inside dependencies { } > Sync.
    Configuring and Implementing AEP Mobile SDKhover-icon
  3. Now, copy the Initialization code and paste it in your main class:
    1. Import all the dependencies at the top,
    2. MobileCore functions inside onCreate() and Register Extensions snippet inside try{}.

    Note: Adobe recommends to import SDKs, and register extensions as early as possible during the app launch process. Hence, our initialization code should go in main class, not in main activity.
    Configuring and Implementing AEP Mobile SDKhover-icon

3. Track data into Adobe Analytics

  1. To track Lifecycle data, you need to invoke the following APIs:
    • Mobilecore.lifecycleStart():
      This function is called to begin collecting Lifecycle data. This function should be invoked inside onResume() method of all the activities.
    • Mobilecore.lifecyclePause():
      This function is called to ensure accurate session and crash reporting. This function should be invoked inside onPause() method of all the activities.
      Configuring and Implementing AEP Mobile SDKhover-icon
  2. To track data into Adobe Analytics standard and propriety variables like pageName, eVar, prop, etc. you’ll need the following APIs:
    • Mobilecore.trackState():
      States are the different screens or views in your application. Each time a new state is displayed in your application, you should report it via trackState() function e.g.

      Map<String, String> contextdata = new HashMap<String, String>();
      contextdata.put("app.pagename", "Bus Homepage");
      contextdata.put("app.sitesection", "home");
      MobileCore.trackState("Bus Homepage", contextdata);

      Configuring and Implementing AEP Mobile SDKhover-icon

    • Mobilecore.trackAction():
      Actions are the events/user interactions that occur in your app, and they don’t get tracked automatically, so you must call trackAction when an event that you want to track occurs. For example, you might send a trackAction() call for each new subscription, each time an article is viewed, or each time a level is completed e.g.

      Map<String, String> contextdata = new HashMap<String, String>();
      contextdata.put("app.linkname", "Get Buses");
      contextdata.put("app.linkpagename", "Bus Homepage");
      MobileCore.trackAction("Get Buses", contextdata);

      Configuring and Implementing AEP Mobile SDKhover-icon

  3. The last step is to map your context data variables with your Adobe Analytics variable via processing rules. Following screen grab shows how one should do it.
    Configuring and Implementing AEP Mobile SDKhover-icon

Isn’t configuring AEP Mobile SDK simple?

These simple and straightforward steps will let anyone quickly configure their mobile property in Tags, install it on the app, and track data in Adobe Analytics. From here, you can take your implementation to a whole different level, depending on your project and business requirements.

That’s it from this blog, and in the next one, I will deep dive more into Tags and cover its advantages over Mobile SDK 4.x.

You can also check out the recording of the webinar, we recently held, on migrating mobile implementation from SDK 4.x to new AEP Mobile SDK.

I hope you enjoyed this blog, and should you have any questions, let us know by emailing us at info@softcrylic.com.

Contact us now to start the conversation

    Rajdeep Singh

    Rajdeep Singh works as a Digital Analytics Manager at Softcrylic. He has over 7 years of experience in Digital Analytics Design, Implementation, and Analysis. Rajdeep utilizes his vast experience to help his clients solve complex data problems using digital analytics.

    Contact Us

    We're not around right now. But you can send us an email and we'll get back to you, asap.

    Not readable? Change text. captcha txt

    Start typing and press Enter to search