eventsPerRequest

The eventsPerRequest property sets the maximum number of queued events the SDK sends in a single HTTP request when it uploads from local storage.

If more events are queued than the configured limit, the SDK sends multiple requests until all queued events are sent.

Use dispatchInterval to control how often the SDK dispatches queued events.

Syntax

PiwikTracker.sharedInstance()?.eventsPerRequest = events
[PiwikTracker sharedInstance].eventsPerRequest = events;

Parameters

  • eventsPerRequest (integer, required)
    Maximum number events sent in a single HTTP request when queued events are dispatched. Default: 20.

Examples

To send at most 50 events per request:

PiwikTracker.sharedInstance()?.eventsPerRequest = 50
[PiwikTracker sharedInstance].eventsPerRequest = 50;

Notes

  • Whether the SDK uses GET or POST depends on the number of events being sent. See dispatch().
  • A higher eventsPerRequest value usually results in fewer requests, but each request can contain more data.

Related methods


Did this page help you?