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
Metadata API: Support sub tables calls #2742
Comments
At the same time, we could add support needed for #2137 This is a slightly different "subtable" requirement: we need the full table expanded and truncated.
Then it will be possible to get eg. expanded Page URLs report in Scheduled reports (where clicking to expand is not possible) |
As discussed during the meetup, you could call the raw API to fetch subtables. However, maybe this is not enough: eg. Campaign name click to "Campaign keyword". Without metadata, you wouldn't know the column name. This would be a non optimal experience for mobile app users and would be confusing. Therefore we need to add the support to metadata :-) |
You're right. We need to add the support to metadata cause of the data structure and so on. |
Attachment: Initial patch for this issue. |
I put up a patch that solves this for the CustomVariables report. Let me know what you think of the approach I took. (Not sure if the subtable metadata is correct.) |
Nice one.... Review:
|
Attachment: New patch for this issue. |
I uploaded a new patch. Replying to matt:
I moved the parameter to the end of the function call. This might be annoying for future uses of it, but I think this is better.
It's hidden, which is proved by the fact that the output for the getReportMetadata/getMetadata tests does not have to change.
No... but I'm not aware of every use case of API.getProcessedReport. W/ my changes, you can call reports that return subtable reports, and if desired, get metadata for those reports by supplying an extra parameter (showSubtableReports=1) to getReportMetadata/getMetadata. I think it's ok to commit? |
Looks good!
In general it's bad practise to reference test names in the test, if the class changes the test won't run without us noticing. So it's better to redefine the function to do nothing in children tests, and remove the if()
|
(In [6800]) Fixes #2742, added support for getting subtable reports through metadata API and added necessary metadata so existing subtable reports can be obtained. Notes:
|
Nothing to add except, very nice commit & new tests! |
I have implemented a first working version in Piwik Mobile and I have two questions.
When displaying this graph it always displays the following error message: "Invalid API Module and/or API Action" I'm not sure how much work it is to add graph support for more Modules/Actions. Is it possible to disable the graphs in Piwik if it is a subtable report? Once graphs for more Modules/Actions are working we can simply enable them step by step without having to change Piwik Mobile. |
Replying to tsteur:
I added subtable metadata for the following reports in my last commit:
Metadata calls w/ subtables should work w/ these reports.
This specific error is because the URL is using 'getCustomVariablesValuesFromNameI' instead of 'getCustomVariablesValuesFromNameId'. I don't think this is an issue w/ Piwik, though. If I get the processed report for the subtable report, the imageGraphUrl uses the correct method. And the URL works. At least, it doesn't throw. I did notice another bug though. The idSubtable parameter isn't set in the imageGraphUrl. I should have a fix committed soon.
|
(In [6872]) Refs #2742, add idSubtable parameter to imageGraphUrl if it is present in the url. |
Oh, the missing "d" was my copy/paste fail. I removed the "token_auth" url parameter before copying the link into this command and accidentally also removed the trailing "d". It's correct in MetaData API but still getting the error when trying to display the graph. I'll try it later again with your latest patch. |
Still getting the graph error even with idSubtable parameter. The url in metadata looks like the following:
Piwik Mobile adds a few parameters and it'll look like the following:
The generated graph still displays the message "Invalid API Module and/or API Action". I'm not getting any error in the log. Maybe one of the additional url parameter causes the "error"? All other graphs are displayed without any issues, except graphs from subtable reports. |
Ok, I'm seeing the error now, and I think I know what the cause is. Hopefully I'll have a commit in soon. |
(In [6874]) Refs #2742, add subtable support to ImageGraph plugin. |
@tsteur should be working now. |
Works! Thanks |
(In [6886]) Refs #2742, fix test issue. |
Metadata API should have full coverage of Piwik reports. In particular, one should be able to fetch subtables for Page URLs, Page Titles, Custom Variables, Campaign Names, etc.
The text was updated successfully, but these errors were encountered: