Skip to content
Extraits de code Groupes Projets
Non vérifiée Valider 390edc75 rédigé par Stefan Giehl's avatar Stefan Giehl Validation de GitHub
Parcourir les fichiers

Adds segment for device model (#12298)

* Adds segment for device model

and segmented visitor log link to device model report

* update tests

* submodule update
parent 48864a12
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Affichage de
avec 62 ajouts et 1 suppression
Subproject commit 0106441a5d4873aaacc08d2143551669d9563485
Subproject commit 097b3454fdf99554a5ba1bca102c0a2de728e902
......@@ -111,6 +111,26 @@ class API extends \Piwik\Plugin\API
public function getModel($idSite, $period, $date, $segment = false)
{
$dataTable = $this->getDataTable('DevicesDetection_models', $idSite, $period, $date, $segment);
$dataTable->filter(function (DataTable $table) {
foreach ($table->getRowsWithoutSummaryRow() as $row) {
$label = $row->getColumn('label');
if (strpos($label, ';') !== false) {
list($brand, $model) = explode(';', $label, 2);
$brand = getDeviceBrandLabel($brand);
} else {
$brand = null;
$model = $label;
}
$segment = sprintf('deviceBrand==%s;deviceModel==%s', urlencode($brand), urlencode($model));
$row->setMetadata('segment', $segment);
}
});
$dataTable->filter('GroupBy', array('label', __NAMESPACE__ . '\getModelName'));
return $dataTable;
}
......
......@@ -19,6 +19,8 @@ class DeviceModel extends Base
protected $type = self::TYPE_TEXT;
protected $nameSingular = 'DevicesDetection_DeviceModel';
protected $namePlural = 'DevicesDetection_DeviceModels';
protected $segmentName = 'deviceModel';
protected $acceptValues = 'iPad, Nexus 5, Galaxy S5, Fire TV, etc.';
/**
* @param Request $request
......
......@@ -18,6 +18,7 @@
</goals>
<nb_conversions>3</nb_conversions>
<revenue>62.26</revenue>
<segment>deviceBrand==Unknown;deviceModel==</segment>
</row>
<row>
<label>Apple - iPad</label>
......@@ -37,6 +38,7 @@
</goals>
<nb_conversions>1</nb_conversions>
<revenue>42.26</revenue>
<segment>deviceBrand==Apple;deviceModel==iPad</segment>
</row>
<row>
<label>Apple - iPhone 5S</label>
......@@ -56,6 +58,7 @@
</goals>
<nb_conversions>1</nb_conversions>
<revenue>10</revenue>
<segment>deviceBrand==Apple;deviceModel==iPhone+5S</segment>
</row>
<row>
<label>HTC - Butterfly</label>
......@@ -75,6 +78,7 @@
</goals>
<nb_conversions>1</nb_conversions>
<revenue>42.26</revenue>
<segment>deviceBrand==HTC;deviceModel==Butterfly</segment>
</row>
<row>
<label>Philips - Blu-ray Player (BDP5600)</label>
......@@ -86,6 +90,7 @@
<sum_visit_length>0</sum_visit_length>
<bounce_count>1</bounce_count>
<nb_visits_converted>0</nb_visits_converted>
<segment>deviceBrand==Philips;deviceModel==Blu-ray+Player+%28BDP5600%29</segment>
</row>
<row>
<label>Samsung - GALAXY Tab 3 8.0&quot; WiFi</label>
......@@ -97,6 +102,7 @@
<sum_visit_length>0</sum_visit_length>
<bounce_count>1</bounce_count>
<nb_visits_converted>0</nb_visits_converted>
<segment>deviceBrand==Samsung;deviceModel==GALAXY+Tab+3+8.0%22+WiFi</segment>
</row>
<row>
<label>ViewSonic - ViewPad 7e</label>
......@@ -116,5 +122,6 @@
</goals>
<nb_conversions>1</nb_conversions>
<revenue>10</revenue>
<segment>deviceBrand==ViewSonic;deviceModel==ViewPad+7e</segment>
</row>
</result>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<result>
<row>GALAXY Note 3</row>
<row>Nexus 4</row>
<row>Desire</row>
<row>Xperia Tablet S</row>
</result>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<result>
<nb_visits>2</nb_visits>
<nb_actions>6</nb_actions>
<nb_visits_converted>2</nb_visits_converted>
<bounce_count>1</bounce_count>
<sum_visit_length>1621</sum_visit_length>
<max_actions>5</max_actions>
<bounce_rate>50%</bounce_rate>
<nb_actions_per_visit>3</nb_actions_per_visit>
<avg_time_on_site>811</avg_time_on_site>
</result>
\ No newline at end of file
......@@ -19,6 +19,7 @@
<sum_daily_nb_uniq_visitors>38</sum_daily_nb_uniq_visitors>
<sum_daily_nb_users>2</sum_daily_nb_users>
<nb_visits_converted>0</nb_visits_converted>
<segment>deviceBrand==Unknown;deviceModel==</segment>
</row>
<row>
<label>HTC - Vision</label>
......@@ -38,6 +39,7 @@
<revenue>10</revenue>
<sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors>
<sum_daily_nb_users>0</sum_daily_nb_users>
<segment>deviceBrand==HTC;deviceModel==Vision</segment>
</row>
<row>
<label>Apple - iPhone</label>
......@@ -57,6 +59,7 @@
<revenue>5</revenue>
<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
<sum_daily_nb_users>0</sum_daily_nb_users>
<segment>deviceBrand==Apple;deviceModel==iPhone</segment>
</row>
<row>
<label>Samsung - GALAXY S5</label>
......@@ -76,5 +79,6 @@
<revenue>5</revenue>
<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
<sum_daily_nb_users>1</sum_daily_nb_users>
<segment>deviceBrand==Samsung;deviceModel==GALAXY+S5</segment>
</row>
</result>
\ No newline at end of file
......@@ -22,5 +22,6 @@
</goals>
<nb_conversions>2</nb_conversions>
<revenue>43</revenue>
<segment>deviceBrand==Unknown;deviceModel==</segment>
</row>
</result>
\ No newline at end of file
......@@ -23,5 +23,6 @@
</goals>
<nb_conversions>2</nb_conversions>
<revenue>43</revenue>
<segment>deviceBrand==Unknown;deviceModel==</segment>
</row>
</result>
\ No newline at end of file
......@@ -101,6 +101,13 @@
<segment>deviceBrand</segment>
<acceptedValues>3Q, 4Good, Acer, Ainol, Airness, Airties, Alcatel, Allview, Altech UEC, Amazon, Amoi, Apple, Archos, Arnova, ARRIS, Asus, Audiovox, Avvio, Axxion, BangOlufsen, Barnes &amp; Noble, BBK, Becker, Beetel, BenQ, BenQ-Siemens, Bird, Blackview, Blaupunkt, Blu, Bmobile, Boway, bq, Bravis, Brondi, Bush, Capitel, Captiva, Carrefour, Casio, Cat, Celkon, Changhong, Cherry Mobile, China Mobile, CnM, Coby Kyros, Compal, Compaq, ConCorde, Condor, Coolpad, Cowon, CreNova, Cricket, Crius Mea, Crosscall, Cube, CUBOT, Cyrus, Danew, Datang, Dbtel, Dell, Denver, Desay, DEXP, Dicam, Digma, DMM, DNS, DoCoMo, Doogee, Doov, Dopod, Dune HD, E-Boda, Easypix, EBEST, ECS, Elephone, Energy Sistem, Ericsson, Ericy, Eton, eTouch, Evertek, Evolveo, Explay, Ezio, Ezze, Fairphone, Fly, Foxconn, Freetel, Fujitsu, Garmin-Asus, Gateway, Gemini, Gigabyte, Gigaset, Gionee, GOCLEVER, Goly, Google, Gradiente, Grundig, Haier, Hasee, Hi-Level, Hisense, Homtom, Hosin, HP, HTC, Huawei, Humax, Hyrican, Hyundai, i-Joy, i-mate, i-mobile, iBall, iBerry, IconBIT, Ikea, iKoMo, iNew, Infinix, Inkti, Innostream, INQ, Intek, Intex, Inverto, iOcean, iTel, JAY-Tech, Jiayu, Jolla, K-Touch, Karbonn, Kazam, KDDI, Kiano, Kingsun, Komu, Konka, Konrow, Koobee, KOPO, Koridy, KT-Tech, Kumai, Kyocera, Landvo, Lanix, Lava, LCT, LeEco, Lenco, Lenovo, Le Pan, Lexand, Lexibook, LG, Lingwin, Loewe, Logicom, LYF, M.T.T., Majestic, Manta Multimedia, Mecer, Mediacom, MediaTek, Medion, MEEG, Meizu, Memup, Metz, MEU, MicroMax, Microsoft, Mio, Mitsubishi, MIXC, MLLED, Mobistel, Modecom, Mofut, Motorola, Mpman, MSI, MyPhone, NEC, Neffos, Netgear, Newgen, Nexian, NextBook, NGM, Nikon, Nintendo, Noain, Nokia, Nomi, Nous, Nvidia, O2, Odys, Onda, OnePlus, OPPO, Opsson, Orange, Ouki, OUYA, Overmax, Oysters, Palm, Panasonic, Pantech, PEAQ, Pentagram, Philips, phoneOne, Pioneer, Ployer, Point of View, Polaroid, PolyPad, Pomp, Positivo, PPTV, Prestigio, ProScan, PULID, Qilive, QMobile, Qtek, Quechua, Ramos, RCA Tablets, Readboy, Rikomagic, RIM, Roku, Rover, Sagem, Samsung, Sanyo, Sega, Selevision, Sencor, Sendo, Senseit, SFR, Sharp, Siemens, Skyworth, Smart, Smartfren, Smartisan, Softbank, Sony, Sony Ericsson, Spice, Star, Stonex, Storex, Sumvision, SunVan, SuperSonic, Supra, Symphony, T-Mobile, TB Touch, TCL, TechniSat, TechnoTrend, Tecno Mobile, Telefunken, Telenor, Telit, Tesco, Tesla, teXet, ThL, Thomson, TIANYU, TiPhone, Tolino, Toplux, Toshiba, TrekStor, Trevi, Tunisie Telecom, Turbo-X, TVC, UMIDIGI, Uniscope, Unknown, Unowhy, UTStarcom, Vastking, Vertu, Vestel, Videocon, Videoweb, ViewSonic, Vitelcom, Vivo, Vizio, VK Mobile, Vodafone, Voto, Voxtel, Walton, Web TV, WellcoM, Wexler, Wiko, Wileyfox, Wolder, Wolfgang, Wonu, Woxter, Xiaomi, Xolo, Yarvik, Ytone, Yuandao, Yusun, Zeemi, Zen, Zonda, Zopo, ZTE</acceptedValues>
</row>
<row>
<type>dimension</type>
<category>Visitors</category>
<name>Device model</name>
<segment>deviceModel</segment>
<acceptedValues>iPad, Nexus 5, Galaxy S5, Fire TV, etc.</acceptedValues>
</row>
<row>
<type>dimension</type>
<category>Visitors</category>
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter