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

Export from Visits Over Time widget return empty when using Action URL in Segment #14679

Closed
jordo1138 opened this issue Jul 20, 2019 · 14 comments
Labels
duplicate For issues that already existed in our issue tracker and were reported previously.

Comments

@jordo1138
Copy link

jordo1138 commented Jul 20, 2019

No data is returned, regardless of the format (tsv/csv/json etc) when the Segment is applied that contains Action URL is X
The Widget Visitors/Unique visitors does show the correct metrics when the Segment is selected but the export will be empty. The export data working properly for other conditions set in other segments based on other criteria , but not if it contains Action URL.
Screen Shot 2019-07-19 at 10 50 20 PM

Here is the TSV export
Screen Shot 2019-07-19 at 10 53 48 PM

and JSON export
Screen Shot 2019-07-19 at 10 54 31 PM

And Visits over time widget with segment applied and accurate metrics that I used the export function from
Screen Shot 2019-07-19 at 10 54 56 PM

Another user reported similar issue for segment, but not sure what conditions were applied in the segment. In my case and we are using Matomo 3.9.1, it occurs when using the Action URL in the segment
https://forum.matomo.org/t/excel-export-is-empty-when-using-filter-to-segment-visits/33109

@tsteur
Copy link
Member

tsteur commented Jul 21, 2019

Can you send us an example what the URL looks like? This it contain any special parameters? Or query parameters or so?

@jordo1138
Copy link
Author

jordo1138 commented Jul 22, 2019

So one example is this, redacted where needed
I can make it far more simple and just leave a single userId and actionUrl and still comes up empty in the report.
https://redacted-matomo.com/index.php?date=2019-07-13,2019-07-20&expanded=1&filter_limit=100&format=XML&format_metrics=1&idSite=3&method=API.get&module=API&period=day&segment=userId!%253Dredacted;userId!%253Dredacted;userId!%253Dredacted;userId!%253Drdas;userId!%253Dredacted;userId!%253Dredacted;userId!%253Dredacted;userId!%253Dredacted;userId!%253Dredacted;userId!%253Dredacted;userId!%253Dredacted;userId!%253Dredacted;userId!%253Dredacted;userId!%253Dredacted;userId!%253Dredacted;userId!%253Dredacted;userId!%253Dredacted;userId!%253Dredacted;userId!%253Dredacted;userId!%253Dunderfined;actionUrl%253D%255Ehttps%2525253A%2525252F%2525252Fredacted.url.com%2525252F&token_auth=redacted&translateColumnNames=1

@tsteur
Copy link
Member

tsteur commented Jul 22, 2019

Which Matomo version are you currently on @jordo1138 ? I think we made some fixes there recently and it might be related to #13481

@diosmosis does this sound like something that might be fixed in #13481 ?

@jordo1138
Copy link
Author

@tsteur I'm on 3.9.1 right now, I took a look at #13481 and I see the idea of the url encoding with segment filters could be related
looks like this particular issue is trending towards 3.12
Would be great to confirm if it would be covered by the issue mentioned

@diosmosis
Copy link
Member

From the URL the encoding looks ok. @jordo1138 One way to test if this is the issue would be to try the segment without actionUrl in the visits log to see if it matches anything, then again with only the actionUrl part of the segment. If there are visits for the first, then actionUrl is working ok, otherwise it's the other part of the segment.

@jordo1138
Copy link
Author

@diosmosis yes I had tried that already, whether it's mixed with other filter condtions or by itself, as long as action url is used, the export will be empty with only "date" in the column, as shown up above.
The Visits over Time graph do have the right metrics, but the export is failing.
My current work around is to take the exact same query filter and make it a custom report, re-process the data, and then export from the custom report, instead of the Visits over Time widget.

@diosmosis
Copy link
Member

@jordo1138 sorry, missed that part of the ticket description. Can you try with the value in the segment for action URL encoded one extra time, and try with the value encoded one less time? Ie, 'actionUrl=' . urlencode('https%2525253A%2525252F%2525252Fredacted.url.com%2525252F') & 'actionUrl=' . urldecode('https%2525253A%2525252F%2525252Fredacted.url.com%2525252F')`.

Something else to check is whether the segment works when matching a specific URL (in the example URL you give the actual segment is actionUrl=^.., which matches starts with) and check that the URL does exist in the log_action table in your DB (either unencoded or url encoded once).

If the first test returns no data in either case, and the second test returns no data but the action is in the DB, then it's probably not an encoding issue, and there's something else going on.

@jordo1138
Copy link
Author

so the url is in the database, it even auto-populates when making the segment filter from the site.
I tried with one extra and one less and the result is the same.

@diosmosis
Copy link
Member

@jordo1138 Ok, one more request, the visits over time widget works correct? Can you get the segment= parameter from that request from the chrome developer tools' network tab (it should be the request with module=VisitsSummary&action=getEvolutionGraph), and use that in the export URL? If it works can you post it?

@jordo1138
Copy link
Author

@diosmosis good call it works using the segment from the widget request that I grabbed from chrome dev tools request header, I had reduced/added the encoding/decoding like you mentioned in the previous comment but not exactly the same way as the differences seen here, especially the beginning part, %3D%3D vs %253D%253D, I"m pretty sure I missed taking out the 25/25 when testing earlier.
So looks like just unifying the formatting would fix the issue for exporting segments that have actionURL, I'm unaware at the moment of other segment filters affected. Is this in scope then for your 3.12 fix coming?

By default the segment=action from the export button on the Visits Over Time widget is like this
segment=actionUrl%253D%253Dhttps%2525253A%2525252F%2525252Fredacted%2525252Fredacted%2525252Fredacted%2525252Fredacted%2525252Fredacted%2525252Fredacted

When I replaced it using the segment=action as you requested from the widget request header, the CSV contains the right data, segmented properly based on the semgent with the ActionURL

Working for TSV export by replacing the default segment=action above
segment=actionUrl%3D%3Dhttps%25253A%25252F%25252Fredacted%25252Fredacted%25252Fredacted%25252Fredacted%25252Fredacted%25252Fredacted

@diosmosis
Copy link
Member

@jordo1138 Ok, I remember this issue. I believe it was actually fixed in 3.10: #14338. Can you see if that change fixes the issue for you?

@mattab
Copy link
Member

mattab commented Aug 1, 2019

Hi @jordo1138 were you able to upgrade to 3.10 or 3.11 and confirm the issue is now fixed for you?

@jordo1138
Copy link
Author

@mattab thanks for checking in, I should know the answer to this soon, planning the upgrade with clients right now

@jordo1138
Copy link
Author

@mattab @diosmosis confirmed after upgrading to 3.11 the issue is resolved, thanks!

@mattab mattab added the duplicate For issues that already existed in our issue tracker and were reported previously. label Aug 15, 2019
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

4 participants