I recently implemented @amplitude/analytics-browser package in my react application. I have initialized the app and then I am using the track()
method to send the events to amplitude. However, I noticed there's a lot of duplication. When I load the app, it will place a request to https://api2.amplitude.com/2/httpapi
with the request object firing the load event. When I click a button, it will again make a similar request but now it contains the load event as well as the click event. I was assuming that it will only send one event at a time but it looks like it keeps clubbing up the events and sends them to the server. Every time I perform an action, it clubs up with the previous events and sends it to the server.
How can I prevent it from sending all the events all over again and again? Can I not send one event at a time?
Thanks.