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

visitIp not included in Live.getLastVisitsDetails since 1.13.1 #15421

Closed
Romain opened this issue Jan 20, 2020 · 10 comments
Closed

visitIp not included in Live.getLastVisitsDetails since 1.13.1 #15421

Romain opened this issue Jan 20, 2020 · 10 comments
Labels
worksforme The issue cannot be reproduced and things work as intended.

Comments

@Romain
Copy link

Romain commented Jan 20, 2020

I updated Matomo from 1.13.0 to 1.13.1 last week.
Since then, my plugin displays incoherent data.

Digging into this problem, I realized that this new version of Matomo introduced a change in the content returned by the API endpoint Live.getLastVisitsDetails. The visitIp key is not included in the JSON response anymore.

Could you include this value again in the response?
Thanks!


How to reproduce

@Romain Romain changed the title visitIp not included in Live.getLastVisitsDetails since 1.13.1 visitIp not included in Live.getLastVisitsDetails since 1.13.1 Jan 20, 2020
@sgiehl
Copy link
Member

sgiehl commented Jan 20, 2020

That hasn't been changed. The visitIp should still be included.

@tsteur
Copy link
Member

tsteur commented Jan 20, 2020

@Romain are you using a valid token_auth of a user with at least view access when fetching the list of segments? There was some refactoring which was needed for some issue but it should still behave the same. I was going to say you could workaround by adding a _showAllSegments=1 to the request but I think underscore parameters can maybe not be used. So this might not work.

cc @diosmosis

@tsteur tsteur added the Regression Indicates a feature used to work in a certain way but it no longer does even though it should. label Jan 20, 2020
@tsteur tsteur added this to the 3.13.1 milestone Jan 20, 2020
@tsteur
Copy link
Member

tsteur commented Jan 20, 2020

Actually, I was reading this wrong. This is not about segments.

@tsteur tsteur removed this from the 3.13.1 milestone Jan 20, 2020
@tsteur tsteur removed the Regression Indicates a feature used to work in a certain way but it no longer does even though it should. label Jan 20, 2020
@tsteur
Copy link
Member

tsteur commented Jan 20, 2020

This works for me. It looks like the token_auth is not valid very likely. Maybe the token was regenerated?

@mattab mattab added the worksforme The issue cannot be reproduced and things work as intended. label Jan 21, 2020
@Romain
Copy link
Author

Romain commented Jan 21, 2020

Hi @tsteur ,

Thanks for having a look a this.
Actually, the token_auth shouldn't be a problem. Since I'm using the Request class, I think that this parameter is not required.

Here is what I'm doing:

$response = Request::processRequest('Live.getLastVisitsDetails', [
            'idSite'        => $idSite,
            'period'        => $period,
            'date'          => $date,
            // 'token_auth'    => $_ENV['AUTH_TOKEN']
]);

I tried to pass the token_auth there, but it doesn't change anything.
Everything was working smoothly up to the moment where I updated to 1.13.1.
If I dump the response, there's no visitIp key in the visits listed.

@Romain
Copy link
Author

Romain commented Jan 21, 2020

I also tried _showAllSegments but the result was the same.

@tsteur
Copy link
Member

tsteur commented Jan 22, 2020

@Romain I see. Thought you do this through the HTTP API. I just tried to reproduce this and it seems to work for me. Maybe you have some other plugins active that maybe change this behaviour?

@Romain
Copy link
Author

Romain commented Jan 22, 2020

@tsteur Unfortunately I don't. On my dev setup, I just have Matomo, my plugin, the LogViewer and the VisitorGenerator. On my prod setup, I just have Matomo and my plugin. Here are the plugins that are installed on my dev setup:

Capture d’écran 2020-01-22 à 08 32 47-fullpage

@Romain
Copy link
Author

Romain commented Jan 22, 2020

Just to give you more information on the data I get.

Here is a sample of code more detailed:

$response = Request::processRequest('Live.getLastVisitsDetails', [
            'idSite'        => $idSite,
            'period'        => $period,
            'date'          => $date
]);

foreach ($response->getRows() as $visitRow) {
            $logger->error($visitRow);
}

This logs what follows:

# ['idvisit' => '1337', 'idsite' => '1', 'idvisitor' => '?d???L?�', 'visit_last_action_time' => '2019-12-19 13:08:59', 'config_id' => '?O???�R�', 'location_ip' => 'd.

@Romain
Copy link
Author

Romain commented Jan 22, 2020

Ok, I solved it by changing my request this way:

$response = Request::processRequest('Live.getLastVisitsDetails', [
            'idSite'            => $idSite,
            'period'            => $period,
            'date'              => $date,
            'segment'           => $segment,
            'flat'              => FALSE,
            'doNotFetchActions' => FALSE
]);
$response->applyQueuedFilters();

Thank for your help.

@Romain Romain closed this as completed Jan 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
worksforme The issue cannot be reproduced and things work as intended.
Projects
None yet
Development

No branches or pull requests

4 participants