update Piwik to version 2.16 (fixes #91)
This commit is contained in:
parent
296343bf3b
commit
d885a4baa9
5833 changed files with 418860 additions and 226988 deletions
|
|
@ -0,0 +1,57 @@
|
|||
<?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');
|
||||
$segment->setAcceptedValues('The type of interaction with the content. For instance "click" or "submit".');
|
||||
$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;
|
||||
}
|
||||
}
|
||||
57
www/analytics/plugins/Contents/Columns/ContentName.php
Normal file
57
www/analytics/plugins/Contents/Columns/ContentName.php
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
<?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 ContentName extends ActionDimension
|
||||
{
|
||||
protected $columnName = 'idaction_content_name';
|
||||
protected $columnType = 'INTEGER(10) UNSIGNED DEFAULT NULL';
|
||||
|
||||
protected function configureSegments()
|
||||
{
|
||||
$segment = new Segment();
|
||||
$segment->setSegment('contentName');
|
||||
$segment->setName('Contents_ContentName');
|
||||
$segment->setAcceptedValues('The name of a content block, for instance "Ad Sale"');
|
||||
$this->addSegment($segment);
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return Piwik::translate('Contents_ContentName');
|
||||
}
|
||||
|
||||
public function getActionId()
|
||||
{
|
||||
return Action::TYPE_CONTENT_NAME;
|
||||
}
|
||||
|
||||
public function onLookupAction(Request $request, Action $action)
|
||||
{
|
||||
$contentName = $request->getParam('c_n');
|
||||
|
||||
if (empty($contentName)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$contentName = trim($contentName);
|
||||
|
||||
if (strlen($contentName) > 0) {
|
||||
return $contentName;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
57
www/analytics/plugins/Contents/Columns/ContentPiece.php
Normal file
57
www/analytics/plugins/Contents/Columns/ContentPiece.php
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
<?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 ContentPiece extends ActionDimension
|
||||
{
|
||||
protected $columnName = 'idaction_content_piece';
|
||||
protected $columnType = 'INTEGER(10) UNSIGNED DEFAULT NULL';
|
||||
|
||||
protected function configureSegments()
|
||||
{
|
||||
$segment = new Segment();
|
||||
$segment->setSegment('contentPiece');
|
||||
$segment->setName('Contents_ContentPiece');
|
||||
$segment->setAcceptedValues('The actual content. For instance "ad.jpg" or "My text ad"');
|
||||
$this->addSegment($segment);
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return Piwik::translate('Contents_ContentPiece');
|
||||
}
|
||||
|
||||
public function getActionId()
|
||||
{
|
||||
return Action::TYPE_CONTENT_PIECE;
|
||||
}
|
||||
|
||||
public function onLookupAction(Request $request, Action $action)
|
||||
{
|
||||
$contentPiece = $request->getParam('c_p');
|
||||
|
||||
if (empty($contentPiece)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$contentPiece = trim($contentPiece);
|
||||
|
||||
if (strlen($contentPiece) > 0) {
|
||||
return $contentPiece;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
52
www/analytics/plugins/Contents/Columns/ContentTarget.php
Normal file
52
www/analytics/plugins/Contents/Columns/ContentTarget.php
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
<?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 ContentTarget extends ActionDimension
|
||||
{
|
||||
protected $columnName = 'idaction_content_target';
|
||||
protected $columnType = 'INTEGER(10) UNSIGNED DEFAULT NULL';
|
||||
|
||||
protected function configureSegments()
|
||||
{
|
||||
$segment = new Segment();
|
||||
$segment->setSegment('contentTarget');
|
||||
$segment->setName('Contents_ContentTarget');
|
||||
$segment->setAcceptedValues('For instance the URL of a landing page: "http://landingpage.example.com"');
|
||||
$this->addSegment($segment);
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return Piwik::translate('Contents_ContentTarget');
|
||||
}
|
||||
|
||||
public function getActionId()
|
||||
{
|
||||
return Action::TYPE_CONTENT_TARGET;
|
||||
}
|
||||
|
||||
public function onLookupAction(Request $request, Action $action)
|
||||
{
|
||||
$contentTarget = $request->getParam('c_t');
|
||||
$contentTarget = trim($contentTarget);
|
||||
|
||||
if (strlen($contentTarget) > 0) {
|
||||
return $contentTarget;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
<?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\Metrics;
|
||||
|
||||
use Piwik\DataTable\Row;
|
||||
use Piwik\Metrics\Formatter;
|
||||
use Piwik\Piwik;
|
||||
use Piwik\Plugin\ProcessedMetric;
|
||||
|
||||
/**
|
||||
* The content interaction rate. Calculated as:
|
||||
*
|
||||
* nb_interactions / nb_impressions
|
||||
*
|
||||
* nb_interactions & nb_impressions are calculated by the Contents archiver.
|
||||
*/
|
||||
class InteractionRate extends ProcessedMetric
|
||||
{
|
||||
public function getName()
|
||||
{
|
||||
return 'interaction_rate';
|
||||
}
|
||||
|
||||
public function getTranslatedName()
|
||||
{
|
||||
return Piwik::translate('Contents_InteractionRate');
|
||||
}
|
||||
|
||||
public function getDocumentation()
|
||||
{
|
||||
return Piwik::translate('Contents_InteractionRateMetricDocumentation');
|
||||
}
|
||||
|
||||
public function compute(Row $row)
|
||||
{
|
||||
$interactions = $this->getMetric($row, 'nb_interactions');
|
||||
$impressions = $this->getMetric($row, 'nb_impressions');
|
||||
|
||||
return Piwik::getQuotientSafe($interactions, $impressions, $precision = 4);
|
||||
}
|
||||
|
||||
public function format($value, Formatter $formatter)
|
||||
{
|
||||
return $formatter->getPrettyPercentFromQuotient($value);
|
||||
}
|
||||
|
||||
public function getDependentMetrics()
|
||||
{
|
||||
return array('nb_interactions', 'nb_impressions');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue