@michielvaneerd opened this Issue on November 15th 2018

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 commented on November 15th 2018 Member

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 https://github.com/matomo-org/matomo/issues/2508 and https://github.com/matomo-org/matomo/issues/9916

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

This Issue was closed on November 15th 2018
Powered by GitHub Issue Mirror