Skip to content
Browse files

refs #534: moved row evolution data processing to API plugin, added t…

…est cases
  • Loading branch information...
1 parent d36477c commit e79654b7761250d0b52db3a6de04b10ccace0bf8 EZdesign committed Mar 7, 2012
View
21 core/DataTable/Row.php
@@ -301,6 +301,27 @@ public function setMetadata($name, $value)
}
/**
+ * Deletes the given metadata
+ *
+ * @param string Meta column name (omit to delete entire metadata)
+ * @return bool True on success, false if the column didn't exist
+ */
+ public function deleteMetadata($name = false)
+ {
+ if($name === false)
+ {
+ $this->c[self::METADATA] = array();
+ return true;
+ }
+ if(!isset($this->c[self::METADATA][$name]))
+ {
+ return false;
+ }
+ unset($this->c[self::METADATA][$name]);
+ return true;
+ }
+
+ /**
* Add a new column to the row. If the column already exists, throws an exception
*
* @param string $name of the column to add
View
194 plugins/API/API.php
@@ -971,4 +971,198 @@ private function mergeDataTables($table1, $table2)
}
}
}
+
+
+ /**
+ * Get information about the evolution of a row in any report.
+ *
+ * @return array
+ */
+ public function getRowEvolution($idSite, $period, $date, $apiModule, $apiAction, $label, $language=false)
+ {
+ // this is needed because Piwik_API_Proxy uses Piwik_Common::getRequestVar which in turn
+ // uses Piwik_Common::sanitizeInputValue. This causes the > that separates recursive labels
+ // to become > and we need to undo that here.
+ $label = Piwik_Common::unsanitizeInputValue($label);
+
+ $logo = false;
+ $actualLabel = false;
+
+ $metrics = $this->getRowEvolutionMetrics($idSite, $period, $date, $apiModule, $apiAction, $language);
+ $metricNames = array_keys($metrics);
+
+ $dataTable = $this->loadRowEvolutionData($idSite, $period, $date, $apiModule, $apiAction, $label);
+
+ foreach ($dataTable->getArray() as $date => $subTable)
+ {
+ /** @var $subTable Piwik_DataTable */
+ $subTable->applyQueuedFilters();
+ if ($subTable->getRowsCount() > 0)
+ {
+ /** @var $row Piwik_DataTable_Row */
+ $row = $subTable->getFirstRow();
+
+ if (!$actualLabel)
+ {
+ $actualLabel = $row->getColumn('label');
+ $logo = $row->getMetadata('logo');
+ if ($row->getMetadata('url'))
+ {
+ $actualLabel = $row->getMetadata('url');
+ }
+ }
+
+ // remove all columns that are not in the available metrics.
+ // this removes the label as well (which is desired for two reasons: (1) it was passed
+ // in the request, (2) it would cause the evolution graph to show the label in the legend).
+ foreach ($row->getColumns() as $column => $value)
+ {
+ if (!in_array($column, $metricNames))
+ {
+ $row->deleteColumn($column);
+ }
+ }
+
+ $row->deleteMetadata();
+ }
+ }
+
+ $metadata = $this->getRowEvolutionMetadata($metrics, $dataTable);
+
+ return array(
+ 'label' => $actualLabel,
+ 'logo' => $logo == 0 ? '' : $logo,
+ 'data' => $dataTable,
+ 'metadata' => $metadata
+ );
+ }
+
+ /** @return Piwik_DataTable_Array */
+ private function loadRowEvolutionData($idSite, $period, $date, $apiModule, $apiAction, $label)
+ {
+ $parameters = array(
+ 'method' => $apiModule.'.'.$apiAction,
+ 'label' => $label,
+ 'idSite' => $idSite,
+ 'period' => $period,
+ 'date' => $date,
+ 'format' => 'original',
+ 'serialize' => '0'
+ );
+
+ // add "processed metrics" like actions per visit or bounce rate
+ if ($apiModule != 'Actions')
+ {
+ $parameters['filter_add_columns_when_show_all_columns'] = '1';
+ }
+
+ $url = Piwik_Url::getQueryStringFromParameters($parameters);
+ $request = new Piwik_API_Request($url);
+
+ try {
+ $dataTable = $request->process();
+ } catch (Exception $e) {
+ throw new Exception("API returned an error: ".$e->getMessage()."\n");
+ }
+
+ if (!($dataTable instanceof Piwik_DataTable_Array))
+ {
+ throw new Exception("API didn't return a DataTable array. Maybe you used period=range or "
+ ."a single date (i.e. not YYYY-MM-DD,YYYY-MM-DD)");
+ }
+
+ return $dataTable;
+ }
+
+ private function getRowEvolutionMetrics($idSite, $period, $date, $apiModule, $apiAction, $language)
+ {
+ $reportMetadata = $this->getMetadata($idSite, $apiModule, $apiAction, $apiParameters=false,
+ $language, $period, $date);
+
+ if (empty($reportMetadata))
+ {
+ throw new Exception("Requested report $apiModule.$apiAction for Website id=$idSite "
+ . "not found in the list of available reports. \n");
+ }
+
+ $reportMetadata = reset($reportMetadata);
+
+ $metrics = $reportMetadata['metrics'];
+ if (isset($reportMetadata['processedMetrics']) && is_array($reportMetadata['processedMetrics']))
+ {
+ $metrics = $metrics + $reportMetadata['processedMetrics'];
+ }
+
+ return $metrics;
+ }
+
+ private function getRowEvolutionMetadata(&$metrics, $dataTable)
+ {
+ // prepare result array for metrics
+ $metricsResult = array();
+ foreach ($metrics as $metric => $name)
+ {
+ $metricsResult[$metric] = array('name' => $name);
+ }
+
+ $subDataTables = $dataTable->getArray();
+ $firstDataTable = current($subDataTables);
+ $firstDataTableRow = $firstDataTable->getFirstRow();
+ $lastDataTable = end($subDataTables);
+ $lastDataTableRow = $lastDataTable->getFirstRow();
+
+ // min/max values
+ foreach ($subDataTables as $subDataTable)
+ {
+ // $subDataTable is the report for one period, it has only one row
+ $firstRow = $subDataTable->getFirstRow();
+ foreach ($metrics as $metric => $label)
+ {
+ $value = $firstRow ? floatval($firstRow->getColumn($metric)) : 0;
+ if (!isset($metricsResult[$metric]['min']) || $metricsResult[$metric]['min'] > $value)
+ {
+ $metricsResult[$metric]['min'] = $value;
+ }
+ if (!isset($metricsResult[$metric]['max']) || $metricsResult[$metric]['max'] < $value)
+ {
+ $metricsResult[$metric]['max'] = $value;
+ }
+ }
+ }
+
+ // first/last value, change
+ foreach ($metrics as $metric => $label)
+ {
+ $first = $firstDataTableRow ? floatval($firstDataTableRow->getColumn($metric)) : 0;
+ $last = $lastDataTableRow ? floatval($lastDataTableRow->getColumn($metric)) : 0;
+
+ if ($first == 0 && $last == 0)
+ {
+ $change = 0;
+ }
+ else if ($first == 0)
+ {
+ $change = 100;
+ }
+ else
+ {
+ $change = round((($last / $first) * 100) - 100);
+ }
+
+ if ($change > 0)
+ {
+ $change = '+'.$change;
+ }
+ $change = $change.'%';
+
+ $metricsResult[$metric]['first'] = $first;
+ $metricsResult[$metric]['last'] = $last;
+ $metricsResult[$metric]['change'] = $change;
+ }
+
+ return array(
+ 'metrics' => $metricsResult
+ );
+ }
+
}
View
96 tests/integration/RowEvolution.php
@@ -0,0 +1,96 @@
+<?php
+if(!defined('PIWIK_CONFIG_TEST_INCLUDED'))
+{
+ require_once dirname(__FILE__)."/../../tests/config_test.php";
+}
+
+require_once PIWIK_INCLUDE_PATH . '/tests/integration/Integration.php';
+
+/**
+ * Tests the method API.getRowEvolution
+ */
+class Test_Piwik_Integration_RowEvolution extends Test_Integration_Facade
+{
+ protected $today = '2010-03-06 11:22:33';
+ protected $idSite = null;
+
+ public function getApiToTest()
+ {
+ $return = array();
+
+ $config = array(
+ 'testSuffix' => '_referrer1',
+ 'idSite' => $this->idSite,
+ 'date' => $this->today,
+ 'otherRequestParameters' => array(
+ 'date' => '2010-02-06,2010-03-06',
+ 'period' => 'day',
+ 'apiModule' => 'Referers',
+ 'apiAction' => 'getWebsites',
+ 'label' => urlencode('www.referrer2.com'),
+ 'expanded' => 0
+ )
+ );
+
+ $return[] = array('API.getRowEvolution', $config);
+
+
+ $config['testSuffix'] = '_referrer2';
+ $config['otherRequestParameters']['label'] = urlencode(urlencode('www.referrer0.com').'>'
+ .urlencode('theReferrerPage1.html'));
+
+ $return[] = array('API.getRowEvolution', $config);
+
+
+ $config['testSuffix'] = '_pageTitles';
+ $config['otherRequestParameters']['apiModule'] = 'Actions';
+ $config['otherRequestParameters']['apiAction'] = 'getPageTitles';
+ $config['otherRequestParameters']['label'] = urlencode('incredible title 0');
+
+ $return[] = array('API.getRowEvolution', $config);
+
+
+ $config['testSuffix'] = '_pageUrls';
+ $config['otherRequestParameters']['apiModule'] = 'Actions';
+ $config['otherRequestParameters']['apiAction'] = 'getPageUrls';
+ $config['otherRequestParameters']['label'] = 'my>dir>'.urlencode('/page3');
+
+ $return[] = array('API.getRowEvolution', $config);
+
+
+ return $return;
+ }
+
+ public function getControllerActionsToTest()
+ {
+ return array();
+ }
+
+ public function getOutputPrefix()
+ {
+ return 'RowEvolution';
+ }
+
+ public function setUp()
+ {
+ parent::setUp();
+ $this->idSite = $this->createWebsite('2010-02-01 11:22:33');
+ }
+
+ protected function trackVisits()
+ {
+ $dateTime = $this->today;
+ $idSite = $this->idSite;
+
+ for ($daysIntoPast = 30; $daysIntoPast >= 0; $daysIntoPast--)
+ {
+ $visitDateTime = Piwik_Date::factory($dateTime)->subDay($daysIntoPast)->getDatetime();
+ $t = $this->getTracker($idSite, $visitDateTime, $defaultInit = true);
+ $t->setUrlReferrer('http://www.referrer'.($daysIntoPast % 5).'.com/theReferrerPage'.($daysIntoPast % 2).'.html');
+ $t->setUrl('http://example.org/my/dir/page'.($daysIntoPast % 4));
+ $t->setForceVisitDateTime($visitDateTime);
+ $this->checkResponse($t->doTrackPageView('incredible title '.($daysIntoPast % 3)));
+ }
+ }
+}
+
View
168 tests/integration/expected/test_RowEvolution_pageTitles__API.getRowEvolution_day.xml
@@ -0,0 +1,168 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <label> incredible title 0</label>
+ <logo></logo>
+ <data>
+ <result defaultKeyName="2010-02-06" />
+ <result defaultKeyName="2010-02-07">
+ <row>
+ <nb_visits>1</nb_visits>
+ <nb_hits>1</nb_hits>
+ <avg_time_on_page>0</avg_time_on_page>
+ <bounce_rate>100%</bounce_rate>
+ <exit_rate>100%</exit_rate>
+ </row>
+ </result>
+ <result defaultKeyName="2010-02-08" />
+ <result defaultKeyName="2010-02-09" />
+ <result defaultKeyName="2010-02-10">
+ <row>
+ <nb_visits>1</nb_visits>
+ <nb_hits>1</nb_hits>
+ <avg_time_on_page>0</avg_time_on_page>
+ <bounce_rate>100%</bounce_rate>
+ <exit_rate>100%</exit_rate>
+ </row>
+ </result>
+ <result defaultKeyName="2010-02-11" />
+ <result defaultKeyName="2010-02-12" />
+ <result defaultKeyName="2010-02-13">
+ <row>
+ <nb_visits>1</nb_visits>
+ <nb_hits>1</nb_hits>
+ <avg_time_on_page>0</avg_time_on_page>
+ <bounce_rate>100%</bounce_rate>
+ <exit_rate>100%</exit_rate>
+ </row>
+ </result>
+ <result defaultKeyName="2010-02-14" />
+ <result defaultKeyName="2010-02-15" />
+ <result defaultKeyName="2010-02-16">
+ <row>
+ <nb_visits>1</nb_visits>
+ <nb_hits>1</nb_hits>
+ <avg_time_on_page>0</avg_time_on_page>
+ <bounce_rate>100%</bounce_rate>
+ <exit_rate>100%</exit_rate>
+ </row>
+ </result>
+ <result defaultKeyName="2010-02-17" />
+ <result defaultKeyName="2010-02-18" />
+ <result defaultKeyName="2010-02-19">
+ <row>
+ <nb_visits>1</nb_visits>
+ <nb_hits>1</nb_hits>
+ <avg_time_on_page>0</avg_time_on_page>
+ <bounce_rate>100%</bounce_rate>
+ <exit_rate>100%</exit_rate>
+ </row>
+ </result>
+ <result defaultKeyName="2010-02-20" />
+ <result defaultKeyName="2010-02-21" />
+ <result defaultKeyName="2010-02-22">
+ <row>
+ <nb_visits>1</nb_visits>
+ <nb_hits>1</nb_hits>
+ <avg_time_on_page>0</avg_time_on_page>
+ <bounce_rate>100%</bounce_rate>
+ <exit_rate>100%</exit_rate>
+ </row>
+ </result>
+ <result defaultKeyName="2010-02-23" />
+ <result defaultKeyName="2010-02-24" />
+ <result defaultKeyName="2010-02-25">
+ <row>
+ <nb_visits>1</nb_visits>
+ <nb_hits>1</nb_hits>
+ <avg_time_on_page>0</avg_time_on_page>
+ <bounce_rate>100%</bounce_rate>
+ <exit_rate>100%</exit_rate>
+ </row>
+ </result>
+ <result defaultKeyName="2010-02-26" />
+ <result defaultKeyName="2010-02-27" />
+ <result defaultKeyName="2010-02-28">
+ <row>
+ <nb_visits>1</nb_visits>
+ <nb_hits>1</nb_hits>
+ <avg_time_on_page>0</avg_time_on_page>
+ <bounce_rate>100%</bounce_rate>
+ <exit_rate>100%</exit_rate>
+ </row>
+ </result>
+ <result defaultKeyName="2010-03-01" />
+ <result defaultKeyName="2010-03-02" />
+ <result defaultKeyName="2010-03-03">
+ <row>
+ <nb_visits>1</nb_visits>
+ <nb_hits>1</nb_hits>
+ <avg_time_on_page>0</avg_time_on_page>
+ <bounce_rate>100%</bounce_rate>
+ <exit_rate>100%</exit_rate>
+ </row>
+ </result>
+ <result defaultKeyName="2010-03-04" />
+ <result defaultKeyName="2010-03-05" />
+ <result defaultKeyName="2010-03-06">
+ <row>
+ <nb_visits>1</nb_visits>
+ <nb_hits>1</nb_hits>
+ <avg_time_on_page>0</avg_time_on_page>
+ <bounce_rate>100%</bounce_rate>
+ <exit_rate>100%</exit_rate>
+ </row>
+ </result>
+ </data>
+ <metadata>
+ <metrics>
+ <nb_hits>
+ <name>Pageviews</name>
+ <min>0</min>
+ <max>1</max>
+ <first>0</first>
+ <last>1</last>
+ <change>+100%</change>
+
+ </nb_hits>
+ <nb_visits>
+ <name>Unique Pageviews</name>
+ <min>0</min>
+ <max>1</max>
+ <first>0</first>
+ <last>1</last>
+ <change>+100%</change>
+
+ </nb_visits>
+ <bounce_rate>
+ <name>Bounce Rate</name>
+ <min>0</min>
+ <max>100</max>
+ <first>0</first>
+ <last>100</last>
+ <change>+100%</change>
+
+ </bounce_rate>
+ <avg_time_on_page>
+ <name>Avg. time on page</name>
+ <min>0</min>
+ <max>0</max>
+ <first>0</first>
+ <last>0</last>
+ <change>0%</change>
+
+ </avg_time_on_page>
+ <exit_rate>
+ <name>Exit rate</name>
+ <min>0</min>
+ <max>100</max>
+ <first>0</first>
+ <last>100</last>
+ <change>+100%</change>
+
+ </exit_rate>
+
+ </metrics>
+
+ </metadata>
+
+</result>
View
144 tests/integration/expected/test_RowEvolution_pageUrls__API.getRowEvolution_day.xml
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <label>http://example.org/my/dir/page3</label>
+ <logo></logo>
+ <data>
+ <result defaultKeyName="2010-02-06" />
+ <result defaultKeyName="2010-02-07">
+ <row>
+ <nb_visits>1</nb_visits>
+ <nb_hits>1</nb_hits>
+ <avg_time_on_page>0</avg_time_on_page>
+ <bounce_rate>100%</bounce_rate>
+ <exit_rate>100%</exit_rate>
+ </row>
+ </result>
+ <result defaultKeyName="2010-02-08" />
+ <result defaultKeyName="2010-02-09" />
+ <result defaultKeyName="2010-02-10" />
+ <result defaultKeyName="2010-02-11">
+ <row>
+ <nb_visits>1</nb_visits>
+ <nb_hits>1</nb_hits>
+ <avg_time_on_page>0</avg_time_on_page>
+ <bounce_rate>100%</bounce_rate>
+ <exit_rate>100%</exit_rate>
+ </row>
+ </result>
+ <result defaultKeyName="2010-02-12" />
+ <result defaultKeyName="2010-02-13" />
+ <result defaultKeyName="2010-02-14" />
+ <result defaultKeyName="2010-02-15">
+ <row>
+ <nb_visits>1</nb_visits>
+ <nb_hits>1</nb_hits>
+ <avg_time_on_page>0</avg_time_on_page>
+ <bounce_rate>100%</bounce_rate>
+ <exit_rate>100%</exit_rate>
+ </row>
+ </result>
+ <result defaultKeyName="2010-02-16" />
+ <result defaultKeyName="2010-02-17" />
+ <result defaultKeyName="2010-02-18" />
+ <result defaultKeyName="2010-02-19">
+ <row>
+ <nb_visits>1</nb_visits>
+ <nb_hits>1</nb_hits>
+ <avg_time_on_page>0</avg_time_on_page>
+ <bounce_rate>100%</bounce_rate>
+ <exit_rate>100%</exit_rate>
+ </row>
+ </result>
+ <result defaultKeyName="2010-02-20" />
+ <result defaultKeyName="2010-02-21" />
+ <result defaultKeyName="2010-02-22" />
+ <result defaultKeyName="2010-02-23">
+ <row>
+ <nb_visits>1</nb_visits>
+ <nb_hits>1</nb_hits>
+ <avg_time_on_page>0</avg_time_on_page>
+ <bounce_rate>100%</bounce_rate>
+ <exit_rate>100%</exit_rate>
+ </row>
+ </result>
+ <result defaultKeyName="2010-02-24" />
+ <result defaultKeyName="2010-02-25" />
+ <result defaultKeyName="2010-02-26" />
+ <result defaultKeyName="2010-02-27">
+ <row>
+ <nb_visits>1</nb_visits>
+ <nb_hits>1</nb_hits>
+ <avg_time_on_page>0</avg_time_on_page>
+ <bounce_rate>100%</bounce_rate>
+ <exit_rate>100%</exit_rate>
+ </row>
+ </result>
+ <result defaultKeyName="2010-02-28" />
+ <result defaultKeyName="2010-03-01" />
+ <result defaultKeyName="2010-03-02" />
+ <result defaultKeyName="2010-03-03">
+ <row>
+ <nb_visits>1</nb_visits>
+ <nb_hits>1</nb_hits>
+ <avg_time_on_page>0</avg_time_on_page>
+ <bounce_rate>100%</bounce_rate>
+ <exit_rate>100%</exit_rate>
+ </row>
+ </result>
+ <result defaultKeyName="2010-03-04" />
+ <result defaultKeyName="2010-03-05" />
+ <result defaultKeyName="2010-03-06" />
+ </data>
+ <metadata>
+ <metrics>
+ <nb_hits>
+ <name>Pageviews</name>
+ <min>0</min>
+ <max>1</max>
+ <first>0</first>
+ <last>0</last>
+ <change>0%</change>
+
+ </nb_hits>
+ <nb_visits>
+ <name>Unique Pageviews</name>
+ <min>0</min>
+ <max>1</max>
+ <first>0</first>
+ <last>0</last>
+ <change>0%</change>
+
+ </nb_visits>
+ <bounce_rate>
+ <name>Bounce Rate</name>
+ <min>0</min>
+ <max>100</max>
+ <first>0</first>
+ <last>0</last>
+ <change>0%</change>
+
+ </bounce_rate>
+ <avg_time_on_page>
+ <name>Avg. time on page</name>
+ <min>0</min>
+ <max>0</max>
+ <first>0</first>
+ <last>0</last>
+ <change>0%</change>
+
+ </avg_time_on_page>
+ <exit_rate>
+ <name>Exit rate</name>
+ <min>0</min>
+ <max>100</max>
+ <first>0</first>
+ <last>0</last>
+ <change>0%</change>
+
+ </exit_rate>
+
+ </metrics>
+
+ </metadata>
+
+</result>
View
157 tests/integration/expected/test_RowEvolution_referrer1__API.getRowEvolution_day.xml
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <label>www.referrer2.com</label>
+ <logo></logo>
+ <data>
+ <result defaultKeyName="2010-02-06" />
+ <result defaultKeyName="2010-02-07">
+ <row>
+ <nb_uniq_visitors>1</nb_uniq_visitors>
+ <nb_visits>1</nb_visits>
+ <nb_actions>1</nb_actions>
+ <nb_actions_per_visit>1</nb_actions_per_visit>
+ <avg_time_on_site>0</avg_time_on_site>
+ <bounce_rate>100%</bounce_rate>
+ <idsubdatatable>39</idsubdatatable>
+ </row>
+ </result>
+ <result defaultKeyName="2010-02-08" />
+ <result defaultKeyName="2010-02-09" />
+ <result defaultKeyName="2010-02-10" />
+ <result defaultKeyName="2010-02-11" />
+ <result defaultKeyName="2010-02-12">
+ <row>
+ <nb_uniq_visitors>1</nb_uniq_visitors>
+ <nb_visits>1</nb_visits>
+ <nb_actions>1</nb_actions>
+ <nb_actions_per_visit>1</nb_actions_per_visit>
+ <avg_time_on_site>0</avg_time_on_site>
+ <bounce_rate>100%</bounce_rate>
+ <idsubdatatable>189</idsubdatatable>
+ </row>
+ </result>
+ <result defaultKeyName="2010-02-13" />
+ <result defaultKeyName="2010-02-14" />
+ <result defaultKeyName="2010-02-15" />
+ <result defaultKeyName="2010-02-16" />
+ <result defaultKeyName="2010-02-17">
+ <row>
+ <nb_uniq_visitors>1</nb_uniq_visitors>
+ <nb_visits>1</nb_visits>
+ <nb_actions>1</nb_actions>
+ <nb_actions_per_visit>1</nb_actions_per_visit>
+ <avg_time_on_site>0</avg_time_on_site>
+ <bounce_rate>100%</bounce_rate>
+ <idsubdatatable>339</idsubdatatable>
+ </row>
+ </result>
+ <result defaultKeyName="2010-02-18" />
+ <result defaultKeyName="2010-02-19" />
+ <result defaultKeyName="2010-02-20" />
+ <result defaultKeyName="2010-02-21" />
+ <result defaultKeyName="2010-02-22">
+ <row>
+ <nb_uniq_visitors>1</nb_uniq_visitors>
+ <nb_visits>1</nb_visits>
+ <nb_actions>1</nb_actions>
+ <nb_actions_per_visit>1</nb_actions_per_visit>
+ <avg_time_on_site>0</avg_time_on_site>
+ <bounce_rate>100%</bounce_rate>
+ <idsubdatatable>489</idsubdatatable>
+ </row>
+ </result>
+ <result defaultKeyName="2010-02-23" />
+ <result defaultKeyName="2010-02-24" />
+ <result defaultKeyName="2010-02-25" />
+ <result defaultKeyName="2010-02-26" />
+ <result defaultKeyName="2010-02-27">
+ <row>
+ <nb_uniq_visitors>1</nb_uniq_visitors>
+ <nb_visits>1</nb_visits>
+ <nb_actions>1</nb_actions>
+ <nb_actions_per_visit>1</nb_actions_per_visit>
+ <avg_time_on_site>0</avg_time_on_site>
+ <bounce_rate>100%</bounce_rate>
+ <idsubdatatable>639</idsubdatatable>
+ </row>
+ </result>
+ <result defaultKeyName="2010-02-28" />
+ <result defaultKeyName="2010-03-01" />
+ <result defaultKeyName="2010-03-02" />
+ <result defaultKeyName="2010-03-03" />
+ <result defaultKeyName="2010-03-04">
+ <row>
+ <nb_uniq_visitors>1</nb_uniq_visitors>
+ <nb_visits>1</nb_visits>
+ <nb_actions>1</nb_actions>
+ <nb_actions_per_visit>1</nb_actions_per_visit>
+ <avg_time_on_site>0</avg_time_on_site>
+ <bounce_rate>100%</bounce_rate>
+ <idsubdatatable>789</idsubdatatable>
+ </row>
+ </result>
+ <result defaultKeyName="2010-03-05" />
+ <result defaultKeyName="2010-03-06" />
+ </data>
+ <metadata>
+ <metrics>
+ <nb_visits>
+ <name>Visits</name>
+ <min>0</min>
+ <max>1</max>
+ <first>0</first>
+ <last>0</last>
+ <change>0%</change>
+
+ </nb_visits>
+ <nb_uniq_visitors>
+ <name>Unique visitors</name>
+ <min>0</min>
+ <max>1</max>
+ <first>0</first>
+ <last>0</last>
+ <change>0%</change>
+
+ </nb_uniq_visitors>
+ <nb_actions>
+ <name>Actions</name>
+ <min>0</min>
+ <max>1</max>
+ <first>0</first>
+ <last>0</last>
+ <change>0%</change>
+
+ </nb_actions>
+ <nb_actions_per_visit>
+ <name>Actions per Visit</name>
+ <min>0</min>
+ <max>1</max>
+ <first>0</first>
+ <last>0</last>
+ <change>0%</change>
+
+ </nb_actions_per_visit>
+ <avg_time_on_site>
+ <name>Avg. Time on Website</name>
+ <min>0</min>
+ <max>0</max>
+ <first>0</first>
+ <last>0</last>
+ <change>0%</change>
+
+ </avg_time_on_site>
+ <bounce_rate>
+ <name>Bounce Rate</name>
+ <min>0</min>
+ <max>100</max>
+ <first>0</first>
+ <last>0</last>
+ <change>0%</change>
+
+ </bounce_rate>
+
+ </metrics>
+
+ </metadata>
+
+</result>
View
124 tests/integration/expected/test_RowEvolution_referrer2__API.getRowEvolution_day.xml
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <label>http://www.referrer0.com/theReferrerPage1.html</label>
+ <logo></logo>
+ <data>
+ <result defaultKeyName="2010-02-06" />
+ <result defaultKeyName="2010-02-07" />
+ <result defaultKeyName="2010-02-08" />
+ <result defaultKeyName="2010-02-09">
+ <row>
+ <nb_uniq_visitors>1</nb_uniq_visitors>
+ <nb_visits>1</nb_visits>
+ <nb_actions>1</nb_actions>
+ <nb_actions_per_visit>1</nb_actions_per_visit>
+ <avg_time_on_site>0</avg_time_on_site>
+ <bounce_rate>100%</bounce_rate>
+ </row>
+ </result>
+ <result defaultKeyName="2010-02-10" />
+ <result defaultKeyName="2010-02-11" />
+ <result defaultKeyName="2010-02-12" />
+ <result defaultKeyName="2010-02-13" />
+ <result defaultKeyName="2010-02-14" />
+ <result defaultKeyName="2010-02-15" />
+ <result defaultKeyName="2010-02-16" />
+ <result defaultKeyName="2010-02-17" />
+ <result defaultKeyName="2010-02-18" />
+ <result defaultKeyName="2010-02-19">
+ <row>
+ <nb_uniq_visitors>1</nb_uniq_visitors>
+ <nb_visits>1</nb_visits>
+ <nb_actions>1</nb_actions>
+ <nb_actions_per_visit>1</nb_actions_per_visit>
+ <avg_time_on_site>0</avg_time_on_site>
+ <bounce_rate>100%</bounce_rate>
+ </row>
+ </result>
+ <result defaultKeyName="2010-02-20" />
+ <result defaultKeyName="2010-02-21" />
+ <result defaultKeyName="2010-02-22" />
+ <result defaultKeyName="2010-02-23" />
+ <result defaultKeyName="2010-02-24" />
+ <result defaultKeyName="2010-02-25" />
+ <result defaultKeyName="2010-02-26" />
+ <result defaultKeyName="2010-02-27" />
+ <result defaultKeyName="2010-02-28" />
+ <result defaultKeyName="2010-03-01">
+ <row>
+ <nb_uniq_visitors>1</nb_uniq_visitors>
+ <nb_visits>1</nb_visits>
+ <nb_actions>1</nb_actions>
+ <nb_actions_per_visit>1</nb_actions_per_visit>
+ <avg_time_on_site>0</avg_time_on_site>
+ <bounce_rate>100%</bounce_rate>
+ </row>
+ </result>
+ <result defaultKeyName="2010-03-02" />
+ <result defaultKeyName="2010-03-03" />
+ <result defaultKeyName="2010-03-04" />
+ <result defaultKeyName="2010-03-05" />
+ <result defaultKeyName="2010-03-06" />
+ </data>
+ <metadata>
+ <metrics>
+ <nb_visits>
+ <name>Visits</name>
+ <min>0</min>
+ <max>1</max>
+ <first>0</first>
+ <last>0</last>
+ <change>0%</change>
+
+ </nb_visits>
+ <nb_uniq_visitors>
+ <name>Unique visitors</name>
+ <min>0</min>
+ <max>1</max>
+ <first>0</first>
+ <last>0</last>
+ <change>0%</change>
+
+ </nb_uniq_visitors>
+ <nb_actions>
+ <name>Actions</name>
+ <min>0</min>
+ <max>1</max>
+ <first>0</first>
+ <last>0</last>
+ <change>0%</change>
+
+ </nb_actions>
+ <nb_actions_per_visit>
+ <name>Actions per Visit</name>
+ <min>0</min>
+ <max>1</max>
+ <first>0</first>
+ <last>0</last>
+ <change>0%</change>
+
+ </nb_actions_per_visit>
+ <avg_time_on_site>
+ <name>Avg. Time on Website</name>
+ <min>0</min>
+ <max>0</max>
+ <first>0</first>
+ <last>0</last>
+ <change>0%</change>
+
+ </avg_time_on_site>
+ <bounce_rate>
+ <name>Bounce Rate</name>
+ <min>0</min>
+ <max>100</max>
+ <first>0</first>
+ <last>0</last>
+ <change>0%</change>
+
+ </bounce_rate>
+
+ </metrics>
+
+ </metadata>
+
+</result>

0 comments on commit e79654b

Please sign in to comment.
Something went wrong with that request. Please try again.