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

New report 'Personal settings > Custom Variables' displays custom variable usage #9143

Merged
merged 4 commits into from Nov 4, 2015

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Nov 1, 2015

Shows which custom variable slots are used and which ones aren't. This is useful if you want to get an overview of all used custom variable names and slots and to see which slots are unused. It currently shows all usages, even the one that were used only once or fake once. We could maybe add a parameter later to filter these usages.

There are 2 failing system tests where idsubdatatable is increased now: https://travis-ci.org/piwik/piwik/jobs/88684701#L613 Not sure why this is the case and how this is related. I did not just want to update the expected xml. Maybe someone has an idea?

Another system test is failing re Anonymous tracking plugin. We should fix this test once we merge or once it is good to merge. I did not want to add a new expected file to the plugin in case we rename the API method.

Needed Access
Currently, Admin access is required to request API to get usages of slots and to see the "Custom Variables" page but we could maybe as well allow it for View access? The Add new custom variable button would need to be made only visible for super users then.

Known issue:
The API output is incomplete for any aggregated reports (range, year, ...) since aggregating metadata is not supported yet. It only uses the metadata of the row having the most actions/visits: https://github.com/piwik/piwik/blob/2.15.0/core/DataTable/Row.php#L520

Example: One day you use a certain custom variable in slot 1, the next day in slot 2. It would only show the usage of the slot having more actions or visits. Not both slot 1 and 2.

Ideally it would combine all scopes (unique). Should I work on that or is it alright?

@tsteur tsteur added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review and removed not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. labels Nov 1, 2015
@tsteur tsteur changed the title Added screen to see custom variable usages Added screen and API to see custom variable usages Nov 1, 2015
@@ -6,6 +6,16 @@
"CustomVariablesReportDocumentation": "This report contains information about your Custom Variables. Click on a variable name to see the distribution of the values. %s For more information about Custom Variables in general, read the %sCustom Variables documentation on piwik.org%s",
"PluginDescription": "Custom Variables are (name, value) pairs that you can assign using the Javascript API to visitors or any of their action. Piwik will then report how many visits, pages, conversions for each of these custom names and values. View the detailed Custom Variables for each user and action in the Visitor Log.<br />Required to use <a href=\"http://piwik.org/docs/ecommerce-analytics/\">Ecommerce Analytics</a> feature!",
"ScopePage": "scope page",
"ScopeVisit": "scope visit"
"ScopeVisit": "scope visit",
"ManageDescription": "This overview shows all custom variable slots and their usages. The names within each slot are ordered by how often they were used in total.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add the name of the website so it is clear that this report depends on website selected eg. This overview shows all custom variable slots and their usages for %s.

@mattab
Copy link
Member

mattab commented Nov 2, 2015

Ideally it would combine all scopes (unique).

👍 when showing the values in our public API we should aim to make them correct so users don't get disappointed

Feedback:

  • simple & useful!
  • Add help icon to link to: http://piwik.org/docs/custom-variables/
  • Move the menu entry below "Goals" and above "Tracking code"
  • Could we add a sentence to explain that this report's data will be populated over time after the upgrade to Piwik 2.15.0?

@mattab mattab added this to the 2.15.1 milestone Nov 2, 2015
@tsteur
Copy link
Member Author

tsteur commented Nov 2, 2015

Done apart from "Could we add a sentence to explain that this report's data will be populated over time after the upgrade to Piwik 2.15.0?"

Not sure about this one as it would be there kinda forever even though data might be populated. We could maybe show it in the help text but there not many people would see it.

@mattab
Copy link
Member

mattab commented Nov 2, 2015

Not sure about this one as it would be there kinda forever even though data might be populated. We could maybe show it in the help text but there not many people would see it.

Could we maybe display the notification when:

  • there is some custom data report (not empty report)
  • and there is no slot information yet

This way, users will know that UI is not broken but that it will take a day or two to fill in (and a few weeks to be fully accurate)

@tsteur
Copy link
Member Author

tsteur commented Nov 3, 2015

Done. I would have added a test for it but it's not trivial and not really worth it

@mattab
Copy link
Member

mattab commented Nov 3, 2015

Looks great! 👍 to merge (couldn't directly merge as there are conflicts)

tsteur added a commit that referenced this pull request Nov 4, 2015
Added screen and API to see custom variable usages
@tsteur tsteur merged commit 1bc6702 into master Nov 4, 2015
@tsteur tsteur deleted the customvar_manage branch November 4, 2015 20:02
mattab added a commit that referenced this pull request Nov 10, 2015
@mattab mattab changed the title Added screen and API to see custom variable usages New report 'Personal settings > Custom Variables' displays custom variable usages Jan 29, 2016
@mattab mattab changed the title New report 'Personal settings > Custom Variables' displays custom variable usages New report 'Personal settings > Custom Variables' displays custom variable usage Jan 29, 2016
@mattab mattab added the Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical. label Jan 29, 2016
@mattab
Copy link
Member

mattab commented Feb 1, 2016

Documented this nice feature in a small section in the Custom Variables user guide

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical. Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants