{"action":"created","issue":{"url":"https://api.github.com/repos/piwik/piwik/issues/4910","labels_url":"https://api.github.com/repos/piwik/piwik/issues/4910/labels{/name}","comments_url":"https://api.github.com/repos/piwik/piwik/issues/4910/comments","events_url":"https://api.github.com/repos/piwik/piwik/issues/4910/events","html_url":"https://github.com/piwik/piwik/issues/4910","id":37355575,"number":4910,"title":"Javascript tracker can send tracking API  requests as bulk for better performance","user":{"login":"mattab","id":466765,"avatar_url":"https://avatars.githubusercontent.com/u/466765?v=3","gravatar_id":"","url":"https://api.github.com/users/mattab","html_url":"https://github.com/mattab","followers_url":"https://api.github.com/users/mattab/followers","following_url":"https://api.github.com/users/mattab/following{/other_user}","gists_url":"https://api.github.com/users/mattab/gists{/gist_id}","starred_url":"https://api.github.com/users/mattab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattab/subscriptions","organizations_url":"https://api.github.com/users/mattab/orgs","repos_url":"https://api.github.com/users/mattab/repos","events_url":"https://api.github.com/users/mattab/events{/privacy}","received_events_url":"https://api.github.com/users/mattab/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/piwik/piwik/labels/c:%20Performance","name":"c: Performance","color":"ededed"},{"url":"https://api.github.com/repos/piwik/piwik/labels/Enhancement","name":"Enhancement","color":"bfd4f2"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/piwik/piwik/milestones/3","html_url":"https://github.com/piwik/piwik/milestones/Long%20term","labels_url":"https://api.github.com/repos/piwik/piwik/milestones/3/labels","id":713681,"number":3,"title":"Long term","description":"Issues in this milestone have not been yet scheduled for development. \r\n\r\nLearn [how Piwik software is developed and released.](http://developer.piwik.org/guides/core-team-workflow)","creator":{"login":"mattab","id":466765,"avatar_url":"https://avatars.githubusercontent.com/u/466765?v=3","gravatar_id":"","url":"https://api.github.com/users/mattab","html_url":"https://github.com/mattab","followers_url":"https://api.github.com/users/mattab/followers","following_url":"https://api.github.com/users/mattab/following{/other_user}","gists_url":"https://api.github.com/users/mattab/gists{/gist_id}","starred_url":"https://api.github.com/users/mattab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattab/subscriptions","organizations_url":"https://api.github.com/users/mattab/orgs","repos_url":"https://api.github.com/users/mattab/repos","events_url":"https://api.github.com/users/mattab/events{/privacy}","received_events_url":"https://api.github.com/users/mattab/received_events","type":"User","site_admin":false},"open_issues":212,"closed_issues":334,"state":"open","created_at":"2014-06-01T00:00:00Z","updated_at":"2015-10-07T01:41:25Z","due_on":"2020-12-20T11:00:00Z","closed_at":null},"comments":4,"created_at":"2014-03-26T10:03:20Z","updated_at":"2015-10-28T22:00:30Z","closed_at":null,"body":"There are cases where on the same page one user may call trackPageView() multiple times, or even trackPageView, trackEvent, trackEcommerceOrder, etc.\n\nin 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. \n\nAdvantages:\n* Resolves edge cases such as #4909. Indeed if we are able to track all requests from the same user as bulk we will avoid several race conditions (including those we have not discovered yet).\n* Faster, less HTTP requests in case users track several requests per page.\n\nFollows up the bug in #4909\n\n"},"comment":{"url":"https://api.github.com/repos/piwik/piwik/issues/comments/152009667","html_url":"https://github.com/piwik/piwik/issues/4910#issuecomment-152009667","issue_url":"https://api.github.com/repos/piwik/piwik/issues/4910","id":152009667,"user":{"login":"kachkaev","id":608862,"avatar_url":"https://avatars.githubusercontent.com/u/608862?v=3","gravatar_id":"","url":"https://api.github.com/users/kachkaev","html_url":"https://github.com/kachkaev","followers_url":"https://api.github.com/users/kachkaev/followers","following_url":"https://api.github.com/users/kachkaev/following{/other_user}","gists_url":"https://api.github.com/users/kachkaev/gists{/gist_id}","starred_url":"https://api.github.com/users/kachkaev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kachkaev/subscriptions","organizations_url":"https://api.github.com/users/kachkaev/orgs","repos_url":"https://api.github.com/users/kachkaev/repos","events_url":"https://api.github.com/users/kachkaev/events{/privacy}","received_events_url":"https://api.github.com/users/kachkaev/received_events","type":"User","site_admin":false},"created_at":"2015-10-28T22:00:30Z","updated_at":"2015-10-28T22:00:30Z","body":"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 recorded in the wrong order in the database. The issues seems to be simply caused by different speeds of HTTP requests. Having that ```sendBulkRequest``` already exists in ``piwik.js```, how difficult would it be to fix the processing of a set of ```_paq.push()``` calls?"}}