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:
Diffstat (limited to 'plugins/DevicesDetection/Columns/BrowserName.php')
-rw-r--r--plugins/DevicesDetection/Columns/BrowserName.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/plugins/DevicesDetection/Columns/BrowserName.php b/plugins/DevicesDetection/Columns/BrowserName.php
new file mode 100644
index 0000000000..6536722742
--- /dev/null
+++ b/plugins/DevicesDetection/Columns/BrowserName.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\DevicesDetection\Columns;
+
+use Piwik\Piwik;
+use Piwik\Tracker\Request;
+
+class BrowserName extends Base
+{
+ protected $fieldName = 'config_browser_name';
+ protected $fieldType = 'VARCHAR(10) NOT NULL';
+
+ public function getName()
+ {
+ return Piwik::translate('UserSettings_BrowserFamilies');
+ }
+
+ public function onNewVisit(Request $request, $visit)
+ {
+ $userAgent = $request->getUserAgent();
+ $parser = $this->getUAParser($userAgent);
+
+ return $parser->getBrowser("short_name");
+ }
+}