1. SDK integration (version: 1.0)

1.1 To download the SDK jar, click here .

1.2 Copy the downloaded jar library to your project app/libs/.

1.3 Select Project view (switch your folder structure from Android to Project). Search for the libs folder, and then right click the jar file and click add as library.

1.4 Check the following permissions in the AndroidManifest.xml. We strongly recommend to use all of these permissions.

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

1.5 Open your AndroidManifest.xml and add the broadcast receiver right before the closing </application> tag.

<receiver android:name="ai_sdk.AITrackingReceiver" android:exported="true">
  <intent-filter>
    <action android:name="com.android.vending.INSTALL_REFERRER" />
  </intent-filter>
</receiver>

2. In-App Events Tracking API

2.1 Add the following code where the event happens.

AITrackingReceiver.newEvent(getApplicationContext(), AITrackingReceiver.AIEvents.EVENT_LEVEL_ACHIEVED);

2.2 You can choose the following event types:

EVENT_PURCHASED
EVENT_REG
EVENT_LEVEL_ACHIEVED
EVENT_ADD_PAYMENT_INFO
EVENT_ADD_TO_CHART
EVENT_TUTORIAL_COMPLETED
EVENT_SEARCH
EVENT_SPENT_CREDITS
EVENT_ACHIEVEMENT_UNLOCKED
EVENT_SHARE
EVENT_INVITE
EVENT_LOGIN
EVENT_UPDATE

2.3 Example of share event.

shareBtn.setOnClickListener(new OnClickListener() {
    @Override
    public void onClick(View view) {
      AITrackingReceiver.newEvent(getApplicationContext(), AITrackingReceiver.AIEvents.EVENT_SHARE);
      shareOnFB();
    }
});

Integration completed? Publish the new version of your app with our SDK on Play Store, and Create a CPA campaign here.