Batch Support
    • 1 Minute to read
    • Dark
      Light

    Batch Support

    • Dark
      Light

    Article summary

    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. The default batch size is 5000 requests, and the maximum batch size is 10,000 requests.
    false = Sends tracking requests individually (default behavior).

    If the cached tracking data exceeds the maximum batch size of 10,000 requests, the SDK will send multiple batches to the tracking server.

    Key Points

    • Batch Support helps conserve device battery and bandwidth while ensuring request order is maintained.

    • The default batch size is 5000 requests, and you can adjust it up to 10,000 requests per batch.

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


    Was this article helpful?