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:
authorThomas Steur <thomas.steur@googlemail.com>2014-08-27 13:49:59 +0400
committerThomas Steur <thomas.steur@googlemail.com>2014-08-27 13:49:59 +0400
commitce8d27ce90be5be96ae540cc5805c34601590260 (patch)
tree5059abf4e95cc5bd83546213cde41f7fbce7bb00 /plugins/Contents/Columns
parent18e7b5688e7ae40a24801e2f3bd9eec867ba8c16 (diff)
refs #4996 interactions should be tracked now. As only the name is really mandatory created a new column content_name for now (instead of existing idaction_name, will maybe remove it again). Otherwise it is hard to know whether it was a content action or not and the actual problem was that maybe other actions already define an idaction_name which might be different to content_name. We need the content_name along other actions to match an interaction with an impression. Next: The client side and the redirect...
Diffstat (limited to 'plugins/Contents/Columns')
-rw-r--r--plugins/Contents/Columns/ContentInteraction.php56
-rw-r--r--plugins/Contents/Columns/ContentName.php3
2 files changed, 58 insertions, 1 deletions
diff --git a/plugins/Contents/Columns/ContentInteraction.php b/plugins/Contents/Columns/ContentInteraction.php
new file mode 100644
index 0000000000..c5e49fd0e7
--- /dev/null
+++ b/plugins/Contents/Columns/ContentInteraction.php
@@ -0,0 +1,56 @@
+<?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\Contents\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\Dimension\ActionDimension;
+use Piwik\Plugins\Actions\Segment;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\Request;
+
+class ContentInteraction extends ActionDimension
+{
+ protected $columnName = 'idaction_content_interaction';
+ protected $columnType = 'INTEGER(10) UNSIGNED DEFAULT NULL';
+
+ protected function configureSegments()
+ {
+ $segment = new Segment();
+ $segment->setSegment('contentInteraction');
+ $segment->setName('Contents_Interaction');
+ $this->addSegment($segment);
+ }
+
+ public function getName()
+ {
+ return Piwik::translate('Contents_Interaction');
+ }
+
+ public function getActionId()
+ {
+ return Action::TYPE_CONTENT_INTERACTION;
+ }
+
+ public function onLookupAction(Request $request, Action $action)
+ {
+ $interaction = $request->getParam('c_i');
+
+ if (empty($interaction)) {
+ return false;
+ }
+
+ $interaction = trim($interaction);
+
+ if (strlen($interaction) > 0) {
+ return $interaction;
+ }
+
+ return false;
+ }
+} \ No newline at end of file
diff --git a/plugins/Contents/Columns/ContentName.php b/plugins/Contents/Columns/ContentName.php
index 21af924e4b..a33fdd0b29 100644
--- a/plugins/Contents/Columns/ContentName.php
+++ b/plugins/Contents/Columns/ContentName.php
@@ -17,7 +17,8 @@ use Piwik\Tracker\Request;
class ContentName extends ActionDimension
{
- protected $columnName = 'idaction_name';
+ protected $columnName = 'idaction_content_name';
+ protected $columnType = 'INTEGER(10) UNSIGNED DEFAULT NULL';
protected function configureSegments()
{