With this request called multiple times, matomo thinks the items are added multiple times for multiple users. Let's say we call it twice, the 'revenue left in cart' becomes 15*2 = 30 which is incorrect as user2 may just clear the cart and add the same item again.
But if we give an
_id in the request like the following:
Matomo knows user2 is just updating its own cart,
revenue left in cart remains at 15 no matter how many times we call it, which is the expected behaviour.
If we MUST provide
_id to make it work, how can we get the correct
_id for any user? Another way of saying this is: what is the algorithm to generate
_id base on other information?
Why must we provide
_id here? Isn't
uid enough to uniquely identify the user?
Any chance you could apply these 2 changes files (or update to the latest beta):
We may have fixed this issue already.
Why must we provide _id here? Isn't uid enough to uniquely identify the user?
_id isn't needed to be provided but it is generally a good idea if possible. If the
_id is not given, we can try & find the matching user using things like resolution, IP, browser, ... This was not working properly when a userId was set in 3.13. and is now fixed.
Will try soon and update here
Updating the above two files fixed the issue, thanks! I'll leave the issue open in case you want to close it only when the new version is released.
Awesome, thanks for letting us know.