DevicesDetection plugin

After updating to 2.2.0 I’ve had a lot of “Unknown” popping up in a lot of my reports. This is especially noticeable on the Mobile vs Desktop widget and Browser family widget. In my quest to solve the above problem I noticed that the DevicesDetection plugin was disabled. If I turn it on I receive the following error in my realtime widget.

Notice: Undefined index: config_device_type in /var/www/html/piwik/plugins/Live/Visitor.php on line 539

Backtrace -->

#0 Piwik\Error::errorHandler(…) called at [/var/www/html/piwik/plugins/Live/Visitor.php:539]
#1 Piwik\Plugins\Live\Visitor->getDeviceType(…) called at [/var/www/html/piwik/plugins/Live/Visitor.php:127]
#2 Piwik\Plugins\Live\Visitor->getAllVisitorDetails(…) called at [/var/www/html/piwik/plugins/Live/API.php:554]
#3 Piwik\Plugins\Live\API->Piwik\Plugins\Live{closure}(…) called at [:]
#4 call_user_func_array(…) called at [/var/www/html/piwik/core/DataTable.php:409]
#5 Piwik\DataTable->filter(…) called at [/var/www/html/piwik/core/DataTable.php:454]
#6 Piwik\DataTable->applyQueuedFilters(…) called at [/var/www/html/piwik/core/API/ResponseBuilder.php:323]
#7 Piwik\API\ResponseBuilder->handleDataTable(…) called at [/var/www/html/piwik/core/API/ResponseBuilder.php:128]
#8 Piwik\API\ResponseBuilder->renderValue(…) called at [/var/www/html/piwik/core/API/ResponseBuilder.php:76]
#9 Piwik\API\ResponseBuilder->getResponse(…) called at [/var/www/html/piwik/core/API/Request.php:217]
#10 Piwik\API\Request->process(…) called at [/var/www/html/piwik/plugins/Live/Controller.php:114]
#11 Piwik\Plugins\Live\Controller->getLastVisitsStart(…) called at [/var/www/html/piwik/plugins/Live/Controller.php:38]
#12 Piwik\Plugins\Live\Controller->widget(…) called at [:]
#13 call_user_func_array(…) called at [/var/www/html/piwik/core/FrontController.php:500]
#14 Piwik\FrontController->doDispatch(…) called at [/var/www/html/piwik/core/FrontController.php:85]
#15 Piwik\FrontController->dispatch(…) called at [/var/www/html/piwik/core/dispatch.php:34]
#16 require_once(…) called at [/var/www/html/piwik/index.php:47]

I know the device detection plugin says its in beta but I don’t remember it breaking my live visitors or archiving which fails entirely when the plugin is enabled with an error similar to the one above.

I recently deleted piwik and redownloaded and installed the latest version.

Notice: Undefined index: config_device_type

To fix this error do the following:

  • Download from FTP your plugins/DevicesDetection folder
  • Settings>Plugins> then click ‘Uninstall’ the plugin DevicesDetection. This will delete the DevicesDetection folder.
  • Reupload the DevicesDetection folder in plugins/*
  • Settings>Plugins> then click Enable

This bug has been fixed in Piwik 2.2.2 and it will not happen again, but unfortunately the steps above are needed to “fix” the problem ‘Undefined index: config_device_type’

Let me know how you’re going!

Hey Matt,

Thanks! This fixed the real-time widget on the dashboard. If anybody else has this problem I would suggest turning on maintenance mode before following the above steps as reinstalling the plugin starts an alter on piwik_log_visit. Took awhile for mine to complete.

I still seem to have the issue with Device Type and the majority of my visitors coming in as an Unknown Device Type/Device Brand/Device Model. This screws with my Mobile vs Desktop graph which shows the majority of visits being Unknown. Browser families and Operating System Families doesn’t have as many Unknowns as Device brand and Device type. Any suggestions?

if you can check your web logs look at user agent strings and see whats predominent maybe some new devices need to added or updated.

Hello Matt,

I have got the same problem, I did exactly what you said, except the

  • Settings>Plugins> then click ‘Uninstall’ the plugin DevicesDetection. This will delete the DevicesDetection folder.
    part. In fact, I haven’t any uninstall and just “Disable” to click on.
    I downloaded, disabled, deleted the folder in plugin/, then reuploaded the old folder and re-enabled, but the issue is still there.

so you haver to “Disable” the plugin, then click “Uninstall” the plugin.

Well it seems either I do not see this button, or it doesn’t exist on my screen. I only have the “Activate” button, maybe because I have the UI in French or something, and I have no “Uninstall” that I found, I checked again.

Anyway, I solved my problem by reinstalling whole Piwik.

Thanks

Stephane I had the same problem. There was another plugin that had the uninstall link though…so I copied that url and replaced the pluginName with DevicesDetection

/index.php?module=CorePluginsAdmin&action=uninstall&pluginName=DevicesDetection after i hit this url i refreshed the page and the plugin was removed.

I’m in the process of collecting the user agent strings from my server logs. Is there an easier way to do this?

I noticed that the Devices tab under visitors does a pretty good job of determining Browser Families, Device Type, Operating System. Device Brand/Model have a lot of unknowns but that’s expected.

Browser Families: Chrome 55 Safari 52 Internet Explorer 24 Firefox 12 Android Browser 10

The Settings tab has some of the same widgets but different results and a lot more unknowns

WebKit (Safari, Chrome) 72
Unknown 46
Trident (IE) 24
Gecko (Firefox) 12

I really liked the mobile vs desktop graph but because the data is all screwed up I’ve refrained from sharing it with anyone.
Desktop 105
Unknown 31
Mobile 17

When i can determine the user agents that are causing the problem I’ll post again.

It looks my problems come from Mobile Safari?

attached http://i.imgur.com/6vbFcgH.png is an exported visitor log sorted by browserFamily all my unknowns are mobile browsers with MobileSafari assigned plugins/UserSettings/images/browsers/UNK.gif for a browserIcon

location providerUrl operatingSystemShortName browserFamily browserFamilyDescription browserName browserIcon browserCode browserVersion screenType deviceType resolution

I’m going to use the new Device Type graph which sorts visitors into Smartphone/Tablet/Desktop instead of the Mobile vs Desktop widget for now.