You’ll be sending events from your Android app in three steps.
Create an Android Source
In the Zeotap CDP, create a Source of category App Events with data source Android Native SDK . From the IMPLEMENTATION DETAILS tab, copy your write_key. Full walkthrough: Create an Android SDK Source .
Add the SDK
Gradle (recommended)
Manual (AAR)
In the project-level build.gradle (or settings.gradle), add the Zeotap Maven repo: repositories {
google()
maven { url 'https://sdk.zeotap.com/android-sdk' }
}
In the app-level build.gradle, add the dependency (replace X.X.X with the latest version): dependencies {
implementation "com.zeotap:zeo-collect:X.X.X"
}
Add Java 8 compile options to the android block: android {
compileOptions {
sourceCompatibility JavaVersion . VERSION_1_8
targetCompatibility JavaVersion . VERSION_1_8
}
}
If your app targets Android 13+ and you want the SDK to retrieve the AdID for you: dependencies {
implementation "com.google.android.gms:play-services-ads:20.4.0"
}
For apps targeting below Android 13, the SDK retrieves the AdID automatically. Add Gson if you don’t already include it: dependencies {
implementation "com.google.code.gson:gson:2.10.1"
}
Then Build → Clean Project , sync Gradle, and Build → Rebuild Project .
Download the SDK from content.zeotap.com/android-sdk/android-collect-sdk.zip .
Move the AAR to Project root → app → libs/ (create libs/ if it doesn’t exist).
In the app-level build.gradle, before the dependencies block:
apply from : 'lib-dependencies.gradle'
repositories {
flatDir { dirs 'libs' }
}
On Android Studio Bumblebee or later, flatDir isn’t supported in the project repositories. Use sourceSets inside the android block instead: android {
sourceSets {
main { jniLibs . srcDirs = [ 'libs' ] }
}
}
apply from : 'lib-dependencies.gradle'
In the dependencies block, reference the AAR:
dependencies {
implementation ( name : 'zeotap-collect-android-vX.X.X' , ext : 'aar' )
// or
implementation files( "libs/zeotap-collect-android-vX.X.X.aar" )
}
Create lib-dependencies.gradle at Project root → app/ with:
dependencies {
implementation "io.reactivex.rxjava2:rxandroid:2.0.1"
implementation "io.reactivex.rxjava2:rxjava:2.0.1"
implementation "com.google.code.gson:gson:2.8.8"
implementation "com.google.android.gms:play-services-ads:20.4.0"
}
Build → Clean Project , sync Gradle, Build → Rebuild Project .
Initialize the SDK in MainApplication
Add the SDK initialization to MainApplication.onCreate: import com.zeotap.collect.Collect;
import com.zeotap.collect.CollectOptions;
public class MainApplication extends Application {
@ Override
public void onCreate () {
super . onCreate ();
CollectOptions options = CollectOptions . builder ( this )
. credential ( "YOUR_WRITE_KEY" )
. enableLogging ( true )
. uploadBatchSize ( 5 )
. maxCacheSize ( 500 )
. useConsent ( true )
. checkForCMP ( false )
. build ();
Collect . init (options);
// Or with a callback:
// Collect.init(options, (res) -> { /* handle response */ });
}
}
In AndroidManifest.xml, declare MainApplication: < application
android:name = ".MainApplication"
... >
</ application >
For apps on API 31+ that want the AdID, declare the permission: < uses-permission android:name = "com.google.android.gms.permission.AD_ID" />
Send your first event
From anywhere in your app: Collect collect = Collect . getInstance ();
collect . setPageProperties ( Collections . singletonMap ( "name" , "Home" ));
Map < String , Object > eventProps = new HashMap <>();
eventProps . put ( "productID" , "1234" );
collect . setEventProperties ( "view_product" , eventProps);
To verify, log into the Zeotap CDP, open your Android Source, and watch the PREVIEW tab for incoming events.
Next steps
Configure CollectOptions Consent flags, batching, hashing, country, and more.
Capture user identities Stitch events to profiles using email, phone, login ID, or custom IDs.
Set up consent Default opt-in, TCF 2.0, or custom consent.
See examples Common patterns: AdID, login, logout, callbacks.
Last modified on June 22, 2026