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
Missing device detection after upgrade from 2.3.0 to 2.16.0 #9935
Comments
The mentioned report isn't available anymore. Instead you should have a report about the device types. |
Hello @sgiehl thank you for your fast reply, that report it's empty on our installation. |
Is it also empty for a current period? Maybe it is not calculated for older periods |
For the current period we can get type, model, brand and resolution as expected. |
Did you have the If you still have all the log data you could also let piwik rearchive all the data, maybe the reports will get visible then. |
We keep only 45 days of logs because there are about an hundred configured websites. |
If DevicesDetection plugin was disabled before there won't be any reports you might be able to use. |
Please @sgiehl, can you say in which release Mobile Vs. Desktop statistic has been substituted by the Device Type one? |
I guess it was 2.10.0. But after an update the old MobileVSDesktop report should be availabe as Device type. There should have been an update script to provide that change. |
First of all sorry for posting last screenshoot (now I've deleted it). Was a mistake, DeviceDetector plugin wasn't never activated until some days ago my colleague did some tests on plugins. That plugin was in Beta status while in 2.3.0 so anyone did enabled it. Would be a better practice to automatically enable all core plugins for the future. So now the problem is we still have data of the MobileVsDesktop type in archive report db tables but they didn't changed To DeviceDetection_types after 1.16.0 upgrade script. Now I have two roads to follow:
In your opinion what to do? Do you have any idea where to look for the update script that upgrades this kind of data? Maybe in the plugin itself? Is there the archive process pluggable by each plugin? |
Diving into code 🏄 I found that getMobileVsDesktop api relies on DeviceDetector_type metric since 2.10 as sources said. I can't find the code who tells to the update scripts how to fetch from userSettings reports and write to DeviceDetector type. Maybe was never written? |
The archives should have been renamed from usersettings to devicedetection. See https://github.com/piwik/piwik/blob/master/core/Updates/2.10.0-b5.php |
Hi guys, i'm closing, as it's supposed to work. |
Ciao! Yes, is a worksforme because I ended up «MobileVsDesktop» has never been recorded but computed on the fly by a function: getDeviceTypeFromOS($osLabel). So now I'm writing a Plugin that exposes an API to let OsFamilies get counted as the previous function did. At the end I want to render the result in a Controller and a Widget. Now I'm stuck in merging old function getDeviceTypeFromOS($osLabel) to DevicesDetection's getOsFamilies() I publish my code in this issue in hope to get helped somehow, that's what I've written in my APIs until now: <?php
namespace Piwik\Plugins\RerMobileVsDesktop;
use Piwik\Container\StaticContainer;
use Piwik\DataTable;
use Piwik\Plugins\DevicesDetection\API as ddAPI;
/**
* API for plugin RerMobileVsDesktop
*
* @method static \Piwik\Plugins\RerMobileVsDesktop\API getInstance()
*/
class API extends \Piwik\Plugin\API
{
private $logger;
public function __construct()
{
$this->logger = StaticContainer::getContainer()->get('Psr\Log\LoggerInterface');
}
public function oldApiMobileVsDesktop($idSite, $period, $date, $segment = false)
{
$ddOsFamilies = ddAPI::getInstance()->getOsFamilies($idSite, $period, $date, $segment);
foreach ($ddOsFamilies->getRows() as $row)
{
$os = $row->getColumn('label');
$visits = $row->getColumn('nb_visits');
$this->logger->debug('«{os}» {vis} visits.',
[ 'os' => $os, 'vis' => $visits]
);
}
//Dummy Output missing real visits, placeholders are random int
$table = DataTable::makeFromSimpleArray([
array('label' => 'Desktop', 'nb_visits' => rand(0,9)),
array('label' => 'Mobile', 'nb_visits' => rand(10,99)),
array('label' => 'Unknown', 'nb_visits' => rand(100, 999)),
]);
return $table;
}
} |
Hi there,
we just did a Piwik jump from 2.3.0 to 2.16.0 version, now we're missing stats we stored about Mobile Vs Desktop devices during 2.3.0.
We figured out that since version 2.10.0 change-log announced MobileVsDesktop feature was deprecated.
We suppose that since 2.14.1 Mobile Vs Desktop has gone definitively in favor of Device Detector and we missed its "translation" support.
Do we need to repeat the entire upgrade process, jumping from 2.3.0 to 2.14.1 and finally to 2.16.0? Or do we need more steps?
The text was updated successfully, but these errors were encountered: