-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a way to batch events and send them manually? #452
Comments
Hi @emathew80, events are batched by default. You can configure the batch behavior by setting Learn more about configurations. |
@Mercy811, ideally, I would want a way for the SDK to collect events and only send to amplitude when I call a function on the SDK to send events to the amplitude server. The usecase here is that we do not know the user/client preference until login. If the user/client preference is not to send events, we cannot send events that are collected prior to login and will need to flush those events collected prior to login. If the user/client pref is that we are allowed to send events, we want to be able to batch and send the events that happen prior to login all at once at that time. Ive looked already at the suggestions above, but none of them give the app the control on when exactly to send a batch of events. The batch size could potentially be 3 or 30. The period seconds is variable based on the user and activity prior to login, etc. We would like to be able to collect a batch of events and then at some specific user action (ie successful login and policy eval) call the amplitude sdk to send/dispatch the batch. |
Hi @emathew80, thanks for your clarification.
|
Ah interesting so.... if I setOfline to true in the beginning of the app launch and then I log, say, 10 events... then set setOffline to false once the user/client logs in, the SDK should send those 10 events at that time? It seems that way, but I just wanted to be sure! |
Yes it does! |
Amazing, thank you so much! |
@Mercy811 You mentioned an ability to flush. Is there documentation on that? |
Summary
We want to be able to batch events prior to login and after login, we can see if the user has opted out of amplitude reporting. If the user has opted out of reporting then we want to flush the batch and if the user has agreed to amplitude tracking, we want to send that batch immediately and continue sending events through the user journey. Ideas?
The text was updated successfully, but these errors were encountered: