Skip to content
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

It is not possible to record more than one conversion per second for the same visit #9916

Closed
joneduca opened this issue Mar 11, 2016 · 5 comments · Fixed by #13727
Closed
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@joneduca
Copy link

This happens in v2.15.

If a page sends two conversion calls that are processed in the same second, only the first one is saved to the database. This prevents from recording several conversions that happen in the same page at the same time and you don't want to (or you can't) record those as several items for the same conversion.

Currently this is due to the primary key in the conversions table.

@sgiehl
Copy link
Member

sgiehl commented Mar 11, 2016

Is your problem to log more than one item conversion at a time? If so you only need to set a unique item sku for tracking?

Maybe post a small example code which fails for you.

@tsteur tsteur added the Bug For errors / faults / flaws / inconsistencies etc. label Mar 13, 2016
@tsteur
Copy link
Member

tsteur commented Mar 13, 2016

Yes, this is a limitation of the current implementation. There's probably already an issue for this but couldn't find it right now so will leave this issue open. Maybe @mattab has an idea re an existing issue

@tsteur
Copy link
Member

tsteur commented Nov 15, 2018

User reported it again in #13719

I'm not sure but it looks to me potentially like an easy fix in https://github.com/matomo-org/matomo/blob/3.7.0-rc2/core/Tracker/GoalManager.php#L674-L676 to not use the request timestamp but also some additional random numbers (eg 5 random numbers completed with the last bit of the timestamp or something)

@tsteur
Copy link
Member

tsteur commented Nov 15, 2018

@mattab @sgiehl @diosmosis any idea why we use the timestamp there?

@mattab
Copy link
Member

mattab commented Nov 19, 2018

The idea of using the timestamp I believe is to prevent 2 same requests sent at the same time to trigger 2 goals. So they have to be at least 1 second apart to trigger a new goal. But if it creates other bugs, we should rather remove this timestamp in the cache buster 👍 @tsteur

@tsteur tsteur modified the milestones: Backlog (Help wanted), 3.9.0 Nov 19, 2018
tsteur added a commit that referenced this issue Nov 19, 2018
…the same visit

fix #9916

we randomize the first 2 numbers increasing the chances to record multiple goal conversions per second per visit.
@tsteur tsteur self-assigned this Nov 19, 2018
diosmosis pushed a commit that referenced this issue Jan 22, 2019
…the same visit (#13727)

* It is not possible to record more than one conversion per second for the same visit

fix #9916

we randomize the first 2 numbers increasing the chances to record multiple goal conversions per second per visit.

* make sure to generate mysql safe int

* Update GoalManager.php
@mattab mattab modified the milestones: 3.9.0, 3.8.1 Jan 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
4 participants