The Interceptd SDK is available via:
JCenter AAR
Interceptd SDK is available as an AAR via JCenter; to use it, add the following to your build.gradle
.
repositories {
jcenter() // includes Interceptd SDK
}
dependencies {
// Be sure that you are using latest version
implementation 'com.ntrcptd.sdk:analytics:<latest-version>'
}
Minimum supported SDK version is 14. Be sure that minSdkVersion in your gradle file isn't lower than 14.
Kotlin Users
import com.ntrcptd.ntrcptdsdk.InterceptdAnalytics
Java Users
import com.ntrcptd.ntrcptdsdk.InterceptdAnalytics;
Interceptd SDK is required for tracking. Application cannot track any information before SDK initialization is complete.
In application’s onCreate
function of the initial activity, call InterceptdAnalytics.initialize
function with applicationId
parameter. This parameter should be your application id from Interceptd User Dashboard, you can use your application id for integration purposes. Check the following codes for sample:
Kotlin Users
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
InterceptdAnalytics.initialize("your-user-id")
}
Java Users
@Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
InterceptdAnalytics.Instance.initialize("your-user-id");
}
Using Interceptd SDK, you are able to track the frequency of custom events by placing the following code piece into your own application code. You can also attach data to your events. Only JSONObject is accepted as data. If you are planning to put an object as a value in JSONObject, make sure the object is JSON serializable.
Kotlin Users
InterceptdAnalytics.track(eventName: String)
InterceptdAnalytics.track(eventName: String, data: JSONObject)
Java Users
InterceptdAnalytics.Instance.track(String eventName);
InterceptdAnalytics.Instance.track(String eventName, JSONObject data);
Interceptd SDK logging level can be changed with setLogLevel
after InterceptdAnalytics.initialize
call. Default is <ASLog.Level.DEBUG>.
Kotlin Users
InterceptdAnalytics.setLogLevel(<ASLog.Level>)
Java Users
InterceptdAnalytics.Instance.setLogLevel(<ASLog.Level>);
Interceptd Mobile Team