Data and privacy
Data collection controls
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
| Control | What it does | Where |
|---|---|---|
| Minimal mode | Stops the second tier of device data | deviceDataCollection at configure |
| Your own calls | Events, attributes, email, phone, purchases and location are sent only when your code sends them | Your 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 ID | Any time |
| Identity verification | Decides whose data Herald accepts and returns | The connection's Mobile SDK card. See Security and identity verification. |
| SDK settings | SDK 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 |
| Geofences | SDK 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 address | When 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.
| Data | Wire 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 name | context.app |
| OS name and version | context.os |
| The device's region setting (a two-letter code from the locale, not a location) | context.region |
| SDK name and version | sdk |
| Session start and end, with duration | session_start, session_end events |
| Message interactions: impressions, clicks, button taps, dismissals, push opens | interaction 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
| Data | Wire field |
|---|---|
| Device manufacturer, model and type (phone, tablet and so on) | context.device |
| Screen width, height and density | context.screen |
| Locale | context.locale |
| Language | context.language |
Time zone (IANA name, such as America/Chicago) | context.timezone |
Network type: wifi, cellular, ethernet, other or none | context.network.type |
| Notification permission state | context.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.
Herald.configure(appKey: "YOUR_APP_KEY", endpoint: URL(string: "https://YOUR_HERALD_HOST")!) { options in
options.deviceDataCollection = .minimal
}Herald.configure(
this,
appKey = "YOUR_APP_KEY",
endpoint = "https://YOUR_HERALD_HOST",
options = HeraldOptions(deviceDataCollection = 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
| Data | Call |
|---|---|
| External ID and traits | identify |
| Custom events, screens, purchases | track, screen, trackPurchase |
| User attributes | setAttribute, setAttributes |
| Email address, phone number | setEmail, setPhone |
| Channel subscriptions | setSubscription, and requestPushAuthorization for push |
| Push token | setPushToken (on Android, herald-fcm calls it for you) |
| Latitude and longitude | setLocation: only the values you pass |
| Geofence entered or left: the geofence's id and name, never coordinates | enableGeofences() (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.
Herald.shared.setEnabled(false)Herald.setEnabled(false)While the SDK is off:
- Calls such as
track,identifyandsetAttributesare 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:
contentCardsis empty untilsetEnabled(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-fcmdoes 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. AfterwipeData(),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 withrequestPushAuthorization()orsetSubscription.
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.
| Setting | Values |
|---|---|
| Collect events | On 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 collection | Standard or Minimal |
| Track app lifecycle events, Track pushes your app sends, Track deep links | On or Off |
| Geofences | On 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.
Herald.shared.wipeData()
// The SDK is now off. Turn it back on when collection may resume:
Herald.shared.setEnabled(true)Herald.wipeData()
// The SDK is now off. Turn it back on when collection may resume:
Herald.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.