MAT SDK 3.12.x introduced new ways of calling the same methods as in MAT SDK 2.x. The migration to latest MAT SDK 3.x.x is simple, with 1:1 replacements for most of the old class/method names.
- The MAT SDK provides class methods instead of instance methods to make your app code cleaner. Thus “sharedManager” method does not need to be called anymore and has been removed.
- The MAT SDK replaces MobileAppTracker with Tune class
- The MAT SDK adds TuneEvent class that allows you to keep the event info together.
- The “trackAction” method has been replaced by “measureEventXXX” methods
- The “trackInstall” and “trackUpdate” methods have been replaced by the “measureSession” method.
Call “measureSession" in “applicationDidBecomeActive" (instead of “didFinishLaunching"). We measure installs, updates, and opens using a single method now. - Xcode 7 (or higher) is required to submit to the App Store.
MobileAppTracker mobileAppTracker = new MobileAppTracker(context, "advertiserId", "conversionKey");
Select a preferred platform.
MobileAppTracker.init(context, "advertiserId", "conversionKey");
MobileAppTracker mobileAppTracker = MobileAppTracker.getInstance();
Select a preferred platform.
The “trackInstall()” and “trackUpdate()” methods have been replaced by the “measureSession()” method.
Call “measureSession()" on every app launch (generally, in “onResume()" of your main Activity). We measure installs, updates, and opens using a single method now.
The “trackAction()” method has been replaced by the “measureAction()” method.
We don’t automatically collect Android ID or IMEI anymore, because of Google’s new Advertising Identifier and associated policy changes. The MAT SDK for Android version 3.9+ automatically collects this Google Ad ID, so you don’t need to manually call “setGoogleAdvertisingId()“.
If you are using the MAT SDK for Android version 3.8 or earlier, then you need to add the Google Play Services SDK to your app project and use it to collect the advertising identifier on a background thread. We recommend using the Android ID as a fallback identifier in cases where the Google Ad ID is not present.
// Collect Google Play Advertising ID; REQUIRED for attribution on Android devices
new Thread(new Runnable() {
@Override public void run() {
// See sample code at http://developer.android.com/google/play-services/id.html
try {
Info adInfo = AdvertisingIdClient.getAdvertisingIdInfo(getApplicationContext());
mobileAppTracker.setGoogleAdvertisingId(adInfo.getId(), adInfo.isLimitAdTrackingEnabled());
} catch (IOException e) {
// Unrecoverable error connecting to Google Play services (e.g.,
// the old version of the service doesn't support getting AdvertisingId).
mobileAppTracker.setAndroidId(Secure.getString(getContentResolver(), Secure.ANDROID_ID));
} catch (GooglePlayServicesNotAvailableException e) {
// Google Play services is not available entirely.
mobileAppTracker.setAndroidId(Secure.getString(getContentResolver(), Secure.ANDROID_ID));
} catch (GooglePlayServicesRepairableException e) {
// Encountered a recoverable error connecting to Google Play services.
mobileAppTracker.setAndroidId(Secure.getString(getContentResolver(), Secure.ANDROID_ID));
} catch (NullPointerException e) {
// adInfo is sometimes null
mobileAppTracker.setAndroidId(Secure.getString(getContentResolver(), Secure.ANDROID_ID));
}
}
}).start();
Select a preferred platform.