Skip to main content
The React Native package has three consent strategies — pick one in your initialiseZeoCollect options. The package uses the strategy for:
  • User identification
  • Tracking user data
The native SDKs persist consent decisions (iOS in UserDefaults, Android in SharedPreferences) and replay them on subsequent events.
For Default Opt-in and GDPR strategies, only brand consent is honored from setConsent — the primary track and identify fields are ignored. Primary fields apply only in Custom mode.

Default opt-in

Use this when you don’t have a CMP and consent is conveyed by your own server-side logic.
initialiseZeoCollect({
  android_write_key: "...",
  ios_write_key: "...",
  opt_out: false
});
OptionTypeDefaultDescription
opt_outBooleanfalseExplicit consent signal. When true, the package is fully suppressed.

GDPR TCF 2.0

Use this when your app integrates a TCF 2.0 CMP for either platform. The native SDKs read the TCF data and query the consent string before recording events.
initialiseZeoCollect({
  android_write_key: "...",
  ios_write_key: "...",
  use_consent: true,
  check_for_cmp: true,
  purposes_for_tracking: [1, 3, 4],
  purposes_for_identify: [1, 9]
});
OptionTypeDefaultDescription
use_consentBooleantrueWaits for a consent signal before recording.
check_for_cmpBooleantrueReads TCF 2.0 variables stored by other CMPs. Set false to use setConsent instead.
check_zeotap_vendor_consentBooleanfalseIf true, requires Zeotap Vendor consent when resolving GDPR consent.
purposes_for_trackingnumber[][1, 3, 4]TCF purpose IDs that gate tracking.
purposes_for_identifynumber[][1, 9]TCF purpose IDs that gate identification.
Use this when you want full control — no opt_out shortcut, no TCF API. Supply consent explicitly via setConsent.
initialiseZeoCollect({
  android_write_key: "...",
  ios_write_key: "...",
  use_consent: true,
  check_for_cmp: false
});

// Later, when the user decides:
import { setConsent } from 'zeo-collect';
setConsent({ track: true, identify: true });
The decision is stored natively and replayed on every subsequent event until a new setConsent call overrides it.
KeyTypeDescription
trackBooleantrue to allow event tracking.
identifyBooleantrue to allow user matching and third-party enrichment.
If use_consent: true and no consent is set yet, the package queues events and waits. Use listenToAskForConsent to trigger your consent UI:
import { listenToAskForConsent } from 'zeo-collect';

listenToAskForConsent(() => {
  // show your consent banner / modal
});

Granular signaling

You don’t have to grant all signals together:
// User wants tracking but not identification
setConsent({ track: true, identify: false });
Brand-specific consent (e.g. zeotapVendorConsent, xyzVendorConsent) is honored under any consent strategy and persists across events:
setConsent({
  zeotapVendorConsent: true,
  xyzVendorConsent: false
});
Under Default Opt-in and GDPR modes, only brand consent keys are honored — track and identify are ignored.

Choosing a strategy

Default opt-in

No CMP, simple control via opt_out.

GDPR TCF 2.0

You already have a TCF 2.0 CMP in your app.

Custom

You want granular control and your own consent UI.
Last modified on June 22, 2026