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

Goals in bulk request only converted once #13719

Closed
michielvaneerd opened this issue Nov 15, 2018 · 1 comment
Closed

Goals in bulk request only converted once #13719

michielvaneerd opened this issue Nov 15, 2018 · 1 comment
Labels
duplicate For issues that already existed in our issue tracker and were reported previously.

Comments

@michielvaneerd
Copy link

When I send multiple requests at once with the bulk API, the goals are only converted once even though there are more goals in the requests. For example if I send the following POST body, then the goal with id 2 is only converted once:

requests = [
  "?idsite=1&rec=1&apiv=1&action_name=IndexWindow&url=URL&rand=1542290477741&_id=3cde905869be1df6&idgoal=2&uid=someuser",
  "?idsite=1&rec=1&apiv=1&action_name=IndexWindow&url=URL&rand=1542290480636&_id=3cde905869be1df6&idgoal=2&uid=someuser",
  "?idsite=1&rec=1&apiv=1&action_name=IndexWindow&url=URL&rand=1542290486896&_id=3cde905869be1df6&idgoal=2&uid=somesuser"
]

I have selected the "Allow goal to be converted more than once per visit" option.

If I send these requests separately, then every requests results in a goal conversion.

Matomo version: 3.6.1

@tsteur
Copy link
Member

tsteur commented Nov 15, 2018

This sounds like a bug. Quickly looked through the code in our goal manager to see if I find it. There is this code:

            // If multiple Goal conversions per visit, set a cache buster
            $conversion['buster'] = $convertedGoal['allow_multiple'] == 0
                ? '0'
                : $visitProperties->getProperty('visit_last_action_time');

And I reckon the problem is that all records have the same last_action_time as they are recorded within the same second. If you sent them each individually within the same second, I presume the same thing will happen.

I found #2508 and #9916

I'll mark this as a duplicate for now and propose an easy fix in the other issue.

@tsteur tsteur closed this as completed Nov 15, 2018
@tsteur tsteur added the duplicate For issues that already existed in our issue tracker and were reported previously. label Nov 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate For issues that already existed in our issue tracker and were reported previously.
Projects
None yet
Development

No branches or pull requests

2 participants