-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
This would be the first step to get #4734 done. The idea is to add only one new type "App" (or "Mobile App") for now (it might be useful to directly add another one such as "API"). It is more like an experiment to make some first experiences with this topic.
Features:
- We will modify the SitesManager so that users can select what type they want to create (Website, App or API)
- Keep in mind an App does not have a URL, maybe optional an App ID eg
org.piwik.mobile
(probably not needed). An API would maybe rather have an "Endpoint" instead of a URL. - Note: As this here is pretty straight forward and most likely won't be a possible showstopper we could just add a column (eg "type") in the site table instead and set the type manually as a first step
- Keep in mind an App does not have a URL, maybe optional an App ID eg
- Provide a different default Dashboard for Apps as other things are important there, eg Devices
- TBD: What if someone has already configured a dashboard, a Website related dashboard won't be so much useful for an App dashboard. We could ignore this problem in the beginning
- If possible we would use the term "Screens" instead of "Pageviews", "Users" instead of "Visitors" and "Sessions" instead of "Visits". Meaning we want to be able to rename metrics and metrics documentation. FYI: We had this topic in the past to rename it in general but we don't have to do this for now. In other "types" one has maybe "Workouts" instead of "Screens" etc. So we probably need a possibility to rename this anyway.
- Note: In the first step we do maybe not care if Segments still says "Visits" etc
- Use the term "App" instead of "Website" everywhere eg in Email reports (from Email Reports #5333), etc
- OPTIONAL: Would we have to rename "Websites" as in "All Websites", "Website chooser" and "Sites Manager"? There is not really a good name for this I reckon? :( I think other name it like "Accounts", "Entities" or "Properties" but do not really like any of those
Some tasks to solve those tasks:
- Report classes should not be instantiated directly Report classes should not be instantiated directly #7821
- Provide an API for plugins to display (multiple) reports in a page Provide an API for plugins to display (multiple) reports in a page #7822
- Change Widgets API for plugins Change Widgets API for plugins #7861
- Work always on one idSite in API methods Work always on one idSite in API.getReportMetadata #7834
- Not sure re order here
- Let a type rename words "Website", "Site", "Websites" and "Sites" Let a type rename words "Website", "Site", "Websites" and "Sites" #7833 &
- Provide a way for a type to rename any report and to disable/enable reports Provide a way for a type to rename any report and to disable/enable reports #7823
- Add possibility to rename metrics based on the type of the site Add possibility to rename metrics based on the type of the site #7824
- Use generic wording whenever possible Use generic wording whenever possible #7826
I think this would be enough for a first step and will already provide a value for our users. We will already face enough challenges during this and learn a lot about possible problems. In the following step we could maybe disable / enable some reports depending on the type. We should create a follow up issue for Piwik 2.13.0 after this issue is resolved. The follow up issue will depend on how much of this issue we will get done in 2.12.0 etc
We will develop this in a way that plugins will be directly able to define their own "Types" even though this won't be a public API or whatever for a long time. New types should be already developed in a plugin. The types "App" and "API" would be most likely removed in the releases as it will be experimental and probably not yet ready for end-users. I think it won't even make sense to put them on the Marketplace unless we think the API is already stable enough.
Maybe it could be by default as easy (from a plugin developer perspective) as something like this:
{
type: "app",
name: "App", // or "PluginName_App" for translations
namePlural:"Apps" // or name: {singular: "App", plural: "Apps"}
manageFields: [{name: "AppId"...} ...],
dashboards: [{...}],
metrics: {"nb_visitors": "Users"...},
// menu: []
// reports: []
}