CollectOptions time; the SDK uses it for:
- User identification
- Tracking user data
SharedPreferences and replayed on subsequent events until changed.
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.| Method | Type | Value | Description |
|---|---|---|---|
optOut(value) | Boolean | false | Explicit consent signal. When true, the SDK is fully suppressed. |
GDPR TCF 2.0
Use this when your app integrates a TCF 2.0 CMP. The SDK reads the TCF variables fromSharedPreferences and queries the consent string before recording events.
| Method | Type | Value | Description |
|---|---|---|---|
useConsent(consent) | Boolean | true | SDK waits for a consent signal before recording. |
checkForCMP(is_CMP_available) | Boolean | true | Reads TCF 2.0 variables from SharedPreferences. Set false to use setConsent instead. |
checkZeotapVendorConsent(boolean) | Boolean | true/false | If true, the SDK requires Zeotap Vendor consent when resolving GDPR consent. Default false. |
purposesForTracking(tracking_ids) | List<Integer> | Arrays.asList(1, 3, 4) | TCF purpose IDs that gate tracking. |
purposesForIdentifying(identification_ids) | List<Integer> | Arrays.asList(1, 9) | TCF purpose IDs that gate identification. |
Custom consent
Use this when you want full control — nooptOut shortcut, no TCF API. Supply consent explicitly via setConsent.
SharedPreferences and replayed on every subsequent event until a new setConsent call overrides it.
Primary consent keys (Custom only)
| Key | Type | Description |
|---|---|---|
track | Boolean | true to allow event tracking. |
identify | Boolean | true to allow user matching and third-party enrichment (e.g. zcookie, ID+). |
Wait for consent before sending events
IfuseConsent(true) and no consent is set yet, the SDK queues events and waits. Use listenToAskForConsent to trigger your consent UI:
Granular signaling
You don’t have to grant all signals together. Set them independently:Brand consent
Brand-specific consent (e.g.zeotapVendorConsent, xyzVendorConsent) is honored under any consent strategy and persists across events:
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
optOut.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.