Prerequisites
Before you begin, ensure you have:- Created Android and iOS sources in the Zeotap CDP account
- Obtained write_keys for both platforms. How to obtain a write key?
- React Native development environment set up
Integration Steps
Install the Package
Run the following command from your project’s root directory:package.json file for the zeo-collect package in the dependencies section.
Set up Android
Configure the Zeotap Android SDK using the Dependency Manager:Configure Repositories
Add the Maven URL to your project-levelbuild.gradle or settings.gradle file:
Add Dependencies
In your app-levelbuild.gradle file, add the following dependencies:
Configure Compile Options
Add compile options to the android block:Build Project
Clean and rebuild your project:Set up iOS
Configure the Zeotap iOS SDK using CocoaPods:Install CocoaPods
Check if CocoaPods is installed:Install Dependencies
Navigate to the iOS directory of the project and addZeotapCollect package.
Open Workspace
Open the.xcworkspace file in Xcode (not the .xcodeproj file):
To find the exact Android and iOS build versions required for a specific React Native version, please refer to the release notes.
Initialization
Initialize the SDK in your app’s entry point (App.js or App.tsx):
You need to input your
Android key and iOS write keys in place of YOUR_ANDROID_WRITE_KEY and YOUR_IOS_WRITE_KEY so that the data gets ingested to an respective iOS source and 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 React Native 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:
Send Your First Event
Start tracking events in your components:Verify Integration
After completing the setup:- Send Test Events: Trigger some events through your app
- Check Logs: Monitor console for SDK messages
- Verify in Zeotap: Log into the Zeotap CDP App and check the PREVIEW tab for your Android/iOS sources
Common Issues
Android Build Issues
- Ensure Gradle versions are compatible
- Check that all dependencies are properly added
- Clean and rebuild the project
iOS Build Issues
- Make sure you’re opening the
.xcworkspacefile - Verify CocoaPods installation is complete
- Check iOS deployment target compatibility
JavaScript Issues
- Verify package installation in
package.json - Check import statements are correct
- Ensure initialization occurs before tracking calls
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