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

Deprecate UserSettings plugin -> use DeviceDetection instead! #3962

Closed
mattab opened this issue May 30, 2013 · 37 comments
Closed

Deprecate UserSettings plugin -> use DeviceDetection instead! #3962

mattab opened this issue May 30, 2013 · 37 comments
Assignees
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Milestone

Comments

@mattab
Copy link
Member

mattab commented May 30, 2013

In Piwik 1.12 we added the DevicesDetection plugin to provide advanced user detection of mobile devices, tvs, consoles, brands, models, Operating systems versions, etc. The code is still beta and we know covers only 50-80% of all devices.

Now that this plugin works well, we note redundancy between DevicesDetection algorithm and UserSettings.

eg the Following reports are processed and displayed in both plugins:

  • Browsers report (and browser versions)
  • Operating System report (and OS versions)

Tasks
Here is how to solve the redundancy and make code unified.

general

API:

  • the Following UserSettings.* API will be redirected from UserSettings to their equivalent in DevicesDetection (to keep backward compatibility)
    • getOS
    • getOSFamily
    • getMobileVsDesktop (now loads DevicesDetection.getType )
    • getBrowserVersion
    • getBrowserType
    • getBrowser
  • Remove code processing of these reports from UserSettings/Archiver

Core:

  • Enable DevicesDetection by default (add new Update file to enable plugin).
    • Officially out of beta!

Tests & Backward compatibility

  • If users re-process reports from the "old logs" (when UserSettings alone was doing detection), do the reports processed by DevicesDetection using old data display OK ?
  • If users migrate to Piwik 2.0 and use DevicesDetection for the first time
    • We must ensure that old UserSettings blobs are renamed to DevicesDetection names (example). So that the UserSettings blobs are read and used by DevicesDetection API.

Tracker:

  • remove the current UserAgentParser code to simplify Tracker (in getUserSettingsInformation())
    • If DevicesDetection plugin is disabled, there will not be any browsers or OS detected

At the end of this ticket we will see:

  • UserSettings plugin will be simpler
  • DevicesDetection plugin becomes critical part of Piwik architecture (by providing browsers/os parsing exclusively)
  • Simplification of Tracker in core
  • Consistent reports (browsers/OS only displayed once as expected)
  • Keep backward compatibility in terms of API and also DevicesDection can read old UserSettings blob data.
    • Better detection accuracy for most users (since they will now use DevicesDetection)

See also: Help improve DevicesDetection plugin: see matomo-org/device-detector#4215

@mattab
Copy link
Member Author

mattab commented Jul 31, 2013

A bug was reported here: http://forum.piwik.org/read.php?2,105199,page=1#msg-105459

four new fields for the table log_visit have been introduced, one is called "config_os_version". In our intranet many user sessions are running under Citrix. The corresponding calculated value for this field is "Server 2003". With this value, the write operation goes wrong. The complete record is not written.
The call Piwik_Tracker getDatabase :: () -> query ($ sql, $ bind) in Visit.php is not coming back, the action is not counted!.
So 3,500 visitors per day with all actions are lost in our statistics. 

@peterbo
Copy link
Contributor

peterbo commented Jul 31, 2013

The root cause of this bug is the VARCHAR(10) config_* fields and the reporter's MySQL-Server running in "strict mode".

Since the config_os_version string "Server 2003" is 11 chars in length, MySQL in standard config would just cut the string to "Server 200"; MySQL running in strict mode throws an error and stops script execution.

I reported the issue back to Clearcode and Pjotr is working on a fix; Which could just be raise the width of the config_* fields.

@sgiehl
Copy link
Member

sgiehl commented Sep 6, 2013

small note: As soon as that plugin is finished, we should also move the translations to the core file (to be consitent with all other plugins included in core)

@mattab
Copy link
Member Author

mattab commented Oct 8, 2013

The bug fields config_os_version and config_device_type are not large enough was fixed in #4203

@mattab
Copy link
Member Author

mattab commented Oct 8, 2013

Unit tests for the UserAgentEnhanced were added in: #115

@mattab
Copy link
Member Author

mattab commented Oct 14, 2013

Changing scope to: Move DevicesDetection out of beta and enabled by default.

@sgiehl
Copy link
Member

sgiehl commented Jan 30, 2014

In 3149eb8: refs #3962 use UserAgentParserEnhanced instead of UserAgentParser to detect android & ios devices

@mattab
Copy link
Member Author

mattab commented Feb 1, 2014

Increasing priority as more people report issues in UserAgentParser. We need to clarify our vision to the community.

Btw random idea; Maybe it would be a good idea to make UserAgentParserEnhanced a separate open source project, hosted in the piwik family at github?

For this ticket though, the concept is to reomve completely UserAgentParser from codebase and remove completely the previous User Settings reports. This will be awesome and has been long overdue :)

If anyone wants to own this ticket, please go ahead, this would make a great different to cleaning up the last "pending migration" to our superb new & organised Piwik platform.

@sgiehl
Copy link
Member

sgiehl commented Feb 1, 2014

I'm currently writing a plugin, but when I'm done I could have a look at that task.

Moving the Useragentparser to a seperate repo sounds good. Would you create a repository and give me access. So we can move the required files there.

Btw. We need to merge my pull request regarding the devicedetection first! Do you have some time to have a look at it?

@mattab
Copy link
Member Author

mattab commented Feb 4, 2014

Great to hear you'd be interested to work on this! :) it will be such a good feeling to deprecate the old UserSettings code and keep things tidy. I'll update the ticket description later with some clarifications in the spec.

Re: repo
Maybe we should pick a good name for this library... maybe UserAgent-ParserAwesome ? not sure... I have done a quick search around, and as far as I can see, we will be the best User Agent parser library around... this is cool!

we will directly compete with other libs such as https://github.com/tobie/ua-parser or many others...

@mattab
Copy link
Member Author

mattab commented Feb 7, 2014

In d3a423d: Refs #3962 Removes undocumented feature of adding user agent column.

@mattab
Copy link
Member Author

mattab commented Apr 8, 2014

See #4965: Use new device-detector library in Piwik to detect browsers, systems,
devices, brands and model

@mattab
Copy link
Member Author

mattab commented Jun 8, 2014

In 6b28d41: Tweaking the Device detection titles. refs #3962
A nice creation by @sgiehl

@mattab
Copy link
Member Author

mattab commented Jun 8, 2014

The universal Device Detector library is now available as Free software and hosted on github here: https://github.com/piwik/device-detector

We will now work on closing this ticket and finishing the loop nicely!

@mattab
Copy link
Member Author

mattab commented Jun 10, 2014

see #5329 Enable DevicesDetection plugin by default

@mattab
Copy link
Member Author

mattab commented Jun 17, 2014

We migrated to Device detector V2 in this pull request: #305 (comment)

Nice progress :)

@mattab mattab added this to the 2.5.0 - Piwik 2.5.0 milestone Jul 8, 2014
@mattab mattab modified the milestones: Piwik 2.5.0, Piwik 2.6.0 Aug 4, 2014
@mattab mattab modified the milestones: Piwik 2.6.0, Piwik 2.7.0 Aug 25, 2014
@mattab mattab removed the Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical. label Sep 15, 2014
@mattab mattab added this to the Piwik 2.9.0 milestone Sep 22, 2014
@sgiehl
Copy link
Member

sgiehl commented Dec 4, 2014

@mattab Besides fixing the update script, is there anything still open to solve this issue?
I remember we discussed to remove UserSettings plugin completely. Should the remaining reports be simply moved to DevicesDetection plugin? Otherwise I guess we are done here.

@mattab
Copy link
Member Author

mattab commented Dec 5, 2014

Hi @sgiehl,

Regarding this issue, I think it is mostly done!

  • should we move UserSettings/images/browsers|os/* into DeviceDetection plugin?
  • make update script faster/ failsafe

Regarding next step: we can leave the UserSettings for now but maybe we can create an issue for the follow up task. Do you think it would make sense to:

  • move "Resolution" report to own plugin,
  • move "plugins tracking" to own plugin as well (maybe DevicePlugins?)
  • and move "Language report" to own plugin too.

(Kinda related to #6782)

@sgiehl
Copy link
Member

sgiehl commented Dec 7, 2014

I have thought about moving the images to DevicesDetection plugin. The reason why I haven't done it yet is that I wasn't sure if it might break any older reports containing those as external images or something like that. Do you think it should be save moving them?

Moving those stuff to own/other plugins sounds good. So creating new tickets should be fine.

@mattab
Copy link
Member Author

mattab commented Dec 8, 2014

+1 for moving images to proper plugin. Ideally all clients will use our
Reporting API or the Metadata API which includes the link to images /
logos.

@mattab
Copy link
Member Author

mattab commented Dec 8, 2014

Maybe could be worth mentioning in Developer changelog as "information"
in case it could help some users

@sgiehl
Copy link
Member

sgiehl commented Feb 8, 2015

All reports and API methods are moved now. Last remaining part is the page template showing the reports

@mattab
Copy link
Member Author

mattab commented Feb 9, 2015

Nice work @sgiehl - it would be nice to get it done in 2.11.0 and this would successfully conclude this project! :)

@sgiehl
Copy link
Member

sgiehl commented Feb 9, 2015

Hm. I'm not sure where to move the template displaying the various reports.
Should I move it to CoreHome and dynamically add the reports using an event or something like that?

@mattab
Copy link
Member Author

mattab commented Feb 10, 2015

Not sure how this should be solved but it seems good use case for the platform, to let plugins enrich existing reports with their data. ideally we would provide a nice API for plugins to compose report pages.

  • Maybe we could add events similar to http://developer.piwik.org/api-reference/events#controllermoduleaction but that would be for Twig templates, where other plugins could "append" string content to it?
  • maybe better idea could be to replace the current way of creating reports eg. in Usersettings $view->dataTableResolution = $this->renderReport(new GetResolution());. Maybe we could introduce a new object for "Composite reports" (eg. a page in Piwik made of several reports). This object would let plugins add or modify reports to it, setting order, maybe right/left column, etc.?

Thoughts?

@sgiehl
Copy link
Member

sgiehl commented Feb 11, 2015

I'm not sure how to solve that best. Maybe we should reorganize the technical reports.

We currently have:

  • Devices
    • Device type
    • Device brand
    • Device model
    • Browser (Versions)
    • OS (Versions)
    • Browser engine
  • Visitor settings
    • Resolution
    • Configurations (OS / Browser / Resolution)
    • Browser plugins
    • Browser language

I don't think that this splitting makes much sense. Maybe something like that would fit more:

  • Devices
    • Device type
    • Device brand
    • Device model
  • Browser & Operating System
    • Browser (Versions)
    • OS (Versions)
    • Browser engine
    • Resolution
    • Browser plugins

I would maybe remove the Configurations completely or make it available as widget only. Not sure if that report is useful at all.
The browser language reports could be moved to location reports maybe, as it is more related there.

@mattab
Copy link
Member Author

mattab commented Feb 15, 2015

Maybe something like that would fit more:

maybe we could also move "Resolution" into "Devices" ?

Browser & Operating System

we need to find shorter name so it fits in the sub-menu... do you maybe have an idea?

I would maybe remove the Configurations completely or make it available as widget only. Not sure if that report is useful at all.

it's a useful report, some users have mentioned using it before (in the forums and in the tracker). Although maybe we could move this feature into a plugin that would be on the Marketplace rather than in core?

The browser language reports could be moved to location reports maybe, as it is more related there.

👍

@mattab
Copy link
Member Author

mattab commented Feb 16, 2015

Hi @sgiehl the UserSettings plugin looks now quite "deprecated" and almost empty. maybe we close this issue and create smaller follow up issue?

@sgiehl
Copy link
Member

sgiehl commented Feb 16, 2015

Yes. Let's create follow ups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Projects
None yet
Development

No branches or pull requests

3 participants