Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/Tracker/VisitorRecognizer.php2
-rw-r--r--plugins/DevicesDetection/Columns/DeviceBrand.php2
-rw-r--r--plugins/DevicesDetection/Columns/DeviceModel.php2
-rw-r--r--plugins/DevicesDetection/Columns/DeviceType.php3
-rw-r--r--plugins/DevicesDetection/tests/Fixtures/MultiDeviceGoalConversions.php176
-rw-r--r--plugins/DevicesDetection/tests/System/GoalReportForDevicesTest.php53
-rw-r--r--plugins/DevicesDetection/tests/System/expected/test___DevicesDetection.getBrand_day.xml113
-rw-r--r--plugins/DevicesDetection/tests/System/expected/test___DevicesDetection.getModel_day.xml120
-rw-r--r--plugins/DevicesDetection/tests/System/expected/test___DevicesDetection.getType_day.xml141
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__DevicesDetection.getModel_day.xml8
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__DevicesDetection.getType_day.xml23
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_csv__ScheduledReports.generateReport_week.original.csv2
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html2
13 files changed, 620 insertions, 27 deletions
diff --git a/core/Tracker/VisitorRecognizer.php b/core/Tracker/VisitorRecognizer.php
index a21ea063e0..498329b51c 100644
--- a/core/Tracker/VisitorRecognizer.php
+++ b/core/Tracker/VisitorRecognizer.php
@@ -231,7 +231,7 @@ class VisitorRecognizer
$dimensions = VisitDimension::getAllDimensions();
foreach ($dimensions as $dimension) {
- if ($dimension->hasImplementedEvent('onExistingVisit')) {
+ if ($dimension->hasImplementedEvent('onExistingVisit') || $dimension->hasImplementedEvent('onAnyGoalConversion')) {
$fields[] = $dimension->getColumnName();
}
diff --git a/plugins/DevicesDetection/Columns/DeviceBrand.php b/plugins/DevicesDetection/Columns/DeviceBrand.php
index f10f5e5ca0..37d284fa83 100644
--- a/plugins/DevicesDetection/Columns/DeviceBrand.php
+++ b/plugins/DevicesDetection/Columns/DeviceBrand.php
@@ -69,6 +69,6 @@ class DeviceBrand extends Base
*/
public function onAnyGoalConversion(Request $request, Visitor $visitor, $action)
{
- return $visitor->getVisitorColumn('config_device_brand');
+ return $visitor->getVisitorColumn($this->columnName);
}
}
diff --git a/plugins/DevicesDetection/Columns/DeviceModel.php b/plugins/DevicesDetection/Columns/DeviceModel.php
index f28693e290..5f74686795 100644
--- a/plugins/DevicesDetection/Columns/DeviceModel.php
+++ b/plugins/DevicesDetection/Columns/DeviceModel.php
@@ -45,6 +45,6 @@ class DeviceModel extends Base
*/
public function onAnyGoalConversion(Request $request, Visitor $visitor, $action)
{
- return $visitor->getVisitorColumn('config_device_model');
+ return $visitor->getVisitorColumn($this->columnName);
}
}
diff --git a/plugins/DevicesDetection/Columns/DeviceType.php b/plugins/DevicesDetection/Columns/DeviceType.php
index 3cdf5a6ae5..6e18d7b3b0 100644
--- a/plugins/DevicesDetection/Columns/DeviceType.php
+++ b/plugins/DevicesDetection/Columns/DeviceType.php
@@ -11,7 +11,6 @@ namespace Piwik\Plugins\DevicesDetection\Columns;
use Piwik\Piwik;
use Piwik\Plugin\Segment;
use Piwik\Tracker\Request;
-use DeviceDetector;
use Exception;
use Piwik\Tracker\Visitor;
use Piwik\Tracker\Action;
@@ -70,6 +69,6 @@ class DeviceType extends Base
*/
public function onAnyGoalConversion(Request $request, Visitor $visitor, $action)
{
- return $visitor->getVisitorColumn('config_device_type');
+ return $visitor->getVisitorColumn($this->columnName);
}
} \ No newline at end of file
diff --git a/plugins/DevicesDetection/tests/Fixtures/MultiDeviceGoalConversions.php b/plugins/DevicesDetection/tests/Fixtures/MultiDeviceGoalConversions.php
new file mode 100644
index 0000000000..e5c1a597c5
--- /dev/null
+++ b/plugins/DevicesDetection/tests/Fixtures/MultiDeviceGoalConversions.php
@@ -0,0 +1,176 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Plugins\DevicesDetection\tests\Fixtures;
+
+use Piwik\Date;
+use Piwik\Plugins\Goals\API;
+use Piwik\Tests\Framework\Fixture;
+
+/**
+ * Fixture that adds one site with one goal and tracks some page views from different devices with some goal conversions
+ */
+class MultiDeviceGoalConversions extends Fixture
+{
+ public $dateTime = '2009-01-04 00:11:42';
+ public $idSite = 1;
+ public $idGoal = 1;
+
+ public function setUp()
+ {
+ $this->setUpWebsitesAndGoals();
+ $this->trackSmartphoneVisits();
+ $this->trackTabletVisits();
+ $this->trackOtherVisits();
+ }
+
+ public function tearDown()
+ {
+ // empty
+ }
+
+ private function setUpWebsitesAndGoals()
+ {
+ if (!self::siteCreated($idSite = 1)) {
+ self::createWebsite($this->dateTime, $ecommerce = 1);
+ }
+
+ if (!self::goalExists($idSite = 1, $idGoal = 1)) {
+ API::getInstance()->addGoal(
+ $this->idSite, 'Goal 1 - Thank you', 'title', 'Thank you', 'contains', $caseSensitive = false,
+ $revenue = 10, $allowMultipleConversions = 1
+ );
+ }
+ }
+
+ private function trackSmartphoneVisits()
+ {
+ // first visit (with conversion)
+ $t = self::getTracker($this->idSite, $this->dateTime, $defaultInit = true);
+
+ $t->setUserAgent('Mozilla/5.0 (Linux; Android 4.2.2; HTC Butterfly Build/JDQ39) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.59 Mobile Safari/537.36');
+
+ $t->setUrl('http://example.org/index.htm');
+ self::checkResponse($t->doTrackPageView('0'));
+
+ $t->setForceVisitDateTime($this->getAdjustedDateTime(0.3));
+
+ self::checkResponse($t->doTrackGoal($this->idGoal, $revenue = 42.256));
+
+ // second visit (without conversion)
+ $t = self::getTracker($this->idSite, $this->getAdjustedDateTime(0.2), $defaultInit = true);
+
+ $t->setUserAgent('Mozilla/5.0 (Linux; Android 4.2.2; HTC Butterfly Build/JDQ39) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.59 Mobile Safari/537.36');
+
+ $t->setUrl('http://example.org/anypage.php');
+ self::checkResponse($t->doTrackPageView('mine'));
+
+
+ // third visit (with conversion)
+ $t = self::getTracker($this->idSite, $this->getAdjustedDateTime(0.2), $defaultInit = true);
+
+ $t->setUserAgent('Mozilla/5.0 (iPhone; CPU iPhone OS 7_1 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Mobile/11D167 iPhone6,1/N51AP Zite/2.6');
+
+ $t->setUrl('http://example.org/anypage.php');
+ self::checkResponse($t->doTrackPageView('mine'));
+
+ $t->setForceVisitDateTime($this->getAdjustedDateTime(1));
+
+ self::checkResponse($t->doTrackGoal($this->idGoal, $revenue = 0));
+ }
+
+ private function trackTabletVisits()
+ {
+ // first visit (with conversion)
+ $t = self::getTracker($this->idSite, $this->getAdjustedDateTime(1), $defaultInit = true);
+
+ $t->setUserAgent('Mozilla/5.0 (iPad; CPU OS 6_0_1 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) CriOS/31.0.1650.18 Mobile/10A523 Safari/8536.25');
+
+ $t->setUrl('http://example.org/index.htm');
+ self::checkResponse($t->doTrackPageView('0'));
+
+ $t->setForceVisitDateTime($this->getAdjustedDateTime(1.6));
+
+ self::checkResponse($t->doTrackGoal($this->idGoal, $revenue = 42.256));
+
+ // second visit (without conversion)
+ $t = self::getTracker($this->idSite, $this->getAdjustedDateTime(0.6), $defaultInit = true);
+
+ $t->setUserAgent('Mozilla/5.0 (Linux; Android 4.2.2; SM-T310 Build/JDQ39) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.136 Safari/537.36');
+
+ $t->setUrl('http://example.org/index.htm');
+ self::checkResponse($t->doTrackPageView('0'));
+
+
+ // third visit (with conversion)
+ $t = self::getTracker($this->idSite, $this->getAdjustedDateTime(1.6), $defaultInit = true);
+
+ $t->setUserAgent('Mozilla/5.0 (Linux; U; Android 2.3;en-us; ViewSonic-ViewPad7e build/ERE27) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1');
+
+ $t->setUrl('http://example.org/anypage.php');
+ self::checkResponse($t->doTrackPageView('mine'));
+
+ $t->setForceVisitDateTime($this->getAdjustedDateTime(1.9));
+
+ self::checkResponse($t->doTrackGoal($this->idGoal, $revenue = 0));
+ }
+
+ private function trackOtherVisits()
+ {
+ // unknown device visit (with conversion)
+ $t = self::getTracker($this->idSite, $this->getAdjustedDateTime(1), $defaultInit = true);
+
+ $t->setUserAgent('not detectable');
+
+ $t->setUrl('http://example.org/anypage.php');
+ self::checkResponse($t->doTrackPageView('mine'));
+
+ $t->setForceVisitDateTime($this->getAdjustedDateTime(4));
+
+ self::checkResponse($t->doTrackGoal($this->idGoal, $revenue = 42.256));
+
+ // tv visit (without conversion)
+ $t = self::getTracker($this->idSite, $this->getAdjustedDateTime(3), $defaultInit = true);
+
+ $t->setUserAgent('WebKit/3.7.6, (CE-HTML/1.0 NETTV/3.3.0 NewB) PHILIPS-AVM-2013/2.19 (Philips, BDP5600, wired)');
+
+ $t->setUrl('http://example.org/anypage.php');
+ self::checkResponse($t->doTrackPageView('mine'));
+
+
+ // feature phone visit (with conversion)
+ $t = self::getTracker($this->idSite, $this->getAdjustedDateTime(4), $defaultInit = true);
+
+ $t->setUserAgent('Fly_DS123/Q03C_MAUI_Browser/MIDP2.0 Configuration/CLDC-1.1');
+
+ $t->setUrl('http://example.org/index.htm');
+ self::checkResponse($t->doTrackPageView('0'));
+
+ $t->setForceVisitDateTime($this->getAdjustedDateTime(4.2));
+
+ self::checkResponse($t->doTrackGoal($this->idGoal, $revenue = 0));
+
+
+ // desktop visit (with conversion)
+ $t = self::getTracker($this->idSite, $this->getAdjustedDateTime(1.6), $defaultInit = true);
+
+ $t->setUserAgent('Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; Banca Caboto s.p.a.; rv:11.0) like Gecko');
+
+ $t->setUrl('http://example.org/index.htm');
+ self::checkResponse($t->doTrackPageView('0'));
+
+ $t->setForceVisitDateTime($this->getAdjustedDateTime(1.9));
+
+ self::checkResponse($t->doTrackGoal($this->idGoal, $revenue = 0));
+ }
+
+
+ private function getAdjustedDateTime($addition)
+ {
+ return Date::factory($this->dateTime)->addHour($addition)->getDatetime();
+ }
+} \ No newline at end of file
diff --git a/plugins/DevicesDetection/tests/System/GoalReportForDevicesTest.php b/plugins/DevicesDetection/tests/System/GoalReportForDevicesTest.php
new file mode 100644
index 0000000000..67024c1c7b
--- /dev/null
+++ b/plugins/DevicesDetection/tests/System/GoalReportForDevicesTest.php
@@ -0,0 +1,53 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Plugins\DevicesDetection\tests\System;
+
+use Piwik\Plugins\DevicesDetection\tests\Fixtures\MultiDeviceGoalConversions;
+use Piwik\Tests\Framework\TestCase\SystemTestCase;
+
+/**
+ *
+ * @group Plugins
+ * @group DevicesDetection
+ */
+class GoalReportForDevicesTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ public static function getOutputPrefix()
+ {
+ return '';
+ }
+
+ public static function getPathToTestDirectory()
+ {
+ return dirname(__FILE__);
+ }
+
+ public function getApiForTesting()
+ {
+ $idSite = self::$fixture->idSite;
+ $dateTime = self::$fixture->dateTime;
+
+ return array(
+ array('DevicesDetection.getType', array('idSite' => $idSite, 'date' => $dateTime)),
+ array('DevicesDetection.getBrand', array('idSite' => $idSite, 'date' => $dateTime)),
+ array('DevicesDetection.getModel', array('idSite' => $idSite, 'date' => $dateTime)),
+ );
+ }
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+}
+
+GoalReportForDevicesTest::$fixture = new MultiDeviceGoalConversions(); \ No newline at end of file
diff --git a/plugins/DevicesDetection/tests/System/expected/test___DevicesDetection.getBrand_day.xml b/plugins/DevicesDetection/tests/System/expected/test___DevicesDetection.getBrand_day.xml
new file mode 100644
index 0000000000..a225fdb0be
--- /dev/null
+++ b/plugins/DevicesDetection/tests/System/expected/test___DevicesDetection.getBrand_day.xml
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <row>
+ <label>Apple</label>
+ <nb_uniq_visitors>2</nb_uniq_visitors>
+ <nb_visits>4</nb_visits>
+ <nb_actions>2</nb_actions>
+ <nb_users>0</nb_users>
+ <max_actions>1</max_actions>
+ <sum_visit_length>0</sum_visit_length>
+ <bounce_count>4</bounce_count>
+ <goals>
+ <row idgoal='1'>
+ <nb_conversions>2</nb_conversions>
+ <nb_visits_converted>2</nb_visits_converted>
+ <revenue>52.26</revenue>
+ </row>
+ </goals>
+ <nb_conversions>2</nb_conversions>
+ <revenue>52.26</revenue>
+ <logo>plugins/DevicesDetection/images/brand/Apple.ico</logo>
+ <segment>deviceBrand==Apple</segment>
+ </row>
+ <row>
+ <label>Unknown</label>
+ <nb_uniq_visitors>2</nb_uniq_visitors>
+ <nb_visits>3</nb_visits>
+ <nb_actions>3</nb_actions>
+ <nb_users>0</nb_users>
+ <max_actions>1</max_actions>
+ <sum_visit_length>1808</sum_visit_length>
+ <bounce_count>3</bounce_count>
+ <goals>
+ <row idgoal='1'>
+ <nb_conversions>3</nb_conversions>
+ <nb_visits_converted>2</nb_visits_converted>
+ <revenue>62.26</revenue>
+ </row>
+ </goals>
+ <nb_conversions>3</nb_conversions>
+ <revenue>62.26</revenue>
+ <logo>plugins/DevicesDetection/images/brand/Unknown.ico</logo>
+ <segment>deviceBrand==Unknown</segment>
+ </row>
+ <row>
+ <label>HTC</label>
+ <nb_uniq_visitors>1</nb_uniq_visitors>
+ <nb_visits>1</nb_visits>
+ <nb_actions>2</nb_actions>
+ <nb_users>0</nb_users>
+ <max_actions>2</max_actions>
+ <sum_visit_length>721</sum_visit_length>
+ <bounce_count>0</bounce_count>
+ <goals>
+ <row idgoal='1'>
+ <nb_conversions>1</nb_conversions>
+ <nb_visits_converted>1</nb_visits_converted>
+ <revenue>42.26</revenue>
+ </row>
+ </goals>
+ <nb_conversions>1</nb_conversions>
+ <revenue>42.26</revenue>
+ <logo>plugins/DevicesDetection/images/brand/HTC.ico</logo>
+ <segment>deviceBrand==HTC</segment>
+ </row>
+ <row>
+ <label>Philips</label>
+ <nb_uniq_visitors>1</nb_uniq_visitors>
+ <nb_visits>1</nb_visits>
+ <nb_actions>1</nb_actions>
+ <nb_users>0</nb_users>
+ <max_actions>1</max_actions>
+ <sum_visit_length>0</sum_visit_length>
+ <bounce_count>1</bounce_count>
+ <nb_visits_converted>0</nb_visits_converted>
+ <logo>plugins/DevicesDetection/images/brand/Philips.ico</logo>
+ <segment>deviceBrand==Philips</segment>
+ </row>
+ <row>
+ <label>Samsung</label>
+ <nb_uniq_visitors>1</nb_uniq_visitors>
+ <nb_visits>1</nb_visits>
+ <nb_actions>1</nb_actions>
+ <nb_users>0</nb_users>
+ <max_actions>1</max_actions>
+ <sum_visit_length>0</sum_visit_length>
+ <bounce_count>1</bounce_count>
+ <nb_visits_converted>0</nb_visits_converted>
+ <logo>plugins/DevicesDetection/images/brand/Samsung.ico</logo>
+ <segment>deviceBrand==Samsung</segment>
+ </row>
+ <row>
+ <label>ViewSonic</label>
+ <nb_uniq_visitors>1</nb_uniq_visitors>
+ <nb_visits>1</nb_visits>
+ <nb_actions>1</nb_actions>
+ <nb_users>0</nb_users>
+ <max_actions>1</max_actions>
+ <sum_visit_length>1084</sum_visit_length>
+ <bounce_count>1</bounce_count>
+ <goals>
+ <row idgoal='1'>
+ <nb_conversions>1</nb_conversions>
+ <nb_visits_converted>1</nb_visits_converted>
+ <revenue>10</revenue>
+ </row>
+ </goals>
+ <nb_conversions>1</nb_conversions>
+ <revenue>10</revenue>
+ <logo>plugins/DevicesDetection/images/brand/ViewSonic.ico</logo>
+ <segment>deviceBrand==ViewSonic</segment>
+ </row>
+</result> \ No newline at end of file
diff --git a/plugins/DevicesDetection/tests/System/expected/test___DevicesDetection.getModel_day.xml b/plugins/DevicesDetection/tests/System/expected/test___DevicesDetection.getModel_day.xml
new file mode 100644
index 0000000000..3ed4a7857a
--- /dev/null
+++ b/plugins/DevicesDetection/tests/System/expected/test___DevicesDetection.getModel_day.xml
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <row>
+ <label>Unknown</label>
+ <nb_uniq_visitors>2</nb_uniq_visitors>
+ <nb_visits>3</nb_visits>
+ <nb_actions>3</nb_actions>
+ <nb_users>0</nb_users>
+ <max_actions>1</max_actions>
+ <sum_visit_length>1808</sum_visit_length>
+ <bounce_count>3</bounce_count>
+ <goals>
+ <row idgoal='1'>
+ <nb_conversions>3</nb_conversions>
+ <nb_visits_converted>2</nb_visits_converted>
+ <revenue>62.26</revenue>
+ </row>
+ </goals>
+ <nb_conversions>3</nb_conversions>
+ <revenue>62.26</revenue>
+ </row>
+ <row>
+ <label>Apple - iPad</label>
+ <nb_uniq_visitors>1</nb_uniq_visitors>
+ <nb_visits>2</nb_visits>
+ <nb_actions>1</nb_actions>
+ <nb_users>0</nb_users>
+ <max_actions>1</max_actions>
+ <sum_visit_length>0</sum_visit_length>
+ <bounce_count>2</bounce_count>
+ <goals>
+ <row idgoal='1'>
+ <nb_conversions>1</nb_conversions>
+ <nb_visits_converted>1</nb_visits_converted>
+ <revenue>42.26</revenue>
+ </row>
+ </goals>
+ <nb_conversions>1</nb_conversions>
+ <revenue>42.26</revenue>
+ </row>
+ <row>
+ <label>Apple - iPhone 5S</label>
+ <nb_uniq_visitors>1</nb_uniq_visitors>
+ <nb_visits>2</nb_visits>
+ <nb_actions>1</nb_actions>
+ <nb_users>0</nb_users>
+ <max_actions>1</max_actions>
+ <sum_visit_length>0</sum_visit_length>
+ <bounce_count>2</bounce_count>
+ <goals>
+ <row idgoal='1'>
+ <nb_conversions>1</nb_conversions>
+ <nb_visits_converted>1</nb_visits_converted>
+ <revenue>10</revenue>
+ </row>
+ </goals>
+ <nb_conversions>1</nb_conversions>
+ <revenue>10</revenue>
+ </row>
+ <row>
+ <label>HTC - Butterfly</label>
+ <nb_uniq_visitors>1</nb_uniq_visitors>
+ <nb_visits>1</nb_visits>
+ <nb_actions>2</nb_actions>
+ <nb_users>0</nb_users>
+ <max_actions>2</max_actions>
+ <sum_visit_length>721</sum_visit_length>
+ <bounce_count>0</bounce_count>
+ <goals>
+ <row idgoal='1'>
+ <nb_conversions>1</nb_conversions>
+ <nb_visits_converted>1</nb_visits_converted>
+ <revenue>42.26</revenue>
+ </row>
+ </goals>
+ <nb_conversions>1</nb_conversions>
+ <revenue>42.26</revenue>
+ </row>
+ <row>
+ <label>Philips - Blu-ray Player (BDP5600)</label>
+ <nb_uniq_visitors>1</nb_uniq_visitors>
+ <nb_visits>1</nb_visits>
+ <nb_actions>1</nb_actions>
+ <nb_users>0</nb_users>
+ <max_actions>1</max_actions>
+ <sum_visit_length>0</sum_visit_length>
+ <bounce_count>1</bounce_count>
+ <nb_visits_converted>0</nb_visits_converted>
+ </row>
+ <row>
+ <label>Samsung - GALAXY Tab 3 8.0&quot; WiFi</label>
+ <nb_uniq_visitors>1</nb_uniq_visitors>
+ <nb_visits>1</nb_visits>
+ <nb_actions>1</nb_actions>
+ <nb_users>0</nb_users>
+ <max_actions>1</max_actions>
+ <sum_visit_length>0</sum_visit_length>
+ <bounce_count>1</bounce_count>
+ <nb_visits_converted>0</nb_visits_converted>
+ </row>
+ <row>
+ <label>ViewSonic - ViewPad 7e</label>
+ <nb_uniq_visitors>1</nb_uniq_visitors>
+ <nb_visits>1</nb_visits>
+ <nb_actions>1</nb_actions>
+ <nb_users>0</nb_users>
+ <max_actions>1</max_actions>
+ <sum_visit_length>1084</sum_visit_length>
+ <bounce_count>1</bounce_count>
+ <goals>
+ <row idgoal='1'>
+ <nb_conversions>1</nb_conversions>
+ <nb_visits_converted>1</nb_visits_converted>
+ <revenue>10</revenue>
+ </row>
+ </goals>
+ <nb_conversions>1</nb_conversions>
+ <revenue>10</revenue>
+ </row>
+</result> \ No newline at end of file
diff --git a/plugins/DevicesDetection/tests/System/expected/test___DevicesDetection.getType_day.xml b/plugins/DevicesDetection/tests/System/expected/test___DevicesDetection.getType_day.xml
new file mode 100644
index 0000000000..4f1c727203
--- /dev/null
+++ b/plugins/DevicesDetection/tests/System/expected/test___DevicesDetection.getType_day.xml
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <row>
+ <label>Tablet</label>
+ <nb_uniq_visitors>3</nb_uniq_visitors>
+ <nb_visits>4</nb_visits>
+ <nb_actions>3</nb_actions>
+ <nb_users>0</nb_users>
+ <max_actions>1</max_actions>
+ <sum_visit_length>1084</sum_visit_length>
+ <bounce_count>4</bounce_count>
+ <goals>
+ <row idgoal='1'>
+ <nb_conversions>2</nb_conversions>
+ <nb_visits_converted>2</nb_visits_converted>
+ <revenue>52.26</revenue>
+ </row>
+ </goals>
+ <nb_conversions>2</nb_conversions>
+ <revenue>52.26</revenue>
+ <segment>deviceType==tablet</segment>
+ <logo>plugins/DevicesDetection/images/screens/tablet.png</logo>
+ </row>
+ <row>
+ <label>Smartphone</label>
+ <nb_uniq_visitors>2</nb_uniq_visitors>
+ <nb_visits>3</nb_visits>
+ <nb_actions>3</nb_actions>
+ <nb_users>0</nb_users>
+ <max_actions>2</max_actions>
+ <sum_visit_length>721</sum_visit_length>
+ <bounce_count>2</bounce_count>
+ <goals>
+ <row idgoal='1'>
+ <nb_conversions>2</nb_conversions>
+ <nb_visits_converted>2</nb_visits_converted>
+ <revenue>52.26</revenue>
+ </row>
+ </goals>
+ <nb_conversions>2</nb_conversions>
+ <revenue>52.26</revenue>
+ <segment>deviceType==smartphone</segment>
+ <logo>plugins/DevicesDetection/images/screens/smartphone.png</logo>
+ </row>
+ <row>
+ <label>Unknown</label>
+ <nb_uniq_visitors>1</nb_uniq_visitors>
+ <nb_visits>2</nb_visits>
+ <nb_actions>2</nb_actions>
+ <nb_users>0</nb_users>
+ <max_actions>1</max_actions>
+ <sum_visit_length>724</sum_visit_length>
+ <bounce_count>2</bounce_count>
+ <goals>
+ <row idgoal='1'>
+ <nb_conversions>2</nb_conversions>
+ <nb_visits_converted>1</nb_visits_converted>
+ <revenue>52.26</revenue>
+ </row>
+ </goals>
+ <nb_conversions>2</nb_conversions>
+ <revenue>52.26</revenue>
+ <logo>plugins/DevicesDetection/images/screens/unknown.gif</logo>
+ </row>
+ <row>
+ <label>Desktop</label>
+ <nb_uniq_visitors>1</nb_uniq_visitors>
+ <nb_visits>1</nb_visits>
+ <nb_actions>1</nb_actions>
+ <nb_users>0</nb_users>
+ <max_actions>1</max_actions>
+ <sum_visit_length>1084</sum_visit_length>
+ <bounce_count>1</bounce_count>
+ <goals>
+ <row idgoal='1'>
+ <nb_conversions>1</nb_conversions>
+ <nb_visits_converted>1</nb_visits_converted>
+ <revenue>10</revenue>
+ </row>
+ </goals>
+ <nb_conversions>1</nb_conversions>
+ <revenue>10</revenue>
+ <segment>deviceType==desktop</segment>
+ <logo>plugins/DevicesDetection/images/screens/normal.gif</logo>
+ </row>
+ <row>
+ <label>Tv</label>
+ <nb_uniq_visitors>1</nb_uniq_visitors>
+ <nb_visits>1</nb_visits>
+ <nb_actions>1</nb_actions>
+ <nb_users>0</nb_users>
+ <max_actions>1</max_actions>
+ <sum_visit_length>0</sum_visit_length>
+ <bounce_count>1</bounce_count>
+ <nb_visits_converted>0</nb_visits_converted>
+ <segment>deviceType==tv</segment>
+ <logo>plugins/DevicesDetection/images/screens/tv.png</logo>
+ </row>
+ <row>
+ <label>Camera</label>
+ <nb_visits>0</nb_visits>
+ <segment>deviceType==camera</segment>
+ <logo>plugins/DevicesDetection/images/screens/camera.png</logo>
+ </row>
+ <row>
+ <label>Car browser</label>
+ <nb_visits>0</nb_visits>
+ <segment>deviceType==car+browser</segment>
+ <logo>plugins/DevicesDetection/images/screens/carbrowser.png</logo>
+ </row>
+ <row>
+ <label>Console</label>
+ <nb_visits>0</nb_visits>
+ <segment>deviceType==console</segment>
+ <logo>plugins/DevicesDetection/images/screens/console.gif</logo>
+ </row>
+ <row>
+ <label>Feature phone</label>
+ <nb_visits>0</nb_visits>
+ <segment>deviceType==feature+phone</segment>
+ <logo>plugins/DevicesDetection/images/screens/mobile.gif</logo>
+ </row>
+ <row>
+ <label>Phablet</label>
+ <nb_visits>0</nb_visits>
+ <segment>deviceType==phablet</segment>
+ <logo>plugins/DevicesDetection/images/screens/unknown.gif</logo>
+ </row>
+ <row>
+ <label>Portable media player</label>
+ <nb_visits>0</nb_visits>
+ <segment>deviceType==portable+media+player</segment>
+ <logo>plugins/DevicesDetection/images/screens/unknown.gif</logo>
+ </row>
+ <row>
+ <label>Smart display</label>
+ <nb_visits>0</nb_visits>
+ <segment>deviceType==smart+display</segment>
+ <logo>plugins/DevicesDetection/images/screens/unknown.gif</logo>
+ </row>
+</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__DevicesDetection.getModel_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__DevicesDetection.getModel_day.xml
index 0e8f519c31..da61c550e1 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__DevicesDetection.getModel_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__DevicesDetection.getModel_day.xml
@@ -10,15 +10,15 @@
<sum_visit_length>1621</sum_visit_length>
<bounce_count>1</bounce_count>
<goals>
- <row idgoal='2'>
+ <row idgoal='1'>
<nb_conversions>1</nb_conversions>
<nb_visits_converted>1</nb_visits_converted>
- <revenue>1</revenue>
+ <revenue>42</revenue>
</row>
- <row idgoal='1'>
+ <row idgoal='2'>
<nb_conversions>1</nb_conversions>
<nb_visits_converted>1</nb_visits_converted>
- <revenue>42</revenue>
+ <revenue>1</revenue>
</row>
</goals>
<nb_conversions>2</nb_conversions>
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__DevicesDetection.getType_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__DevicesDetection.getType_day.xml
index 37691b2a89..e809cc9f97 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__DevicesDetection.getType_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__DevicesDetection.getType_day.xml
@@ -10,14 +10,19 @@
<sum_visit_length>1621</sum_visit_length>
<bounce_count>1</bounce_count>
<goals>
+ <row idgoal='1'>
+ <nb_conversions>1</nb_conversions>
+ <nb_visits_converted>1</nb_visits_converted>
+ <revenue>42</revenue>
+ </row>
<row idgoal='2'>
<nb_conversions>1</nb_conversions>
<nb_visits_converted>1</nb_visits_converted>
<revenue>1</revenue>
</row>
</goals>
- <nb_conversions>1</nb_conversions>
- <revenue>1</revenue>
+ <nb_conversions>2</nb_conversions>
+ <revenue>43</revenue>
<segment>deviceType==desktop</segment>
<logo>plugins/DevicesDetection/images/screens/normal.gif</logo>
</row>
@@ -81,18 +86,4 @@
<segment>deviceType==tv</segment>
<logo>plugins/DevicesDetection/images/screens/tv.png</logo>
</row>
- <row>
- <label>Unknown</label>
- <goals>
- <row idgoal='1'>
- <nb_conversions>1</nb_conversions>
- <nb_visits_converted>1</nb_visits_converted>
- <revenue>42</revenue>
- </row>
- </goals>
- <nb_conversions>1</nb_conversions>
- <revenue>42</revenue>
- <nb_visits>0</nb_visits>
- <logo>plugins/DevicesDetection/images/screens/unknown.gif</logo>
- </row>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_csv__ScheduledReports.generateReport_week.original.csv b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_csv__ScheduledReports.generateReport_week.original.csv
index 488663282f..93047397fd 100644
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_csv__ScheduledReports.generateReport_week.original.csv
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_csv__ScheduledReports.generateReport_week.original.csv
@@ -18,7 +18,7 @@ VisitorName - Great name!,4,12,$ 13351.11,3,00:25:32,25%
Device type
label,nb_visits,nb_actions,revenue,nb_actions_per_visit,avg_time_on_site,bounce_rate
-Desktop,5,16,$ 250,3.2,00:22:49,20%
+Desktop,5,16,$ 13361.11,3.2,00:22:49,20%
Device model
label,nb_visits,nb_actions,revenue,nb_actions_per_visit,avg_time_on_site,bounce_rate
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html
index f04022a9ad..ee4fef630a 100644
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html
@@ -730,7 +730,7 @@
20%
</td>
<td style="font-size: 13px; border-left: 1px solid rgb(217,217,217); padding: 5px 0 5px 5px;">
- $ 250
+ $ 13361.11
</td>
</tr>
</tbody>