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

A first version of having the possibility to create mobile apps #8045

Merged
merged 4 commits into from Jun 17, 2015
Merged

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Jun 5, 2015

refs #7893
fixes #7803

New wording

  • Type: Can be a "Website", "Mobile App", later a car, a server, ...
  • Properties: So far we only had "Websites". We will use the term "Properties" as soon as multiple types are enabled and / or if multiple types are actually used. It depends where it is used. In the future we will no longer work based on Sites but on Properties. Not for now though...

This is only a first version since we will need this feature for a Piwik Pro plugin soon. To make it really nice we need to refactor the Settings API (which let's you currently create PluginSettings only, so everything is related to plugins, not properties). Also we need to change many other things and this is not doable in a short time frame. Therefore I made it more or less "work". It will be a bit nicer for Piwik 3.0.0 when we can also change APIs and spend more time on it. None of the new PropertySettings API etc will be actually public API as we will remove/change it very soon again.

There are new plugins WebsiteType and MobileAppType. Let me now re naming. I can name it only Website and MobileApp but we might want to use this for other things in the future. I do not really mind. MobileAppType is disabled by default so far most users nothing really changes. I do not think we will announce this MobileAppType thing big is it does not yet have a real value. This will be added over time.

Once multiple types are enabled we use "Add new property" (in Sites Management only so far) and we will let a user choose what type to create. The PropertySettings API let's you define custom settings for properties. Eg the type MobileAppType defines a custom setting "App ID". On top plugins can add custom settings for all properties or only settings for a certain type.

@mattab you might want to have a look re the descriptions in the Types. I will leave a note in the code.

create_property
edit_mobileapp

@tsteur tsteur added Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. labels Jun 5, 2015
@tsteur tsteur added this to the 2.14.0 milestone Jun 5, 2015
@@ -102,6 +102,14 @@ public function getTablesCreateSql()
) ENGINE=$engine DEFAULT CHARSET=utf8
",

'site_setting' => "CREATE TABLE {$prefixTables}site_setting (
Copy link
Member Author

Choose a reason for hiding this comment

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

We will store property settings in this table. The setting_value will be serialized as a Setting can define a type and we do not want to lose that type, eg an array.

Copy link
Contributor

Choose a reason for hiding this comment

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

Will it be serialized using serialize()? Unless it's really not practical it would be good to find alternatives instead of storing serialized strings: it is only readable by PHP, it forces us to keep the same class/property names for objects, the format could change (e.g. even today a Piwik install cannot be migrated from PHP to HHVM because of that: not same serialization format), etc.

Copy link
Member Author

Choose a reason for hiding this comment

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

It will be serialized for now yes. We might change it later but since it can store anything and we do need to keep the type of the setting_value for now. json etc would lose the type under circumstances eg Array vs Objects.

It doesn't store any instances there. Only array, stdClass, int, float, ...

@tsteur tsteur force-pushed the 7893 branch 2 times, most recently from 32cc6e2 to b5aec8c Compare June 5, 2015 05:45
@tsteur tsteur added Needs Review PRs that need a code review and removed Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. labels Jun 5, 2015
@mnapoli
Copy link
Contributor

mnapoli commented Jun 7, 2015

I haven't had a look in details yet:

  • I don't get the name "property", I don't see what it is a property of? Could we use something like "application"? (e.g. track a web application, mobile application, …) or even "project" even though it's generic. But I feel very lost by "property".

There are new plugins WebsiteType and MobileAppType. Let me now re naming. I can name it only Website and MobileApp but we might want to use this for other things in the future.

+1 for naming them with the Type suffix as that's what they are. A Website object should represent a website, not the "website type". I'd like Piwik to have objects instead of arrays for representing model "structures", so Website would be such a class.

@tsteur
Copy link
Member Author

tsteur commented Jun 7, 2015

We thought about many possible names for that and none of them was really good. Application is not really good as it could be anything, even a Retail Store. In the end we went with Properties so far as GA uses this naming as well so it will be at least familiar for many users and we reckon they had a lot of thoughts about the best naming for this.

Something generic is actually good since it is a name for something generic, although not sure if "Projects" is better. Maybe there are some other suggestions by anyone?

@@ -0,0 +1,4 @@
{
"name": "MobileAppType",
"description": "Allows you to create Mobile Apps"
Copy link
Member

Choose a reason for hiding this comment

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

suggested: Analytics for Mobile: lets you create 'Mobile App' properties. Measure user interactions on mobile with a SDK for iOS, Android or Titanium.

Copy link
Member Author

Choose a reason for hiding this comment

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

What about something like Analytics for Mobile: lets you manage 'Mobile App' properties and creates an optimized perspective of your mobile data.. The SDKs are rather irrelevant and what the type actually does is presenting the data in a different perspective by showing different reports, using different naming, etc.

@diosmosis
Copy link
Member

Haven't looked much, quick wording suggestions:

  • Instead of Type, how about Trackable?
  • Instead of Properties, how about TypeProperties (or TrackableProperties)? If Properties are meant to describe properties of Types, then adding that context to the word will make it clearer what it is.

Also, I cannot tell what the difference between Properties & Types are. Is one a word and the other a class name? Think I understand this, correct me if I'm wrong.

Can you provide in the ticket description an overview of the entire system?

@mnapoli
Copy link
Contributor

mnapoli commented Jun 8, 2015

@diosmosis If I understand correctly a Type is the same as a class, and a Property is the instance of the Type (i.e. same as object).

E.g. type could be "Mobile App", and property could be "Uber" (which is a mobile app).

The thing is I don't see what they are a property of? When I lookup the definition of the word, the closest thing is:

An attribute or abstract quality associated with an individual, object or concept

Or also:

An editable or read-only parameter associated with an application, component or class, or the value of such a parameter.

I find this word very confusing as it suggests there is a larger entity to which properties are attached (and properties "describe" this larger entity).

How about Resource? This is a term used in GA's documentation.

Google Analytics understands a property only as a resource associated with your tracking code. When you track a resource using Google Analytics, you include a property ID in the tracking code that you put on your web pages or in your app source code.

@mattab
Copy link
Member

mattab commented Jun 8, 2015

definitely it's good to discuss whether there is a better name

An attribute or abstract quality associated with an individual, object or concept

The thing is I don't see what they are a property of?

eg. a website property is an abstract quality of an individual (or organisation or business)

It is a bit far fetched but it works

How about Resource? This is a term used in GA's documentation.

Resource is not bad, we didn't consider this one before. is it used consistently across GA doc instead of Property, ie. do they use both terms for same meaning?

@tsteur
Copy link
Member Author

tsteur commented Jun 8, 2015

Instead of Type, how about Trackable?

Not really. In the future we will not only have Trackable things. We will also import data etc.

Can you provide in the ticket description an overview of the entire system?

What do you mean of the entire system? I haven't added "much" yet so not sure what do describe.

How about Resource?

That could work. I think they see "Property" rather as "Possessions/Goods/Wares/Things/Movables/..." it's also a synonym for Resource. As a developer we might see this rather from a technical view which makes it more confusing for us than for users. The closest definition that you mentioned are only the closest from a technical view, not from an everyday English equivalent.

When choosing a name please also keep in mind that we do not only want to have tracked "things" but also imported "things" etc.

@diosmosis If I understand correctly a Type is the same as a class, and a Property is the instance of the Type (i.e. same as object). E.g. type could be "Mobile App", and property could be "Uber" (which is a mobile app)

Yep that's pretty much it. A property can be associated with any type, eg "Mobile App".

@diosmosis
Copy link
Member

Measurable seems a little too forced but it's more of a feeling.

I think I understand what you're saying, measuring relates more to individual metrics (ie, measuring length or measuring time) rather than whole reports. Which isn't to say tracking relates to reporting in any way. It just doesn't make you think about measurements vs aggregated reports, so you don't notice it. I suppose this is a variation of the problem w/ Trackable, which makes you think of tracking, even though tracking may not be involved.

I think Measurable still works as viable wording though, and it's definitely better than Property/Resource, IMO ;)

@tsteur
Copy link
Member Author

tsteur commented Jun 11, 2015

So from my understanding we go with Measurable and MeasurableType for now?

I'd maybe also rename the plugins WebsiteType and MobileAppType to WebsiteMeasurable and MobileAppMeasurable? or WebsiteMeasurableType and MobileAppMeasurableType or keep the names?

@mnapoli
Copy link
Contributor

mnapoli commented Jun 11, 2015

So from my understanding we go with Measurable and MeasurableType for now?

+1

For the plugins we could name them on what they do (what they bring to Piwik): e.g. WebsiteTracking and MobileAppTracking? WebsiteMeasurable & others sound redundant, like ManHuman (i.e. a website is a measurable already).

/**
* Provides access to individual properties.
*/
class Property extends Site
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does property/measurable extends site (and not the other way around)? Is it only a shortcut for now (will be changed later)?

Copy link
Member Author

Choose a reason for hiding this comment

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

We will most likely change it later. For now not really important. I only want to add this feature on top of the current solution as simple as possible so we can later easily change it again

@tsteur
Copy link
Member Author

tsteur commented Jun 12, 2015

WebsiteTracking and MobileAppTracking sounds good

@tsteur
Copy link
Member Author

tsteur commented Jun 12, 2015

Actually, after starting to rename them I'm not sure about WebsiteTracking and MobileAppTracking anymore. Doesn't it kinda indicate one needs them to track websites or mobile apps? One can still track them without them. Only which reports are presented changes when they are used and some naming. It would be maybe still better than WebsiteType but think there would be a better solution.

@tsteur
Copy link
Member Author

tsteur commented Jun 12, 2015

The classes MeasurableSettings and MeasurableSetting etc. will sound a bit weird as well or not? It indicates we create a setting that is measurable. Was PropertySettings and PropertySetting before.
Same would be fore TrackableSettings etc.

@tsteur
Copy link
Member Author

tsteur commented Jun 15, 2015

Changed the naming to Measurables, added a few UI tests (not too many since we will change it soon again anyway) see https://github.com/piwik/piwik-ui-tests/commit/70c0d772fb74ff3c2c08d1ded9b155517e7b6a2a and applied some feedback from reviews.

Renamed the plugins to WebsiteMeasurable and MobileAppMeasurable see previous commit. WebsiteTracking would be kinda wrong and could lead to false expectations. We can still change it any time. Nothing of it will be public API.

use Piwik\Plugin\Manager as PluginManager;
use Piwik\Measurable\Type;

class Manager
Copy link
Contributor

Choose a reason for hiding this comment

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

If we could avoid another Manager class that would be great :)

use Piwik\Plugin\Manager as PluginManager are so boring to write (e.g. in this very file), and Manager type-hints are confusing. TypeManager or MeasurableTypeManager? (I have no preference between both)

Copy link
Member Author

Choose a reason for hiding this comment

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

I will rename it but we should discuss this in general at some point. I don't mind writing the as statements. MeasurableTypeManager then we can also just avoid namespaces and put everything in one folder :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Renamed it to TypeManager. Btw I often just write Type\Manager see eg 1e9e91b#diff-700dbb21e8c2b2cf9dc0a56a71eb86b4L49

Copy link
Member Author

Choose a reason for hiding this comment

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

Created follow up issue #8115

@mnapoli
Copy link
Contributor

mnapoli commented Jun 15, 2015

one last comment about a class name (above) and looks good to me

@mattab
Copy link
Member

mattab commented Jun 16, 2015

Hi @kaz231 - this is the Pull request that should help you with Mobile App Manager. feel free to ask thomas any question if you have!

tsteur added a commit that referenced this pull request Jun 17, 2015
A first version of having the possibility to create mobile apps
@tsteur tsteur merged commit 3708094 into master Jun 17, 2015
@tsteur tsteur deleted the 7893 branch June 17, 2015 05:10
@mattab mattab added the c: i18n For issues around internationalisation and localisation. label Oct 13, 2015
@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Oct 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it. c: i18n For issues around internationalisation and localisation. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants