Skip to content
Menu

Data and privacy

Data collection controls

Markdown version

Every control that limits what the SDK collects and sends: the two device data tiers, minimal mode, what is never collected, setEnabled and wipeData.

You decide what the SDK collects. It sends a small fixed set of device data, a second set you can turn off, and nothing else unless your app calls it. This page lists every control and exactly what it changes.

The controls at a glance

ControlWhat it doesWhere
Minimal modeStops the second tier of device datadeviceDataCollection at configure
Your own callsEvents, attributes, email, phone, purchases and location are sent only when your code sends themYour app
setEnabled(false)Sends one best-effort push unsubscribe for the device, then stops all collection, sending and message display, hides cached content cards, and remembers that across launches. setEnabled(true) re-subscribes push when the device still has its token and permission.Any time
wipeData()Sends one best-effort push unsubscribe for the device, deletes everything the SDK stored on the device and leaves the SDK off until setEnabled(true), which starts with a new device IDAny time
Identity verificationDecides whose data Herald accepts and returnsThe connection's Mobile SDK card. See Security and identity verification.
SDK settingsSDK 0.6.0+. Change data collection, lifecycle and deep link events, the send interval and session timeouts, or turn off Collect events for every device, without an app update. Apps pick up changes within an hour or on next launch. See Remote SDK settings.Console: Settings, SDK settings
GeofencesSDK 0.7.0+. Off by default: nothing location-related runs until your app adds the geofence module, holds background location permission and calls enableGeofences(). disableGeofences() stops it. The Geofences SDK setting set to Off stops it on every device. See Geofences.Your app; console: Settings, SDK settings
Store location from IP addressWhen off, Herald doesn't record a country, region or approximate location from the request. Locale and time zone your app sends are still used. On by default.Console: Settings, SDK settings

Tier 1: always sent

The SDK cannot work without these, so minimal mode keeps them.

DataWire field
Device ID: a random UUID the SDK creates. Not the IDFA, IDFV, Android ID or advertising ID.deviceId
App name, version, build, and bundle ID or package namecontext.app
OS name and versioncontext.os
The device's region setting (a two-letter code from the locale, not a location)context.region
SDK name and versionsdk
Session start and end, with durationsession_start, session_end events
Message interactions: impressions, clicks, button taps, dismissals, push opensinteraction events

Herald also records the country of each batch: the two-letter code its hosting edge derives from the request's IP address when available, otherwise the region setting. It does not store the request's IP address with SDK data. Turn off Store location from IP address (Settings, SDK settings in the console, per app) and Herald records no country from the request; the region setting your app sends is still kept. A country already stored for a device is replaced at that device's next batch, so a device that never sends again keeps the one it had.

With the setting on, Herald also keeps an approximate location for each device: the latitude and longitude of the city its hosting edge derives from the request's IP address, rounded to 0.1° (about 11 km). It powers the console's Live map, which shows people active in the last 5 minutes as lights, grouped by place, with no names. Turn the setting off and the location is cleared at the device's next batch. If your app passes a location to the SDK, the Live map uses that instead, rounded the same way.

Tier 2: sent by default, off in minimal mode

DataWire field
Device manufacturer, model and type (phone, tablet and so on)context.device
Screen width, height and densitycontext.screen
Localecontext.locale
Languagecontext.language
Time zone (IANA name, such as America/Chicago)context.timezone
Network type: wifi, cellular, ethernet, other or nonecontext.network.type
Notification permission statecontext.push.authorization

In minimal mode these keys are left out of the batch, not sent empty. Herald keeps only the latest context per device, so stored tier 2 values are replaced by the next batch after you switch.

swift
Herald.configure(appKey: "YOUR_APP_KEY", endpoint: URL(string: "https://YOUR_HERALD_HOST")!) { options in
    options.deviceDataCollection = .minimal
}

What minimal mode costs: Herald cannot fill a user's time zone from the device, so send-time optimization relies on time zones you sync from your warehouse.

Sent only when your app calls the SDK

DataCall
External ID and traitsidentify
Custom events, screens, purchasestrack, screen, trackPurchase
User attributessetAttribute, setAttributes
Email address, phone numbersetEmail, setPhone
Channel subscriptionssetSubscription, and requestPushAuthorization for push
Push tokensetPushToken (on Android, herald-fcm calls it for you)
Latitude and longitudesetLocation: only the values you pass
Geofence entered or left: the geofence's id and name, never coordinatesenableGeofences() (SDK 0.7.0+, geofence module only)

Send only what you need for messaging. Event properties and attributes are stored as you send them, so do not put passwords, payment card numbers, health records or other sensitive data in them.

Never collected

  • Advertising identifiers: IDFA on iOS, the advertising ID on Android.
  • Vendor and hardware identifiers: IDFV, Android ID.
  • Location from the operating system, unless your app calls enableGeofences(). Even then the SDK never asks for location permission and never sends the device's location: the operating system watches the geofences on the device, and only a crossing (the geofence's id and name) is sent.
  • Contacts, photos, files or other personal content.
  • Mobile carrier.

Turn the SDK off and on

setEnabled(false) stops everything until you call setEnabled(true). The setting is saved, so it holds across launches.

swift
Herald.shared.setEnabled(false)

While the SDK is off:

  • Calls such as track, identify and setAttributes are ignored, not queued.
  • Nothing is sent. Events queued before you turned it off stay on the device and are sent after setEnabled(true).
  • No new sessions start, messages do not sync, and in-app messages do not show.
  • Content cards already on the device are hidden: contentCards is empty until setEnabled(true), which shows them again.
  • Push: as it turns off, the SDK sends one push unsubscribe for this device (only when it has a push token), so Herald stops sending it pushes. It tries once, in the background, and does not retry, so a device that is offline at that moment can still get pushes. On Android, herald-fcm does not show Herald pushes while the SDK is off. On iOS the system shows alert pushes without asking the app.
  • After setEnabled(true), if the device still has its push token and notification permission, the SDK sends the token again with a push subscription of subscribed, which lifts the unsubscribe. After wipeData(), setEnabled(true) fetches the push token again when notification permission is still granted and sends it with subscribed; otherwise pushes resume only once the app records the push subscription again with requestPushAuthorization() or setSubscription.

Remote SDK settings

SDK 0.6.0 and later fetch the app's settings from Herald at launch and on a foreground at most once an hour. Set them per app in the console under Settings, SDK settings. Each one is either a value or Use app's value, which keeps what your app was built with.

SettingValues
Collect eventsOn or Off. Off stops all event collection and sending in the SDK (iOS crash reports included), clears its queue, and skips message syncs until you turn it back on. Push tokens and subscription changes wait on the device and go out when it is back on. The SDK keeps checking the setting, so it resumes on its own.
Send interval (seconds)5 to 300
Session timeout in foreground (minutes), Session timeout in background (minutes)1 to 1,440
Data collectionStandard or Minimal
Track app lifecycle events, Track pushes your app sends, Track deep linksOn or Off
GeofencesOn or Off. SDK 0.7.0+. Off stops geofence monitoring on every device the next time the app starts, even in apps that call enableGeofences(). On or Use app's value leaves it to the app.

The SDK caches the last settings it fetched and applies them at the next launch before it fetches again. When the fetch fails, the cached or built-in settings stay. setEnabled(false) in your app always wins: nothing is fetched or sent while it is in effect.

Wipe the device

wipeData() first sends the same one-time push unsubscribe as setEnabled(false), under the old device ID. It then deletes the SDK's files and memory on the device: queued events, the External ID and token, cards (contentCards is emptied at once), in-app messages, in-app history and the device ID. When the SDK is turned on again it uses a new device ID, so the device looks like a new install to Herald. On Android it keeps one marker that records that the notification prompt was shown, so the permission keeps reading denied rather than not_determined; the marker holds no user data.

swift
Herald.shared.wipeData()
// The SDK is now off. Turn it back on when collection may resume:
Herald.shared.setEnabled(true)

After wipeData() the SDK stays off until you call setEnabled(true). It then starts with a new device ID.

With the geofence module, the SDK stops monitoring and deletes its cached geofence list and crossing times the next time the app calls enableGeofences() or a geofence is crossed. Call disableGeofences() with wipeData() to stop monitoring at once.

wipeData() does not delete anything Herald already received. See User data deletion.

See Herald decide live →