Send Tracking Data in Batches

Prev Next

By default, the Mapp Intelligence iOS SDK sends tracking requests individually. If you want to reduce the number of network calls, enable batch support and let the SDK send cached requests in groups.

Batching can help reduce bandwidth and battery usage while preserving the chronological order of requests.

When to use batch support

  • Use it when your app records many tracking events and you want to reduce the number of outgoing requests.

  • Keep the default behavior if you do not have a specific reason to batch.

Enable batch support

Set batchSupportEnabled to true on the shared instance, and optionally adjust batchSupportSize:

MappIntelligence.shared()?.batchSupportEnabled = true
MappIntelligence.shared()?.batchSupportSize = 150
[[MappIntelligence shared] setBatchSupportEnabled:YES];
[[MappIntelligence shared] setBatchSupportSize:150];

Configuration details

Setting

Description

batchSupportEnabled

true enables batch support. false (default) keeps the default behavior and sends requests individually.

batchSupportSize

Number of cached requests included in one batch. SDK default is 5000. Maximum supported value is 10000. For most apps, a batch size between 20 and 50 requests is sufficient.

If the number of cached requests exceeds the configured batch size, the SDK sends multiple batches until the queue is processed.

Notes

  • Batch support is disabled by default.

  • If you use batching and rely on accurate timing analysis, enabling the client timestamp on the server side is recommended. Contact your account manager to enable client timestamp support for your account.

Related: Configure Global Tracking.