Batching should first be done on a per-user basis, and then across users, with up to 50 users modified in a single multi
request. For example, if you want to track
an event and setUserAttributes
for two users, the total billable calls is entirely dependent on how you setup your multi
requests.
DO
Batch by user first. For example:
multi
request 1:
- track (user1)
- setUserAttributes (user1)
multi
request 2:
- track (user2)
- setUserAttributes (user2)
Each of these requests requires one user lookup, so the total billable API calls is two (despite executing four actions). In this case, however, you could combine these into a single multi
request without using additional API calls:
multi
request 1:
- track (user1)
- setUserAttributes (user1)
- track (user2)
- setUserAttributes (user2)
This single request still only requires two unique user lookups, so the total billable API calls remains two.
AVOID
Batching requests by action instead of by user.
multi
request 1:
- track (user1)
- track (user2)
multi
request 2:
- setUserAttributes (user1)
- setUserAttributes(user2)
In this case, each request requires two user lookups. Therefore, there are four billable API calls. Avoid this, as it is not an efficient use of multi
.