App Analytics SDK

This page describes the integration of the MediaMelon App Analytics SDK

Prerequisites

  1. Android Sample App

  2. MediaMelon SmartSight SDK appanalytics-release.aar

  3. MediaMelon-assigned Customer ID

If you do not know your Customer ID contact MediaMelon at [email protected]

Step 1: Set up the build environment

  1. Copy appanalytics-release.aar provided with the release package to SampleApp/appanalytics-release.aar

  2. Add network permissions to

    app/src/main/AndroidManifest.xml

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

Step 2: Integrate MediaMelon SDK Code to SampleApp

The application must register the MediaMelon SDK and provide app information once when the application launches. Please note that values provided in this integration step persist across app sessions.

you need to create Application class MyApplication.java

import android.app.Application;
import java.util.HashMap;
import com.mediamelon.appanalytics.MMIntegrationWrapper;

public class MyApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        ....
        MMIntegrationWrapper.getInstance(this).initialize("CUTOMER_ID" , "APP_NAME" , "APP_VERSION");
        HashMap<String , Object> userInfoCustomData = new HashMap<String , Object>();
        userInfoCustomData.put("KEY" , "VALUE");
        MMIntegrationWrapper.reportSubscriberInfo("SUBSCRIBER_ID","SUBSCRIBER_TYPE","SUBSCRIBER_TAG","PROFILE_ID",userInfoCustomData);
        ...
    }
    @Override
    public void onTerminate() {
        super.onTerminate();
        MMIntegrationWrapper.release(true);
    }
}

Note: you can rename MyApplication.java according to your application

Now you need to mention in your MyApplication.java AndroidManifest.xml

Step 3: Custom Data & Referral Data

Step 4 : User Actions

  • Screen View

  • Event

  • App State

  • App Error

  • Video State

  • Interruption

  • Purchase

  • Subscription

Step 4: Report Ended State to the SDK

Variable

Description

CUSTOMER_ID

String containing your MediaMelon-assigned Customer ID.

SUBSCRIBER_ID

String containing your subscriber’s ID. If you do not use subscriber IDs, enter null

SUBSCRIBER_TYPE

String containing the subscriber type (e.g. “Free”, “Paid”). If you do not use subscriber types, enter null

SUBSCRIBER_TAG

String containing an additional subscriber-specific information. This is sent in clear (not hashed) to SmartSight and it is advised to not send sensitive information in this field.

PROFILE_ID

...

REFERRAL_ID

A unique referral id

Last updated