Setup in Zeotap CDP
Create an Android source in your Zeotap CDP account. How to create an Android source? Obtain the write key from the created source. How to obtain a write key?Installation
Method 1: Dependency Manager (Recommended)
Add Maven Repository
Add the Zeotap Maven repository to your project-levelbuild.gradle or settings.gradle file:
Add Dependencies
In your app-levelbuild.gradle file, add the SDK dependency:
Configure Compile Options
Add Java 8 compatibility to your app-levelbuild.gradle:
Add Permissions
Add the AD_ID permission to yourAndroidManifest.xml for API level 12+:
Build Project
Clean and rebuild your project:- Clean your project: Build > Clean Project
- Sync with Gradle files
- Rebuild: Build > Rebuild Project
Method 2: Manual Installation
Download SDK
Download the Android SDK AAR file from the link and place it in your project’s libs folder:Configure Gradle for Local Dependencies
Add the following to your app-levelbuild.gradle before the dependencies block:
Add AAR Dependency
Add the AAR file to your dependencies:Create lib-dependencies.gradle
Create a file namedlib-dependencies.gradle in your app directory with:
Complete Remaining Steps
Follow the Configure Compile Options, Add Permissions, and Build Project steps from Method 1 above.Initialization
Initialize the SDK in yourMainApplication.java (or the Kotlin equivalent) inside the onCreate() method:
AndroidManifest.xml:
You need to input your
write key in place of YOUR_WRITE_KEY so that the data gets ingested to an Android source created in your Zeotap CDP account.Setting up User Identities (Learn more)
Once the Zeotap SDK is integrated, you can start setting up user identities. User identities are how you associate data to specific users. The Zeotap Android SDK provides thesetUserIdentities function to identify your users:
Setting User Properties (Learn more)
User properties allow you to store information about your users that doesn’t change frequently, such as subscription status, user preferences, or demographic information. To set user properties, use thesetUserProperties method:
Tracking User Events (Learn more)
Event tracking allows you to track specific actions that users take in your app, such as making a purchase, completing a level, or sharing content. To track user events, you can use thesetEventProperties method:
Verify Integration
After completing the setup:- Send Test Events: Trigger some events through your app
- Check Logs: Enable logging and monitor logcat for SDK messages
- Verify in Zeotap: Log into the Zeotap CDP App and check the PREVIEW tab for your Android source
Common Issues
Build Issues
- Ensure Gradle versions are compatible
- Check that all dependencies are properly added
- Clean and rebuild the project
Maven Repository Not Found
- Ensure the Maven URL is added to the project-level build.gradle
- Perform a Gradle sync after adding the URL
Dependency Resolution Issues
- Check if you’re using the correct version number
- Ensure all required dependencies are included
Next Steps
Now that you have the basic setup working:- Learn about available APIs - Explore all tracking methods
- Configure consent management - Set up privacy compliance
- Customize configurations - Optimize for your use case
- View examples - See advanced implementation patterns