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
Javascript tracker can send tracking API requests as bulk for better performance #4910
Comments
For example in this documentation: http://piwik.org/docs/ecommerce-analytics/#tracking-ecommerce-orders-items-purchased-required we recommend the following (currently):
so the idea would be to bulk those two requests in one bulk request. |
we need to pick a timer delay (eg. 100ms), the piwik.js queue will wait for this timer to "collect" other pushed requests, and then will send as bulk if there is more than one queued. |
Note: in Contents tracking plugin Thomas used this technique to send a bulk request. This was done in: 774611a See piwik.js tracking function |
After a few experiments with piwik, I can confirm that the bug still exists. When a mix of events and page visits happen nearly simultaneously, it is likely that they are put to the database in the wrong order. The issue seems to be simply caused by different speeds of HTTP requests. Having that I'm new to piwik, so I'm afraid I'll be only able to implement some dirty solution if any at all. If anyone knowledgeable in |
At this point it seems better not to implement this feature, as otherwise it would lead to many POST requests to the Tracking API which is not desired because it would prevent us from Replaying the tracking requests later on, in case of a Piwik server problem. Wont fix. |
This issue has been mentioned on Matomo forums. There might be relevant details there: https://forum.matomo.org/t/javascript-react-bulk-sending-events/50498/1 |
@mattab What if we store client time for each event and send to Matomo? So we still only need 1 POST request but the time still correct. Also I would like to have a setting to define which event will not being put in bulk request (Example with |
There are cases where on the same page one user may call trackPageView() multiple times, or even trackPageView, trackEvent, trackEcommerceOrder, etc.
in these cases in the Piwik.js request handler queue, we should be a bit clever and detect there are several requests queued. Then we send these requests as bulk.
Advantages:
Follows up the bug in #4909
The text was updated successfully, but these errors were encountered: