Batch Support

Prev Next

The Mapp Android SDK allows you to send recorded tracking data in batches rather than individual requests. This helps to conserve battery and bandwidth and ensures that requests are processed in chronological order.

When using batch support, we recommend enabling the client timestamp for more accurate page duration calculations. For further information or assistance with configuration, please contact Mapp support or your Account Manager.

Example Configuration

The following example shows how to enable and configure batch support:

Kotlin Example:

val webtrekkConfiguration = WebtrekkConfiguration.Builder(
        trackIds = listOf("track Id"), trackDomain = "https://your-trackdomain.com"
        )
        .setBatchSupport(true, 5000) // Enable batch support with 5000 requests per batch
        .build()

        Webtrekk.getInstance().init(context, webtrekkConfiguration)

Java Example:

WebtrekkConfiguration webtrekkConfiguration = new WebtrekkConfiguration.Builder(
        Arrays.asList("track Id"), "https://your-trackdomain.com"
        )
        .setBatchSupport(true, 5000) // Enable batch support with 5000 requests per batch
        .build();

        Webtrekk.getInstance().init(context, webtrekkConfiguration);

Batch Support Parameters

Parameter

Description

setBatchSupport

  • true = Enables batch support, with requests sent in batches. Typical batch sizes range between 20 and 50 requests. The default batch size limit is 5,000 requests.

  • false = Sends tracking requests individually (default behavior).

If the cached tracking data exceeds the configured batch size, the SDK will send multiple batches to the tracking server.

Key Points

  • Batch Support helps conserve device battery and bandwidth while maintaining the request order.

  • Typical batch sizes range between 20 and 50 requests. The maximum supported batch size is 10,000 requests.

  • For best results, ensure you use the client timestamp when calculating page duration.