Skip to main content
1

Create Android and iOS Sources

In the Zeotap CDP, create:
  • A Source of category App Events with data source Android Native SDK — copy the Android write_key.
  • A Source of category App Events with data source iOS Native SDK — copy the iOS write_key.
See Create an Android SDK Source and Create an iOS SDK Source.
2

Install the package

From your project root:
npm install zeo-collect
Confirm zeo-collect is listed under dependencies in package.json.
3

Set up the Android native SDK

In project-level build.gradle (or settings.gradle):
repositories {
  google()
  maven { url 'https://sdk.zeotap.com/android-sdk' }
}
In app-level build.gradle:
dependencies {
  implementation "com.zeotap:zeo-collect:2.1.1"
}

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:
dependencies {
  implementation "com.google.android.gms:play-services-ads:20.4.0"
}
Add Gson if you don’t already include it:
dependencies {
  implementation "com.google.code.gson:gson:2.10.1"
}
Build → Clean Project, sync Gradle, Build → Rebuild Project.
4

Set up the iOS native SDK

Confirm CocoaPods is installed: pod --version. If not, install it from guides.cocoapods.org.From your React Native project root:
cd ios
pod install
After pod install completes, close Xcode and reopen yourApp.xcworkspace (not .xcodeproj).
5

Initialize the package in your App entry point

In App.js (or App.tsx), call initialiseZeoCollect from inside a useEffect so it runs once on mount:
import React, { useEffect } from 'react';
import { initialiseZeoCollect } from 'zeo-collect';

const App = () => {
  useEffect(() => {
    const options = {
      android_write_key: "YOUR_ANDROID_WRITE_KEY",
      ios_write_key: "YOUR_IOS_WRITE_KEY",
      batch_size: 30,
      opt_out: false,
      service_interval: 90,
      use_consent: false,
      check_for_cmp: false,
      user_country: "ind"
    };

    initialiseZeoCollect(options);

    // Or with a callback:
    // initialiseZeoCollect(options, (data) => {
    //   console.log("Initialisation status", data);
    // });
  }, []);

  return (
    // your app
  );
};

export default App;
Key names must match exactly as shown in the configuration reference. android_write_key and ios_write_key are always strings.
6

Send your first event

From any component:
import {
  setPageProperties,
  setEventProperties,
  setEventNameProperties
} from 'zeo-collect';
import { Button } from 'react-native';

const ProductScreen = ({ name, price }) => {
  return (
    <>
      <Button
        title="View"
        onPress={() => {
          setPageProperties({ name: "Product Detail" });
          setEventProperties("view_product", { name, price });
        }}
      />

      <Button
        title="Primary"
        onPress={() => setEventNameProperties("primary_button_clicked")}
      />
    </>
  );
};
To verify, log into the Zeotap CDP, open either Source (Android or iOS), and watch the PREVIEW tab for incoming events.

Next steps

Configure all options

Consent flags, batching, hashing, country.

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

Component patterns, identity flow, payloads.
Last modified on June 22, 2026