diff --git a/config/global.ini.php b/config/global.ini.php index d558b703949180d4d3db8beea69de6145df0e505..6ea3c33e90b2e8ed0288716ab40041d9c53f36e4 100644 --- a/config/global.ini.php +++ b/config/global.ini.php @@ -216,7 +216,7 @@ record_statistics = 1 ; length of a visit in seconds. If a visitor comes back on the website visit_standard_length seconds after his last page view, it will be recorded as a new visit visit_standard_length = 1800 -; visitors that stay on the website and view only one page will be considered staying 0 second +; visitors that stay on the website and view only one page will be considered as time on site of 0 second default_time_one_page_visit = 0 ; if set to 0, any goal conversion will be credited to the last more recent non empty referer. diff --git a/core/Archive.php b/core/Archive.php index 53f7b3d1194dcf97c7ed36cfe193b8edfb6c0ea6..120f4b05bbe9c22cb0ba654e3128f9a293be03c9 100644 --- a/core/Archive.php +++ b/core/Archive.php @@ -53,6 +53,22 @@ abstract class Piwik_Archive const INDEX_GOALS = 10; const INDEX_SUM_DAILY_NB_UNIQ_VISITORS = 11; + // Specific to the Actions reports + const INDEX_PAGE_NB_HITS = 12; + const INDEX_PAGE_SUM_TIME_SPENT = 13; + + const INDEX_PAGE_EXIT_NB_UNIQ_VISITORS = 14; + const INDEX_PAGE_EXIT_NB_VISITS = 15; + const INDEX_PAGE_EXIT_SUM_DAILY_NB_UNIQ_VISITORS = 16; + + const INDEX_PAGE_ENTRY_NB_UNIQ_VISITORS = 17; + const INDEX_PAGE_ENTRY_SUM_DAILY_NB_UNIQ_VISITORS = 18; + const INDEX_PAGE_ENTRY_NB_VISITS = 19; + const INDEX_PAGE_ENTRY_NB_ACTIONS = 20; + const INDEX_PAGE_ENTRY_SUM_VISIT_LENGTH = 21; + const INDEX_PAGE_ENTRY_BOUNCE_COUNT = 22; + + // Goal reports const INDEX_GOAL_NB_CONVERSIONS = 1; const INDEX_GOAL_REVENUE = 2; @@ -68,6 +84,21 @@ abstract class Piwik_Archive Piwik_Archive::INDEX_REVENUE => 'revenue', Piwik_Archive::INDEX_GOALS => 'goals', Piwik_Archive::INDEX_SUM_DAILY_NB_UNIQ_VISITORS => 'sum_daily_nb_uniq_visitors', + + // Actions metrics + Piwik_Archive::INDEX_PAGE_NB_HITS => 'nb_hits', + Piwik_Archive::INDEX_PAGE_SUM_TIME_SPENT => 'sum_time_spent', + + Piwik_Archive::INDEX_PAGE_EXIT_NB_UNIQ_VISITORS => 'exit_nb_uniq_visitors', + Piwik_Archive::INDEX_PAGE_EXIT_NB_VISITS => 'exit_nb_visits', + Piwik_Archive::INDEX_PAGE_EXIT_SUM_DAILY_NB_UNIQ_VISITORS => 'sum_daily_exit_nb_uniq_visitors', + + Piwik_Archive::INDEX_PAGE_ENTRY_NB_UNIQ_VISITORS => 'entry_nb_uniq_visitors', + Piwik_Archive::INDEX_PAGE_ENTRY_SUM_DAILY_NB_UNIQ_VISITORS => 'sum_daily_entry_nb_uniq_visitors', + Piwik_Archive::INDEX_PAGE_ENTRY_NB_VISITS => 'entry_nb_visits', + Piwik_Archive::INDEX_PAGE_ENTRY_NB_ACTIONS => 'entry_nb_actions', + Piwik_Archive::INDEX_PAGE_ENTRY_SUM_VISIT_LENGTH => 'entry_sum_visit_length', + Piwik_Archive::INDEX_PAGE_ENTRY_BOUNCE_COUNT => 'entry_bounce_count', ); public static $mappingFromIdToNameGoal = array( @@ -270,5 +301,10 @@ abstract class Piwik_Archive public function getIdSite() { return $this->site->getId(); - } + } + + static public function clearCache() + { + self::$alreadyBuilt = array(); + } } diff --git a/core/Common.php b/core/Common.php index 40314c74e98880330899d7049c33208e538aa7a2..9fa408b763dd26f9b4eb8071ef450dca6cbb03cf 100644 --- a/core/Common.php +++ b/core/Common.php @@ -98,7 +98,10 @@ class Piwik_Common } $pluginsManager = Piwik_PluginsManager::getInstance(); - $pluginsManager->loadPlugins( Zend_Registry::get('config')->Plugins->Plugins->toArray() ); + $pluginsToLoad = Zend_Registry::get('config')->Plugins->Plugins->toArray(); + $pluginsForcedNotToLoad = Piwik_Tracker::getPluginsNotToLoad(); + $pluginsToLoad = array_diff($pluginsToLoad, $pluginsForcedNotToLoad); + $pluginsManager->loadPlugins( $pluginsToLoad ); } } diff --git a/core/DataTable/Filter/ReplaceColumnNames.php b/core/DataTable/Filter/ReplaceColumnNames.php index 6a01098cd228b39b87f3bfc141be89c841ee6446..90b4e62a32e81bad0fb7be7bcab6d6731acfe14e 100644 --- a/core/DataTable/Filter/ReplaceColumnNames.php +++ b/core/DataTable/Filter/ReplaceColumnNames.php @@ -94,6 +94,15 @@ class Piwik_DataTable_Filter_ReplaceColumnNames extends Piwik_DataTable_Filter } $columnValue = $newSubColumns; } + // If we happen to rename a column to a name that already exists, + // sum both values in the column. This should really not happen, but + // we introduced in 1.1 a new dataTable indexing scheme for Actions table, and + // could end up with both strings and their int indexes counterpart in a monthly/yearly dataTable + // built from DataTable with both formats + if(isset($newColumns[$columnName])) + { + $columnValue += $newColumns[$columnName]; + } } $newColumns[$columnName] = $columnValue; } diff --git a/core/Db/Schema/Myisam.php b/core/Db/Schema/Myisam.php index 8c54ea26a1d04b9ac465d6927e57eecd92e2b7a9..99a44a9b773bb4ba2ef7e6fb9c1676c22784d074 100644 --- a/core/Db/Schema/Myisam.php +++ b/core/Db/Schema/Myisam.php @@ -175,8 +175,10 @@ class Piwik_Db_Schema_Myisam implements Piwik_Db_Schema_Interface visit_first_action_time DATETIME NOT NULL, visit_last_action_time DATETIME NOT NULL, visit_server_date DATE NOT NULL, - visit_exit_idaction_url INTEGER(11) NOT NULL, - visit_entry_idaction_url INTEGER(11) NOT NULL, + visit_exit_idaction_url INTEGER(11) UNSIGNED NOT NULL, + visit_exit_idaction_name INTEGER(11) UNSIGNED NOT NULL, + visit_entry_idaction_url INTEGER(11) UNSIGNED NOT NULL, + visit_entry_idaction_name INTEGER(11) UNSIGNED NOT NULL, visit_total_actions SMALLINT(5) UNSIGNED NOT NULL, visit_total_time SMALLINT(5) UNSIGNED NOT NULL, visit_goal_converted TINYINT(1) NOT NULL, @@ -239,6 +241,7 @@ class Piwik_Db_Schema_Myisam implements Piwik_Db_Schema_Interface idaction_url INTEGER(10) UNSIGNED NOT NULL, idaction_url_ref INTEGER(10) UNSIGNED NOT NULL, idaction_name INTEGER(10) UNSIGNED, + idaction_name_ref INTEGER(10) UNSIGNED NOT NULL, time_spent_ref_action INTEGER(10) UNSIGNED NOT NULL, PRIMARY KEY(idlink_va), INDEX index_idvisit(idvisit) @@ -257,7 +260,8 @@ class Piwik_Db_Schema_Myisam implements Piwik_Db_Schema_Interface option_name VARCHAR( 255 ) NOT NULL, option_value LONGTEXT NOT NULL, autoload TINYINT NOT NULL DEFAULT '1', - PRIMARY KEY ( option_name ) + PRIMARY KEY ( option_name ), + INDEX autoload( autoload ) ) DEFAULT CHARSET=utf8 ", diff --git a/core/PluginsManager.php b/core/PluginsManager.php index e4b9d65a96ded9d5999acf319d810edc525c3bd4..4b9e200155b202d5209c59ef958aaa4171a879f6 100644 --- a/core/PluginsManager.php +++ b/core/PluginsManager.php @@ -528,7 +528,7 @@ class Piwik_PluginsManager_PluginException extends Exception function Piwik_PostEvent( $eventName, &$object = null, $info = array() ) { $notification = new Piwik_Event_Notification($object, $eventName, $info); - Piwik_PluginsManager::getInstance()->dispatcher->postNotification( $notification, true, false ); + Piwik_PluginsManager::getInstance()->dispatcher->postNotification( $notification, $pending = false, $bubble = false ); } /** diff --git a/core/Tracker.php b/core/Tracker.php index f88a0b3a75fcf53f13d845b549285665e963d9f9..5e285e7302cc632c34fe7daa756a6eeca1538139 100644 --- a/core/Tracker.php +++ b/core/Tracker.php @@ -23,7 +23,6 @@ class Piwik_Tracker { protected $stateValid = self::STATE_NOTHING_TO_NOTICE; - /** * @var Piwik_Tracker_Db */ @@ -45,6 +44,8 @@ class Piwik_Tracker static protected $forcedDateTime = null; static protected $forcedIpString = null; + static protected $pluginsNotToLoad = array(); + public function __construct($args = null) { $this->request = $args ? $args : $_GET + $_POST; @@ -57,6 +58,7 @@ class Piwik_Tracker { self::$forcedDateTime = $dateTime; } + public function getCurrentTimestamp() { if(!is_null(self::$forcedDateTime)) @@ -65,6 +67,20 @@ class Piwik_Tracker } return time(); } + + /** + * Do not load the specified plugins (used during testing, to disable Provider plugin) + * @param $plugins + */ + static public function setPluginsNotToLoad($plugins) + { + self::$pluginsNotToLoad = $plugins; + } + static public function getPluginsNotToLoad() + { + return self::$pluginsNotToLoad; + } + public function main() { $this->init(); @@ -276,6 +292,7 @@ class Piwik_Tracker if(is_array($pluginsTracker) && count($pluginsTracker) != 0) { + $pluginsTracker['Plugins_Tracker'] = array_diff($pluginsTracker['Plugins_Tracker'], self::getPluginsNotToLoad()); Piwik_PluginsManager::getInstance()->doNotLoadAlwaysActivatedPlugins(); Piwik_PluginsManager::getInstance()->loadPlugins( $pluginsTracker['Plugins_Tracker'] ); diff --git a/core/Tracker/Action.php b/core/Tracker/Action.php index 3ab1bbb11790d6a318f9007847233ea0f9555490..385591de99c89a7bda4b15314e0612ca393bc782 100644 --- a/core/Tracker/Action.php +++ b/core/Tracker/Action.php @@ -29,7 +29,7 @@ interface Piwik_Tracker_Action_Interface { public function getActionUrl(); public function getActionName(); public function getActionType(); - public function record( $idVisit, $idRefererAction, $timeSpentRefererAction ); + public function record( $idVisit, $idRefererActionUrl, $idRefererActionName, $timeSpentRefererAction ); public function getIdActionUrl(); public function getIdActionName(); public function getIdLinkVisitAction(); @@ -251,6 +251,7 @@ class Piwik_Tracker_Action implements Piwik_Tracker_Action_Interface Piwik_Tracker::getDatabase()->query($sql, array($this->getActionName(), $this->getActionName(), $this->getActionNameType())); $this->idActionName = Piwik_Tracker::getDatabase()->lastInsertId(); + printDebug("Recording a new page name in the lookup table: ". $this->idActionName); } if( is_null($this->idActionUrl) ) @@ -258,6 +259,7 @@ class Piwik_Tracker_Action implements Piwik_Tracker_Action_Interface Piwik_Tracker::getDatabase()->query($sql, array($this->getActionUrl(), $this->getActionUrl(), $this->getActionType())); $this->idActionUrl = Piwik_Tracker::getDatabase()->lastInsertId(); + printDebug("Recording a new page URL in the lookup table: ". $this->idActionUrl); } } @@ -274,11 +276,11 @@ class Piwik_Tracker_Action implements Piwik_Tracker_Action_Interface * Records in the DB the association between the visit and this action. * * @param int idVisit is the ID of the current visit in the DB table log_visit - * @param int idRefererAction is the ID of the last action done by the current visit. + * @param int idRefererActionUrl is the ID of the last action done by the current visit. * @param int timeSpentRefererAction is the number of seconds since the last action was done. - * It is directly related to idRefererAction. + * It is directly related to idRefererActionUrl. */ - public function record( $idVisit, $idRefererAction, $timeSpentRefererAction) + public function record( $idVisit, $idRefererActionUrl, $idRefererActionName, $timeSpentRefererAction) { $this->loadIdActionNameAndUrl(); $idActionName = $this->getIdActionName(); @@ -288,9 +290,9 @@ class Piwik_Tracker_Action implements Piwik_Tracker_Action_Interface } Piwik_Tracker::getDatabase()->query( "INSERT INTO ".Piwik_Common::prefixTable('log_link_visit_action') - ." (idvisit, idaction_url, idaction_name, idaction_url_ref, time_spent_ref_action) - VALUES (?,?,?,?,?)", - array($idVisit, $this->getIdActionUrl(), $idActionName , $idRefererAction, $timeSpentRefererAction) + ." (idvisit, idaction_url, idaction_name, idaction_url_ref, idaction_name_ref, time_spent_ref_action) + VALUES (?,?,?,?,?,?)", + array($idVisit, $this->getIdActionUrl(), $idActionName , $idRefererActionUrl, $idRefererActionName, $timeSpentRefererAction) ); $this->idLinkVisitAction = Piwik_Tracker::getDatabase()->lastInsertId(); @@ -299,7 +301,8 @@ class Piwik_Tracker_Action implements Piwik_Tracker_Action_Interface 'idSite' => $this->idSite, 'idLinkVisitAction' => $this->idLinkVisitAction, 'idVisit' => $idVisit, - 'idRefererAction' => $idRefererAction, + 'idRefererActionUrl' => $idRefererActionUrl, + 'idRefererActionName' => $idRefererActionName, 'timeSpentRefererAction' => $timeSpentRefererAction, ); printDebug($info); diff --git a/core/Tracker/Config.php b/core/Tracker/Config.php index a8ecd08fb42189de5d1c2dffaf54d5d2b9de5bea..2c826be69450559b7c45d729b7690491520fae41 100644 --- a/core/Tracker/Config.php +++ b/core/Tracker/Config.php @@ -53,7 +53,6 @@ class Piwik_Tracker_Config * * @var array */ - public $config = array(); protected $initialized = false; protected $configGlobal = false; protected $configUser = false; @@ -115,10 +114,6 @@ class Piwik_Tracker_Config { $section = array_merge($section, $this->configUser[$name]); } - if(isset($this->config[$name])) - { - $section = array_merge($section, $this->config[$name]); - } return count($section) ? $section : null; } @@ -142,4 +137,11 @@ class Piwik_Tracker_Config $this->database = $this->database_tests; $this->PluginsInstalled = array(); } + /** + * Should only be used in tests/ + */ + public function setTestValue($section, $name, $value) + { + $this->configUser[$section][$name] = $value; + } } diff --git a/core/Tracker/Visit.php b/core/Tracker/Visit.php index 39b1daa7a358ec4ba04102a982a2d382da171152..d860c736815c733dc41d17ef03f43dee8d9c5981 100644 --- a/core/Tracker/Visit.php +++ b/core/Tracker/Visit.php @@ -129,7 +129,7 @@ class Piwik_Tracker_Visit implements Piwik_Tracker_Visit_Interface $goalManager = new Piwik_Tracker_GoalManager(); $someGoalsConverted = false; - $actionUrlId = 0; + $idActionUrl = $idActionName = 0; $action = null; $idGoal = Piwik_Common::getRequestVar('idgoal', 0, 'int', $this->request); @@ -154,7 +154,8 @@ class Piwik_Tracker_Visit implements Piwik_Tracker_Visit_Interface $someGoalsConverted = $goalManager->detectGoalsMatchingUrl($this->idsite, $action); $action->loadIdActionNameAndUrl(); - $actionUrlId = $action->getIdActionUrl(); + $idActionUrl = $action->getIdActionUrl(); + $idActionName = $action->getIdActionName(); } // the visitor and session @@ -172,13 +173,15 @@ class Piwik_Tracker_Visit implements Piwik_Tracker_Visit_Interface if( $this->isVisitorKnown() && $isLastActionInTheSameVisit) { - $idActionReferer = $this->visitorInfo['visit_exit_idaction_url']; + $idRefererActionUrl = $this->visitorInfo['visit_exit_idaction_url']; + $idRefererActionName = $this->visitorInfo['visit_exit_idaction_name']; try { - $this->handleKnownVisit($actionUrlId, $someGoalsConverted); + $this->handleKnownVisit($idActionUrl, $idActionName, $someGoalsConverted); if(!is_null($action)) { $action->record( $this->visitorInfo['idvisit'], - $idActionReferer, + $idRefererActionUrl, + $idRefererActionName, $this->visitorInfo['time_spent_ref_action'] ); } @@ -210,10 +213,10 @@ class Piwik_Tracker_Visit implements Piwik_Tracker_Visit_Interface if(!$this->isVisitorKnown() || !$isLastActionInTheSameVisit) { - $this->handleNewVisit($actionUrlId, $someGoalsConverted); + $this->handleNewVisit($idActionUrl, $idActionName, $someGoalsConverted); if(!is_null($action)) { - $action->record( $this->visitorInfo['idvisit'], 0, 0 ); + $action->record( $this->visitorInfo['idvisit'], 0, 0, 0 ); } } @@ -281,7 +284,7 @@ class Piwik_Tracker_Visit implements Piwik_Tracker_Visit_Interface * Tracker.knownVisitorInformation is triggered after saving the new visit data * Even data is an array with updated information about the visit */ - protected function handleKnownVisit($actionUrlId, $someGoalsConverted) + protected function handleKnownVisit($idActionUrl, $idActionName, $someGoalsConverted) { // gather information that needs to be updated $valuesToUpdate = array(); @@ -291,11 +294,15 @@ class Piwik_Tracker_Visit implements Piwik_Tracker_Visit_Interface } $sqlActionUpdate = ''; - if(!empty($actionUrlId)) + if(!empty($idActionUrl)) { - $valuesToUpdate['visit_exit_idaction_url'] = $actionUrlId; + $valuesToUpdate['visit_exit_idaction_url'] = $idActionUrl; $sqlActionUpdate = "visit_total_actions = visit_total_actions + 1, "; } + if(!empty($idActionName)) + { + $valuesToUpdate['visit_exit_idaction_name'] = $idActionName; + } $serverTimestamp = $this->getCurrentTimestamp(); $datetimeServer = Piwik_Tracker::getDatetimeFromTimestamp($serverTimestamp); @@ -360,7 +367,7 @@ class Piwik_Tracker_Visit implements Piwik_Tracker_Visit_Interface * * 2) Insert the visit information */ - protected function handleNewVisit($actionUrlId, $someGoalsConverted) + protected function handleNewVisit($idActionUrl, $idActionName, $someGoalsConverted) { printDebug("New Visit."); @@ -402,8 +409,10 @@ class Piwik_Tracker_Visit implements Piwik_Tracker_Visit_Interface 'visit_server_date' => $this->getCurrentDate(), 'visit_first_action_time' => Piwik_Tracker::getDatetimeFromTimestamp($serverTimestamp), 'visit_last_action_time' => Piwik_Tracker::getDatetimeFromTimestamp($serverTimestamp), - 'visit_entry_idaction_url' => $actionUrlId, - 'visit_exit_idaction_url' => $actionUrlId, + 'visit_entry_idaction_url' => $idActionUrl, + 'visit_entry_idaction_name' => $idActionName, + 'visit_exit_idaction_url' => $idActionUrl, + 'visit_exit_idaction_name' => $idActionName, 'visit_total_actions' => 1, 'visit_total_time' => $defaultTimeOnePageVisit, 'visit_goal_converted' => $someGoalsConverted ? 1: 0, @@ -738,12 +747,14 @@ class Piwik_Tracker_Visit implements Piwik_Tracker_Visit_Interface $bindSql[] = $idVisitor; } + // @todo should not use visit_server_date but visit_last_action_time + check INDEX is used as expected $visitRow = Piwik_Tracker::getDatabase()->fetch( " SELECT visitor_idcookie, visit_last_action_time, visit_first_action_time, idvisit, - visit_exit_idaction_url + visit_exit_idaction_url, + visit_exit_idaction_name FROM ".Piwik_Common::prefixTable('log_visit'). " WHERE visit_server_date = ? AND idsite = ? @@ -760,6 +771,7 @@ class Piwik_Tracker_Visit implements Piwik_Tracker_Visit_Interface $this->visitorInfo['visit_first_action_time'] = strtotime($visitRow['visit_first_action_time']); $this->visitorInfo['idvisit'] = $visitRow['idvisit']; $this->visitorInfo['visit_exit_idaction_url'] = $visitRow['visit_exit_idaction_url']; + $this->visitorInfo['visit_exit_idaction_name'] = $visitRow['visit_exit_idaction_name']; $this->visitorKnown = true; @@ -876,6 +888,7 @@ class Piwik_Tracker_Visit implements Piwik_Tracker_Visit_Interface { printDebug("We manage the cookie..."); + // If new visit && not direct entry if( isset($this->visitorInfo['referer_type']) && $this->visitorInfo['referer_type'] != Piwik_Common::REFERER_TYPE_DIRECT_ENTRY) { diff --git a/core/Updates.php b/core/Updates.php index 690b9016f8fb68b1dccf421c71ace5a6ac05e04f..ddf44cc17d3e10eb579ca2f99b131d52cb5929c9 100644 --- a/core/Updates.php +++ b/core/Updates.php @@ -22,7 +22,11 @@ abstract class Piwik_Updates * Return SQL to be executed in this update * * @param string Schema name - * @return array + * @return array( + * 'INSERT .... ' => true,// if an error occurs during the query, it will be ignored + * 'ALTER .... ' => false // if an error occurs, the update will stop and fail + * // and user will have to manually runthe query + * ) */ static function getSql($schema = 'Myisam') { diff --git a/core/Updates/1.2.php b/core/Updates/1.2.php new file mode 100644 index 0000000000000000000000000000000000000000..4aaf691841f42240b73da4f8add4b6661ed50da3 --- /dev/null +++ b/core/Updates/1.2.php @@ -0,0 +1,39 @@ +<?php +/** + * Piwik - Open source web analytics + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + * @version $Id$ + * + * @category Piwik + * @package Updates + */ + +/** + * @package Updates + */ +class Piwik_Updates_1_2 extends Piwik_Updates +{ + static function getSql($schema = 'Myisam') + { + return array( + 'ALTER TABLE `'. Piwik_Common::prefixTable('log_visit') .'` + ADD `visit_entry_idaction_name` INT UNSIGNED NOT NULL AFTER `visit_entry_idaction_url`, + ADD `visit_exit_idaction_name` INT UNSIGNED NOT NULL AFTER `visit_exit_idaction_url`, + CHANGE `visit_exit_idaction_url` `visit_exit_idaction_url` INT UNSIGNED NOT NULL, + CHANGE `visit_entry_idaction_url` `visit_entry_idaction_url` INT UNSIGNED NOT NULL + ' => false, + 'ALTER TABLE `'. Piwik_Common::prefixTable('log_link_visit_action') .'` + ADD `idaction_name_ref` INT UNSIGNED NOT NULL AFTER `idaction_name` + ' => false, + 'ALTER TABLE `'. Piwik_Common::prefixTable('option') .'` ADD INDEX ( `autoload` ) ' => false, + ); + } + + static function update() + { + Piwik_Updater::updateDatabase(__FILE__, self::getSql()); + } +} + diff --git a/core/Version.php b/core/Version.php index 5cafab1f32aef105ffc662d56b3180c3c0fa68f4..a3f4166838081a886e8917172d19c7a7c27a07b7 100644 --- a/core/Version.php +++ b/core/Version.php @@ -17,5 +17,5 @@ */ final class Piwik_Version { - const VERSION = '1.1.2b1'; + const VERSION = '1.2'; } diff --git a/libs/PiwikTracker/PiwikTracker.php b/libs/PiwikTracker/PiwikTracker.php index e8c28f3f1c7f61a06b7bfc22ea3b5234b6fb8bda..826d10b44a46148a6cf1416381b23c1de07cd5e9 100644 --- a/libs/PiwikTracker/PiwikTracker.php +++ b/libs/PiwikTracker/PiwikTracker.php @@ -334,10 +334,22 @@ class PiwikTracker $content = $response; } // The cookie in the response will be set in the next request - preg_match('/^Set-Cookie: (.*?);/m', $header, $cookie); + preg_match_all('/^Set-Cookie: (.*?);/m', $header, $cookie); if(!empty($cookie[1])) { - $this->requestCookie = $cookie[1]; + // in case several cookies returned, we keep only the latest one (ie. XDEBUG puts its cookie first in the list) + if(is_array($cookie[1])) + { + $cookie = end($cookie[1]); + } + else + { + $cookie = $cookie[1]; + } + if(strpos($cookie, 'XDEBUG') === false) + { + $this->requestCookie = $cookie; + } } return $content; diff --git a/plugins/Actions/API.php b/plugins/Actions/API.php index a626a9ac4c0dbd73ddf8abd5307d72450ef657f1..757257fe230b7bb5640a67a4971198cc988c8474 100644 --- a/plugins/Actions/API.php +++ b/plugins/Actions/API.php @@ -45,6 +45,9 @@ class Piwik_Actions_API { $dataTable = $archive->getDataTable($name, $idSubtable); } + // Must be applied before Sort in this case, since the DataTable can contain both int and strings indexes + // (in the transition period between pre 1.2 and post 1.2 datatable structure) + $dataTable->filter('ReplaceColumnNames', array($recursive = true)); $dataTable->filter('Sort', array('nb_visits', 'desc', $naturalSort = false, $expanded)); $dataTable->queueFilter('ReplaceSummaryRowLabel'); return $dataTable; @@ -62,21 +65,26 @@ class Piwik_Actions_API public function getPageUrls( $idSite, $period, $date, $expanded = false, $idSubtable = false ) { $dataTable = $this->getDataTable('Actions_actions_url', $idSite, $period, $date, $expanded, $idSubtable ); - + $this->filterPageDatatable($dataTable); + return $dataTable; + } + + protected function filterPageDatatable($dataTable) + { // Average time on page = total time on page / number visits on that page - $dataTable->filter('ColumnCallbackAddColumnQuotient', array('avg_time_on_page', 'sum_time_spent', 'nb_visits', 0)); + $dataTable->queueFilter('ColumnCallbackAddColumnQuotient', array('avg_time_on_page', 'sum_time_spent', 'nb_visits', 0)); // Bounce rate = single page visits on this page / visits started on this page - $dataTable->filter('ColumnCallbackAddColumnPercentage', array('bounce_rate', 'entry_bounce_count', 'entry_nb_visits', 0)); + $dataTable->queueFilter('ColumnCallbackAddColumnPercentage', array('bounce_rate', 'entry_bounce_count', 'entry_nb_visits', 0)); // % Exit = Number of visits that finished on this page / visits on this page - $dataTable->filter('ColumnCallbackAddColumnPercentage', array('exit_rate', 'exit_nb_visits', 'nb_hits', 0)); - return $dataTable; + $dataTable->queueFilter('ColumnCallbackAddColumnPercentage', array('exit_rate', 'exit_nb_visits', 'nb_hits', 0)); } public function getPageTitles( $idSite, $period, $date, $expanded = false, $idSubtable = false) { $dataTable = $this->getDataTable('Actions_actions', $idSite, $period, $date, $expanded, $idSubtable); + $this->filterPageDatatable($dataTable); return $dataTable; } diff --git a/plugins/Actions/Actions.php b/plugins/Actions/Actions.php index b33fe2676d02122106f148b8379d50796b0b11d2..7cf8634efff70b09bd1f69e6dfd8f2767aa67ce6 100644 --- a/plugins/Actions/Actions.php +++ b/plugins/Actions/Actions.php @@ -55,12 +55,17 @@ class Piwik_Actions extends Piwik_Plugin public function getReportMetadata($notification) { $reports = &$notification->getNotificationObject(); - - $limitedMetrics = array( - - ); - $metrics = - + + $metrics = array( + 'nb_visits' => Piwik_Translate('General_ColumnUniquePageviews'), + 'nb_hits' => Piwik_Translate('General_ColumnPageviews'), + 'entry_nb_visits' => Piwik_Translate('General_ColumnEntrances'), + 'avg_time_on_page' => Piwik_Translate('General_ColumnAverageTimeOnPage'), + 'bounce_rate' => Piwik_Translate('General_ColumnBounceRate'), + 'exit_nb_visits' => Piwik_Translate('General_ColumnExits'), + 'exit_rate' => Piwik_Translate('General_ColumnExitRate'), + // 'entry_bounce_count' => Piwik_Translate('General_ColumnBounces'), + ); // Page views URLs, Downloads and Outlinks have the full set of metrics $reports[] = array( 'category' => Piwik_Translate('Actions_Actions'), @@ -68,19 +73,20 @@ class Piwik_Actions extends Piwik_Plugin 'module' => 'Actions', 'action' => 'getPageUrls', 'dimension' => Piwik_Translate('Actions_ColumnPageURL'), - 'metrics' => array( - 'nb_visits' => Piwik_Translate('General_ColumnUniquePageviews'), - 'nb_hits' => Piwik_Translate('General_ColumnPageviews'), - 'entry_nb_visits' => Piwik_Translate('General_ColumnEntrances'), - 'avg_time_on_page' => Piwik_Translate('General_ColumnAverageTimeOnPage'), - 'bounce_rate' => Piwik_Translate('General_ColumnBounceRate'), - 'exit_nb_visits' => Piwik_Translate('General_ColumnExits'), - 'exit_rate' => Piwik_Translate('General_ColumnExitRate'), - // 'entry_bounce_count' => Piwik_Translate('General_ColumnBounces'), - ), + 'metrics' => $metrics, 'processedMetrics' => false, ); + $reports[] = array( + 'category' => Piwik_Translate('Actions_Actions'), + 'name' => Piwik_Translate('Actions_SubmenuPageTitles'), + 'module' => 'Actions', + 'action' => 'getPageTitles', + 'dimension' => Piwik_Translate('Actions_ColumnPageName'), + 'metrics' => $metrics, + 'processedMetrics' => false, + ); + // Page titles, downloads and outlinks only report basic metrics $metrics = array( 'nb_hits' => Piwik_Translate('General_ColumnPageviews'), 'nb_visits', @@ -103,20 +109,6 @@ class Piwik_Actions extends Piwik_Plugin 'metrics' => $metrics, 'processedMetrics' => false, ); - // Downloads and outlinks don't have nb_uniq_visitors metrics - // But Page title report does - $metrics[] = 'nb_uniq_visitors'; - - $reports[] = array( - 'category' => Piwik_Translate('Actions_Actions'), - 'name' => Piwik_Translate('Actions_SubmenuPageTitles'), - 'module' => 'Actions', - 'action' => 'getPageTitles', - 'dimension' => Piwik_Translate('Actions_ColumnPageName'), - 'metrics' => $metrics, - 'processedMetrics' => false, - ); - } function addWidgets() @@ -141,15 +133,15 @@ class Piwik_Actions extends Piwik_Plugin } static protected $invalidSummedColumnNameToRenamedNameForPeriodArchive = array( - 'nb_uniq_visitors' => 'sum_daily_nb_uniq_visitors', - 'entry_nb_uniq_visitors' => 'sum_daily_entry_nb_uniq_visitors', - 'exit_nb_uniq_visitors' => 'sum_daily_exit_nb_uniq_visitors', + Piwik_Archive::INDEX_NB_UNIQ_VISITORS => Piwik_Archive::INDEX_SUM_DAILY_NB_UNIQ_VISITORS, + Piwik_Archive::INDEX_PAGE_ENTRY_NB_UNIQ_VISITORS => Piwik_Archive::INDEX_PAGE_ENTRY_SUM_DAILY_NB_UNIQ_VISITORS, + Piwik_Archive::INDEX_PAGE_EXIT_NB_UNIQ_VISITORS => Piwik_Archive::INDEX_PAGE_EXIT_SUM_DAILY_NB_UNIQ_VISITORS, ); protected static $invalidSummedColumnNameToDeleteFromDayArchive = array( - 'nb_uniq_visitors', - 'entry_nb_uniq_visitors', - 'exit_nb_uniq_visitors', + Piwik_Archive::INDEX_NB_UNIQ_VISITORS, + Piwik_Archive::INDEX_PAGE_ENTRY_NB_UNIQ_VISITORS, + Piwik_Archive::INDEX_PAGE_EXIT_NB_UNIQ_VISITORS, ); public function __construct() @@ -169,7 +161,7 @@ class Piwik_Actions extends Piwik_Plugin self::$defaultActionName = Zend_Registry::get('config')->General->action_default_name; self::$defaultActionNameWhenNotDefined = Zend_Registry::get('config')->General->action_default_name_when_not_defined; self::$defaultActionUrlWhenNotDefined = Zend_Registry::get('config')->General->action_default_url_when_not_defined; - $this->columnToSortByBeforeTruncation = 'nb_visits'; + $this->columnToSortByBeforeTruncation = Piwik_Archive::INDEX_NB_VISITS; $this->maximumRowsInDataTableLevelZero = Zend_Registry::get('config')->General->datatable_archiving_maximum_rows_actions; $this->maximumRowsInSubDataTable = Zend_Registry::get('config')->General->datatable_archiving_maximum_rows_subtable_actions; } @@ -196,7 +188,6 @@ class Piwik_Actions extends Piwik_Plugin */ public function archiveDay( $notification ) { - //TODO Actions should use integer based keys like other archive in piwik /* @var $archiveProcessing Piwik_ArchiveProcessing */ $archiveProcessing = $notification->getNotificationObject(); @@ -212,106 +203,97 @@ class Piwik_Actions extends Piwik_Plugin // so we add this fake row information to make sure there is a nb_hits, etc. column for every action $this->defaultRow = new Piwik_DataTable_Row(array( Piwik_DataTable_Row::COLUMNS => array( - 'nb_visits' => 1, - 'nb_uniq_visitors' => 1, - 'nb_hits' => 1, + Piwik_Archive::INDEX_NB_VISITS => 1, + Piwik_Archive::INDEX_NB_UNIQ_VISITORS => 1, + Piwik_Archive::INDEX_PAGE_NB_HITS => 1, ))); + + /* - * Actions urls global information - */ - $query = "SELECT name, - type, - count(distinct t1.idvisit) as nb_visits, - count(distinct visitor_idcookie) as nb_uniq_visitors, - count(*) as nb_hits - FROM (".$archiveProcessing->logTable." as t1 - LEFT JOIN ".$archiveProcessing->logVisitActionTable." as t2 USING (idvisit)) - LEFT JOIN ".$archiveProcessing->logActionTable." as t3 ON (t2.idaction_url = t3.idaction) - WHERE visit_last_action_time >= ? - AND visit_last_action_time <= ? - AND idsite = ? - GROUP BY t3.idaction, name, type - ORDER BY nb_hits DESC"; - $query = $archiveProcessing->db->query($query, array( $archiveProcessing->getStartDatetimeUTC(), $archiveProcessing->getEndDatetimeUTC(), $archiveProcessing->idsite )); - $modified = $this->updateActionsTableWithRowQuery($query); - - /* - * Actions names global information + * Page URLs and Page names, general stats */ - $query = "SELECT name, + $queryString = "SELECT name, type, - count(distinct t1.idvisit) as nb_visits, - count(distinct visitor_idcookie) as nb_uniq_visitors, - count(*) as nb_hits + idaction, + count(distinct t1.idvisit) as `". Piwik_Archive::INDEX_NB_VISITS ."`, + count(distinct visitor_idcookie) as `". Piwik_Archive::INDEX_NB_UNIQ_VISITORS ."`, + count(*) as `". Piwik_Archive::INDEX_PAGE_NB_HITS ."` FROM (".$archiveProcessing->logTable." as t1 LEFT JOIN ".$archiveProcessing->logVisitActionTable." as t2 USING (idvisit)) - LEFT JOIN ".$archiveProcessing->logActionTable." as t3 ON (t2.idaction_name = t3.idaction) + LEFT JOIN ".$archiveProcessing->logActionTable." as t3 ON (t2.%s = idaction) WHERE visit_last_action_time >= ? AND visit_last_action_time <= ? AND idsite = ? - GROUP BY t3.idaction, name, type - ORDER BY nb_hits DESC"; - $query = $archiveProcessing->db->query($query, array( $archiveProcessing->getStartDatetimeUTC(), $archiveProcessing->getEndDatetimeUTC(), $archiveProcessing->idsite )); - $modified = $this->updateActionsTableWithRowQuery($query); + AND %s > 0 + GROUP BY idaction + ORDER BY `". Piwik_Archive::INDEX_PAGE_NB_HITS ."` DESC"; + $this->archiveDayQueryProcess($queryString, "idaction_url", $archiveProcessing); + $this->archiveDayQueryProcess($queryString, "idaction_name", $archiveProcessing); /* - * Entry actions + * Entry actions for Page URLs and Page names */ - $query = "SELECT name, - type, - count(distinct visitor_idcookie) as entry_nb_uniq_visitors, - count(*) as entry_nb_visits, - sum(visit_total_actions) as entry_nb_actions, - sum(visit_total_time) as entry_sum_visit_length, - sum(case visit_total_actions when 1 then 1 else 0 end) as entry_bounce_count + $queryString = "SELECT %s as idaction, + count(distinct visitor_idcookie) as `". Piwik_Archive::INDEX_PAGE_ENTRY_NB_UNIQ_VISITORS ."`, + count(*) as `". Piwik_Archive::INDEX_PAGE_ENTRY_NB_VISITS ."`, + sum(visit_total_actions) as `". Piwik_Archive::INDEX_PAGE_ENTRY_NB_ACTIONS ."`, + sum(visit_total_time) as `". Piwik_Archive::INDEX_PAGE_ENTRY_SUM_VISIT_LENGTH ."`, + sum(case visit_total_actions when 1 then 1 else 0 end) as `". Piwik_Archive::INDEX_PAGE_ENTRY_BOUNCE_COUNT ."` FROM ".$archiveProcessing->logTable." - JOIN ".$archiveProcessing->logActionTable." ON (visit_entry_idaction_url = idaction) WHERE visit_last_action_time >= ? AND visit_last_action_time <= ? AND idsite = ? - GROUP BY visit_entry_idaction_url, name, type - "; - $query = $archiveProcessing->db->query($query, array( $archiveProcessing->getStartDatetimeUTC(), $archiveProcessing->getEndDatetimeUTC(), $archiveProcessing->idsite )); - $modified = $this->updateActionsTableWithRowQuery($query); + AND %s > 0 + GROUP BY %s, idaction"; + $this->archiveDayQueryProcess($queryString, "visit_entry_idaction_url", $archiveProcessing); + $this->archiveDayQueryProcess($queryString, "visit_entry_idaction_name", $archiveProcessing); - /* * Exit actions */ - $query = "SELECT name, - type, - count(distinct visitor_idcookie) as exit_nb_uniq_visitors, - count(*) as exit_nb_visits + $queryString = "SELECT %s as idaction, + count(distinct visitor_idcookie) as `". Piwik_Archive::INDEX_PAGE_EXIT_NB_UNIQ_VISITORS ."`, + count(*) as `". Piwik_Archive::INDEX_PAGE_EXIT_NB_VISITS ."` FROM ".$archiveProcessing->logTable." - JOIN ".$archiveProcessing->logActionTable." ON (visit_exit_idaction_url = idaction) WHERE visit_last_action_time >= ? AND visit_last_action_time <= ? AND idsite = ? - GROUP BY visit_exit_idaction_url, name, type - "; - $query = $archiveProcessing->db->query($query, array( $archiveProcessing->getStartDatetimeUTC(), $archiveProcessing->getEndDatetimeUTC(), $archiveProcessing->idsite )); - $modified = $this->updateActionsTableWithRowQuery($query); + AND %s > 0 + GROUP BY %s, idaction"; + $this->archiveDayQueryProcess($queryString, "visit_exit_idaction_url", $archiveProcessing); + $this->archiveDayQueryProcess($queryString, "visit_exit_idaction_name", $archiveProcessing); /* * Time per action */ - $query = "SELECT name, - type, - sum(time_spent_ref_action) as sum_time_spent + $queryString = "SELECT %s as idaction, + sum(time_spent_ref_action) as `".Piwik_Archive::INDEX_PAGE_SUM_TIME_SPENT."` FROM (".$archiveProcessing->logTable." log_visit JOIN ".$archiveProcessing->logVisitActionTable." log_link_visit_action USING (idvisit)) - JOIN ".$archiveProcessing->logActionTable." log_action ON (log_action.idaction = log_link_visit_action.idaction_url_ref) WHERE visit_last_action_time >= ? AND visit_last_action_time <= ? AND idsite = ? - GROUP BY idaction_url_ref, name, type - "; - $query = $archiveProcessing->db->query($query, array( $archiveProcessing->getStartDatetimeUTC(), $archiveProcessing->getEndDatetimeUTC(), $archiveProcessing->idsite )); - $modified = $this->updateActionsTableWithRowQuery($query); + AND time_spent_ref_action > 0 + AND %s > 0 + GROUP BY %s, idaction"; + $this->archiveDayQueryProcess($queryString, "idaction_url_ref", $archiveProcessing); + $this->archiveDayQueryProcess($queryString, "idaction_name_ref", $archiveProcessing); + + // Empty static cache + self::$cacheParsedAction = array(); + + // Record the final datasets $this->archiveDayRecordInDatabase($archiveProcessing); } + protected function archiveDayQueryProcess($queryString, $sprintfParameter, $archiveProcessing) + { + $queryString = str_replace("%s", $sprintfParameter, $queryString); + $resultSet = $archiveProcessing->db->query($queryString, array( $archiveProcessing->getStartDatetimeUTC(), $archiveProcessing->getEndDatetimeUTC(), $archiveProcessing->idsite )); + $modified = $this->updateActionsTableWithRowQuery($resultSet); + return $modified; + } protected function archiveDayRecordInDatabase($archiveProcessing) { $dataTable = Piwik_ArchiveProcessing_Day::generateDataTable($this->actionsTablesByType[Piwik_Tracker_Action::TYPE_ACTION_URL]); @@ -442,99 +424,71 @@ class Piwik_Actions extends Piwik_Plugin return array_values( $split ); } + const CACHE_PARSED_INDEX_NAME = 0; + const CACHE_PARSED_INDEX_TYPE = 1; + static $cacheParsedAction = array(); + protected function updateActionsTableWithRowQuery($query) { $rowsProcessed = 0; while( $row = $query->fetch() ) { - // in some unknown case, the type field is NULL, as reported in #1082 - we ignore this page view - if(empty($row['type'])) { - continue; - } - - $actionExplodedNames = $this->getActionExplodedNames($row['name'], $row['type']); - - // we work on the root table of the given TYPE (either ACTION_URL or DOWNLOAD or OUTLINK etc.) - $currentTable =& $this->actionsTablesByType[$row['type']]; - - // go to the level of the subcategory - $end = count($actionExplodedNames)-1; - for($level = 0 ; $level < $end; $level++) + // Only the first query will contain the name and type of actions, for performance reasons + if(isset($row['name']) + && isset($row['type'])) { - $actionCategory = $actionExplodedNames[$level]; - $currentTable =& $currentTable[$actionCategory]; + $actionName = $row['name']; + $actionType = $row['type']; + // in some unknown case, the type field is NULL, as reported in #1082 - we ignore this page view + if(empty($actionType)) + { + self::$cacheParsedAction[$row['idaction']] = false; + continue; + } + + $currentTable = $this->parseActionNameCategoriesInDataTable($actionName, $actionType); + + self::$cacheParsedAction[$row['idaction']] = $currentTable; } - $actionName = $actionExplodedNames[$end]; - - // we are careful to prefix the page URL / name with some value - // so that if a page has the same name as a category - // we don't merge both entries - if($row['type'] == Piwik_Tracker_Action::TYPE_ACTION_URL ) + else { - $actionName = '/' . $actionName; - } - else - { - $actionName = ' ' . $actionName; - } - - // currentTable is now the array element corresponding the the action - // at this point we may be for example at the 4th level of depth in the hierarchy - $currentTable =& $currentTable[$actionName]; - - // add the row to the matching sub category subtable - if(!($currentTable instanceof Piwik_DataTable_Row)) - { - if( $row['type'] == Piwik_Tracker_Action::TYPE_ACTION_NAME ) + if(!isset(self::$cacheParsedAction[$row['idaction']])) { - $currentTable = new Piwik_DataTable_Row(array( - Piwik_DataTable_Row::COLUMNS => array('label' => (string)$actionName), - )); + var_dump($row); + debug_print_backtrace(); + throw new Exception("id action ". $row['idaction'] . " was not cached, but we expected it. Pleas report this issue in Piwik forums."); } - else + $currentTable = self::$cacheParsedAction[$row['idaction']]; + // Action processed as "to skip" for some reasons + if($currentTable === false) { - $currentTable = new Piwik_DataTable_Row(array( - Piwik_DataTable_Row::COLUMNS => array('label' => (string)$actionName), - Piwik_DataTable_Row::METADATA => array('url' => (string)$row['name']), - )); + continue; } } - // For pages that bounce, we don't know the time on page. - if($row['type'] == Piwik_Tracker_Action::TYPE_ACTION_URL - && isset($row['nb_visits']) - && !isset($row['sum_time_spent'])) - { - $row['sum_time_spent'] = Zend_Registry::get('config')->Tracker->default_time_one_page_visit * $row['nb_visits']; - } - + unset($row['name']); + unset($row['type']); + unset($row['idaction']); foreach($row as $name => $value) { - // we don't add this information as itnot pertinent - // name is already set as the label // and it has been cleaned from the categories and extracted from the initial string - // type is used to partition the different actions type in different table. Adding the info to the row would be a duplicate. - if($name != 'name' - && $name != 'type') + // in some edge cases, we have twice the same action name with 2 different idaction + // this happens when 2 visitors visit the same new page at the same time, there is a SELECT and an INSERT for each new page, + // and in between the two the other visitor comes. + // here we handle the case where there is already a row for this action name, if this is the case we add the value + if(($alreadyValue = $currentTable->getColumn($name)) !== false) + { + $currentTable->setColumn($name, $alreadyValue+$value); + } + else { - // in some edge cases, we have twice the same action name with 2 different idaction - // this happens when 2 visitors visit the same new page at the same time, there is a SELECT and an INSERT for each new page, - // and in between the two the other visitor comes. - // here we handle the case where there is already a row for this action name, if this is the case we add the value - if(($alreadyValue = $currentTable->getColumn($name)) !== false) - { - $currentTable->setColumn($name, $alreadyValue+$value); - } - else - { - $currentTable->addColumn($name, $value); - } + $currentTable->addColumn($name, $value); } } // if the exit_action was not recorded properly in the log_link_visit_action // there would be an error message when getting the nb_hits column // we must fake the record and add the columns - if($currentTable->getColumn('nb_hits') === false) + if($currentTable->getColumn(Piwik_Archive::INDEX_PAGE_NB_HITS) === false) { // to test this code: delete the entries in log_link_action_visit for // a given exit_idaction_url @@ -550,6 +504,71 @@ class Piwik_Actions extends Piwik_Plugin $currentTable =& $this->actionsTablesByType; return $rowsProcessed; } + + /** + * Given a page name and type, builds a recursive datatable where + * each level of the tree is a category, based on the page name split by a delimiter (slash / by default) + * + * @param $actionName + * @param $actionType + * @return Piwik_DataTable + */ + protected function parseActionNameCategoriesInDataTable($actionName, $actionType) + { + // we work on the root table of the given TYPE (either ACTION_URL or DOWNLOAD or OUTLINK etc.) + $currentTable =& $this->actionsTablesByType[$actionType]; + // go to the level of the subcategory + $actionExplodedNames = $this->getActionExplodedNames($actionName, $actionType); + $end = count($actionExplodedNames)-1; + for($level = 0 ; $level < $end; $level++) + { + $actionCategory = $actionExplodedNames[$level]; + $currentTable =& $currentTable[$actionCategory]; + } + $actionShortName = $actionExplodedNames[$end]; + + // we are careful to prefix the page URL / name with some value + // so that if a page has the same name as a category + // we don't merge both entries + if($actionType == Piwik_Tracker_Action::TYPE_ACTION_URL ) + { + $actionShortName = '/' . $actionShortName; + } + else + { + $actionShortName = ' ' . $actionShortName; + } + + // currentTable is now the array element corresponding the the action + // at this point we may be for example at the 4th level of depth in the hierarchy + $currentTable =& $currentTable[$actionShortName]; + + // add the row to the matching sub category subtable + if(!($currentTable instanceof Piwik_DataTable_Row)) + { + $defaultColumnsNewRow = array( + 'label' => (string)$actionShortName, + Piwik_Archive::INDEX_NB_VISITS => 0, + Piwik_Archive::INDEX_NB_UNIQ_VISITORS => 0, + Piwik_Archive::INDEX_PAGE_NB_HITS => 0, + Piwik_Archive::INDEX_PAGE_SUM_TIME_SPENT => 0, + ); + if( $actionType == Piwik_Tracker_Action::TYPE_ACTION_NAME ) + { + $currentTable = new Piwik_DataTable_Row(array( + Piwik_DataTable_Row::COLUMNS => $defaultColumnsNewRow, + )); + } + else + { + $currentTable = new Piwik_DataTable_Row(array( + Piwik_DataTable_Row::COLUMNS => $defaultColumnsNewRow, + Piwik_DataTable_Row::METADATA => array('url' => (string)$actionName), + )); + } + } + return $currentTable; + } } diff --git a/plugins/Actions/Controller.php b/plugins/Actions/Controller.php index 6e778753a48b2d13a3c5f76ec06100c2d9add123..65e0ef4a72b8e9911941009875bfcae482a0f36e 100644 --- a/plugins/Actions/Controller.php +++ b/plugins/Actions/Controller.php @@ -33,7 +33,7 @@ class Piwik_Actions_Controller extends Piwik_Controller public function getPageUrls($fetch = false) { $view = $this->getPageUrlsView(__FUNCTION__, 'getPageUrlsSubDataTable'); - $this->configureViewPageUrls($view); + $this->configureViewPages($view); $this->configureViewActions($view); return $this->renderView($view, $fetch); } @@ -41,12 +41,12 @@ class Piwik_Actions_Controller extends Piwik_Controller public function getPageUrlsSubDataTable($fetch = false) { $view = $this->getPageUrlsView(__FUNCTION__, 'getPageUrlsSubDataTable'); - $this->configureViewPageUrls($view); + $this->configureViewPages($view); $this->configureViewActions($view); return $this->renderView($view, $fetch); } - protected function configureViewPageUrls($view) + protected function configureViewPages($view) { $view->setColumnsToDisplay( array('label','nb_hits','nb_visits', 'bounce_rate', 'avg_time_on_page', 'exit_rate') ); } @@ -110,7 +110,7 @@ class Piwik_Actions_Controller extends Piwik_Controller 'Actions.getPageTitles', 'getPageTitlesSubDataTable' ); $view->setColumnTranslation('label', Piwik_Translate('Actions_ColumnPageName')); - $this->configureViewPageTitles($view); + $this->configureViewPages($view); $this->configureViewActions($view); return $this->renderView($view, $fetch); } @@ -122,15 +122,11 @@ class Piwik_Actions_Controller extends Piwik_Controller __FUNCTION__, 'Actions.getPageTitles', 'getPageTitlesSubDataTable' ); - $this->configureViewPageTitles($view); + $this->configureViewPages($view); $this->configureViewActions($view); return $this->renderView($view, $fetch); } - protected function configureViewPageTitles($view) - { - $view->setColumnsToDisplay( array('label','nb_hits','nb_visits') ); - } public function getDownloads($fetch = false) { diff --git a/tests/core/Database.test.php b/tests/core/Database.test.php index 71112af18e671c17dd36736d81b90edb68b81223..2e7f05f741a814cad3fd79a24836001f22659454 100644 --- a/tests/core/Database.test.php +++ b/tests/core/Database.test.php @@ -51,6 +51,7 @@ class Test_Database extends UnitTestCase Piwik_Option::getInstance()->clearCache(); Piwik_Common::deleteAllCache(); Piwik::truncateAllTables(); + Piwik_Archive::clearCache(); } public function testHelloWorld() diff --git a/tests/integration/Main.test.php b/tests/integration/Main.test.php index 9bb57833564e1a46f01a0584c277c043f60f918c..7da869f7d8bd9780d3d2ca002cc032e8ee646d7e 100644 --- a/tests/integration/Main.test.php +++ b/tests/integration/Main.test.php @@ -155,7 +155,6 @@ class Test_Piwik_Integration_Main extends Test_Integration private function doTest_oneVisitorTwoVisits($t, $dateTime, $idSite ) { - $t->setUrlReferer( 'http://referer.com/page.htm?param=valuewith some spaces'); // Testing URL excluded parameters diff --git a/tests/integration/expected/test_OneVisitorTwoVisits__API.getDefaultMetrics.xml b/tests/integration/expected/test_OneVisitorTwoVisits__API.getDefaultMetrics.xml deleted file mode 100644 index 1d9a75fd9e7ddb0b779aaec144c50f2851636dc0..0000000000000000000000000000000000000000 --- a/tests/integration/expected/test_OneVisitorTwoVisits__API.getDefaultMetrics.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> -<result> - <row> - <nb_uniq_visitors>Unique visitors</nb_uniq_visitors> - <nb_visits>Visits</nb_visits> - <nb_actions>Actions</nb_actions> - <nb_visits_converted>Visits with Conversions</nb_visits_converted> - </row> -</result> \ No newline at end of file diff --git a/tests/integration/expected/test_OneVisitorTwoVisits__API.getDefaultProcessedMetrics.xml b/tests/integration/expected/test_OneVisitorTwoVisits__API.getDefaultProcessedMetrics.xml deleted file mode 100644 index 756ba342eda97ba32b30e6a82aae569bef7e3b37..0000000000000000000000000000000000000000 --- a/tests/integration/expected/test_OneVisitorTwoVisits__API.getDefaultProcessedMetrics.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> -<result> - <row> - <nb_actions_per_visit>Actions per Visit</nb_actions_per_visit> - <avg_time_on_site>Avg. Time on Website</avg_time_on_site> - <bounce_rate>Bounce Rate</bounce_rate> - </row> -</result> \ No newline at end of file diff --git a/tests/integration/expected/test_OneVisitorTwoVisits__Actions.getPageTitles_day.xml b/tests/integration/expected/test_OneVisitorTwoVisits__Actions.getPageTitles_day.xml index 0209764379a23eaba7e5ed9b4475c53508592cb0..d0e216355cf57a816e4e6eae1ac9f1c990d0e526 100644 --- a/tests/integration/expected/test_OneVisitorTwoVisits__Actions.getPageTitles_day.xml +++ b/tests/integration/expected/test_OneVisitorTwoVisits__Actions.getPageTitles_day.xml @@ -5,23 +5,53 @@ <nb_visits>1</nb_visits> <nb_uniq_visitors>1</nb_uniq_visitors> <nb_hits>1</nb_hits> + <sum_time_spent>0</sum_time_spent> + <entry_nb_uniq_visitors>1</entry_nb_uniq_visitors> + <entry_nb_visits>1</entry_nb_visits> + <entry_nb_actions>1</entry_nb_actions> + <entry_sum_visit_length>0</entry_sum_visit_length> + <entry_bounce_count>1</entry_bounce_count> + <exit_nb_uniq_visitors>1</exit_nb_uniq_visitors> + <exit_nb_visits>1</exit_nb_visits> + <avg_time_on_page>0</avg_time_on_page> + <bounce_rate>100%</bounce_rate> + <exit_rate>100%</exit_rate> </row> <row> <label> Looking at homepage (again)...</label> <nb_visits>1</nb_visits> <nb_uniq_visitors>1</nb_uniq_visitors> <nb_hits>1</nb_hits> + <sum_time_spent>0</sum_time_spent> + <exit_nb_uniq_visitors>1</exit_nb_uniq_visitors> + <exit_nb_visits>1</exit_nb_visits> + <avg_time_on_page>0</avg_time_on_page> + <bounce_rate>0%</bounce_rate> + <exit_rate>100%</exit_rate> </row> <row> <label> Second page view - should be registered as URL</label> <nb_visits>1</nb_visits> <nb_uniq_visitors>1</nb_uniq_visitors> <nb_hits>1</nb_hits> + <sum_time_spent>720</sum_time_spent> + <avg_time_on_page>720</avg_time_on_page> + <bounce_rate>0%</bounce_rate> + <exit_rate>0%</exit_rate> </row> <row> <label> incredible title!</label> <nb_visits>1</nb_visits> <nb_uniq_visitors>1</nb_uniq_visitors> <nb_hits>1</nb_hits> + <sum_time_spent>180</sum_time_spent> + <entry_nb_uniq_visitors>1</entry_nb_uniq_visitors> + <entry_nb_visits>1</entry_nb_visits> + <entry_nb_actions>5</entry_nb_actions> + <entry_sum_visit_length>1620</entry_sum_visit_length> + <entry_bounce_count>0</entry_bounce_count> + <avg_time_on_page>180</avg_time_on_page> + <bounce_rate>0%</bounce_rate> + <exit_rate>0%</exit_rate> </row> </result> \ No newline at end of file diff --git a/tests/integration/expected/test_OneVisitorTwoVisits__Provider.getProvider_day.xml b/tests/integration/expected/test_OneVisitorTwoVisits__Provider.getProvider_day.xml index c3463943a39bc057699550a2269b9be4eeedaadd..2d6f16b917dabf47b3c4b8fcf689fd1d36b45f38 100644 --- a/tests/integration/expected/test_OneVisitorTwoVisits__Provider.getProvider_day.xml +++ b/tests/integration/expected/test_OneVisitorTwoVisits__Provider.getProvider_day.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" ?> <result> <row> - <label>IP</label> + <label>Unknown</label> <nb_uniq_visitors>1</nb_uniq_visitors> <nb_visits>2</nb_visits> <nb_actions>6</nb_actions> diff --git a/tests/integration/expected/test_OneVisitorTwoVisits__VisitFrequency.getMaxActionsReturning_day.xml b/tests/integration/expected/test_OneVisitorTwoVisits__VisitFrequency.getMaxActionsReturning_day.xml deleted file mode 100644 index 606fbb524182170284d7f1baad7fce4697d9b8b3..0000000000000000000000000000000000000000 --- a/tests/integration/expected/test_OneVisitorTwoVisits__VisitFrequency.getMaxActionsReturning_day.xml +++ /dev/null @@ -1,2 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> -<result>1</result> \ No newline at end of file diff --git a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getDownloads_day.xml b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getDownloads_day.xml index c234bed59e963e268d7a9bc05348d941758c4aa9..48775fd2e489ccd6b409b579acef8e0601451930 100644 --- a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getDownloads_day.xml +++ b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getDownloads_day.xml @@ -1,2 +1,19 @@ <?xml version="1.0" encoding="utf-8" ?> -<result /> \ No newline at end of file +<result> + <row> + <label>piwik.org</label> + <nb_visits>1</nb_visits> + <nb_hits>1</nb_hits> + <sum_time_spent>180</sum_time_spent> + <subtable> + <row> + <label> /latest.zip</label> + <nb_visits>1</nb_visits> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_hits>1</nb_hits> + <sum_time_spent>180</sum_time_spent> + <url>http://piwik.org/latest.zip</url> + </row> + </subtable> + </row> +</result> \ No newline at end of file diff --git a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getOutlinks_day.xml b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getOutlinks_day.xml index c234bed59e963e268d7a9bc05348d941758c4aa9..2175803fa404241e5d12d5e2d7eb15e4a19d4164 100644 --- a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getOutlinks_day.xml +++ b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getOutlinks_day.xml @@ -1,2 +1,19 @@ <?xml version="1.0" encoding="utf-8" ?> -<result /> \ No newline at end of file +<result> + <row> + <label>dev.piwik.org</label> + <nb_visits>1</nb_visits> + <nb_hits>1</nb_hits> + <sum_time_spent>360</sum_time_spent> + <subtable> + <row> + <label> /svn</label> + <nb_visits>1</nb_visits> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_hits>1</nb_hits> + <sum_time_spent>360</sum_time_spent> + <url>http://dev.piwik.org/svn</url> + </row> + </subtable> + </row> +</result> \ No newline at end of file diff --git a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageTitles_day.xml b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageTitles_day.xml index c234bed59e963e268d7a9bc05348d941758c4aa9..d0e216355cf57a816e4e6eae1ac9f1c990d0e526 100644 --- a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageTitles_day.xml +++ b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageTitles_day.xml @@ -1,2 +1,57 @@ <?xml version="1.0" encoding="utf-8" ?> -<result /> \ No newline at end of file +<result> + <row> + <label> Purchasing...</label> + <nb_visits>1</nb_visits> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_hits>1</nb_hits> + <sum_time_spent>0</sum_time_spent> + <entry_nb_uniq_visitors>1</entry_nb_uniq_visitors> + <entry_nb_visits>1</entry_nb_visits> + <entry_nb_actions>1</entry_nb_actions> + <entry_sum_visit_length>0</entry_sum_visit_length> + <entry_bounce_count>1</entry_bounce_count> + <exit_nb_uniq_visitors>1</exit_nb_uniq_visitors> + <exit_nb_visits>1</exit_nb_visits> + <avg_time_on_page>0</avg_time_on_page> + <bounce_rate>100%</bounce_rate> + <exit_rate>100%</exit_rate> + </row> + <row> + <label> Looking at homepage (again)...</label> + <nb_visits>1</nb_visits> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_hits>1</nb_hits> + <sum_time_spent>0</sum_time_spent> + <exit_nb_uniq_visitors>1</exit_nb_uniq_visitors> + <exit_nb_visits>1</exit_nb_visits> + <avg_time_on_page>0</avg_time_on_page> + <bounce_rate>0%</bounce_rate> + <exit_rate>100%</exit_rate> + </row> + <row> + <label> Second page view - should be registered as URL</label> + <nb_visits>1</nb_visits> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_hits>1</nb_hits> + <sum_time_spent>720</sum_time_spent> + <avg_time_on_page>720</avg_time_on_page> + <bounce_rate>0%</bounce_rate> + <exit_rate>0%</exit_rate> + </row> + <row> + <label> incredible title!</label> + <nb_visits>1</nb_visits> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_hits>1</nb_hits> + <sum_time_spent>180</sum_time_spent> + <entry_nb_uniq_visitors>1</entry_nb_uniq_visitors> + <entry_nb_visits>1</entry_nb_visits> + <entry_nb_actions>5</entry_nb_actions> + <entry_sum_visit_length>1620</entry_sum_visit_length> + <entry_bounce_count>0</entry_bounce_count> + <avg_time_on_page>180</avg_time_on_page> + <bounce_rate>0%</bounce_rate> + <exit_rate>0%</exit_rate> + </row> +</result> \ No newline at end of file diff --git a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Provider.getProvider_day.xml b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Provider.getProvider_day.xml index c234bed59e963e268d7a9bc05348d941758c4aa9..2d6f16b917dabf47b3c4b8fcf689fd1d36b45f38 100644 --- a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Provider.getProvider_day.xml +++ b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Provider.getProvider_day.xml @@ -1,2 +1,14 @@ <?xml version="1.0" encoding="utf-8" ?> -<result /> \ No newline at end of file +<result> + <row> + <label>Unknown</label> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_visits>2</nb_visits> + <nb_actions>6</nb_actions> + <max_actions>5</max_actions> + <sum_visit_length>1620</sum_visit_length> + <bounce_count>1</bounce_count> + <nb_visits_converted>2</nb_visits_converted> + <url>http://piwik.org/faq/general/#faq_52</url> + </row> +</result> \ No newline at end of file diff --git a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referers.getKeywords_day.xml b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referers.getKeywords_day.xml index c234bed59e963e268d7a9bc05348d941758c4aa9..c38aef473be5eee132548498a3aa49004f4f2382 100644 --- a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referers.getKeywords_day.xml +++ b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referers.getKeywords_day.xml @@ -1,2 +1,33 @@ <?xml version="1.0" encoding="utf-8" ?> -<result /> \ No newline at end of file +<result> + <row> + <label>purchase</label> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_visits>1</nb_visits> + <nb_actions>1</nb_actions> + <max_actions>1</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>1</bounce_count> + <nb_visits_converted>1</nb_visits_converted> + <goals> + <row idgoal='2'> + <nb_conversions>1</nb_conversions> + <revenue>1</revenue> + </row> + </goals> + <nb_conversions>1</nb_conversions> + <revenue>1</revenue> + <subtable> + <row> + <label>Yahoo!</label> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_visits>1</nb_visits> + <nb_actions>1</nb_actions> + <max_actions>1</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>1</bounce_count> + <nb_visits_converted>1</nb_visits_converted> + </row> + </subtable> + </row> +</result> \ No newline at end of file diff --git a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referers.getRefererType_day.xml b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referers.getRefererType_day.xml index c234bed59e963e268d7a9bc05348d941758c4aa9..72052794273865cdde10f53ead1411e0a62a03b2 100644 --- a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referers.getRefererType_day.xml +++ b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referers.getRefererType_day.xml @@ -1,2 +1,39 @@ <?xml version="1.0" encoding="utf-8" ?> -<result /> \ No newline at end of file +<result> + <row> + <label>Websites</label> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_visits>1</nb_visits> + <nb_actions>5</nb_actions> + <max_actions>5</max_actions> + <sum_visit_length>1620</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>1</nb_visits_converted> + <goals> + <row idgoal='1'> + <nb_conversions>1</nb_conversions> + <revenue>42</revenue> + </row> + </goals> + <nb_conversions>1</nb_conversions> + <revenue>42</revenue> + </row> + <row> + <label>Search Engines</label> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_visits>1</nb_visits> + <nb_actions>1</nb_actions> + <max_actions>1</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>1</bounce_count> + <nb_visits_converted>1</nb_visits_converted> + <goals> + <row idgoal='2'> + <nb_conversions>1</nb_conversions> + <revenue>1</revenue> + </row> + </goals> + <nb_conversions>1</nb_conversions> + <revenue>1</revenue> + </row> +</result> \ No newline at end of file diff --git a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referers.getSearchEngines_day.xml b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referers.getSearchEngines_day.xml index c234bed59e963e268d7a9bc05348d941758c4aa9..284b5f7bab3ecd2640df3ddcf23a12a8f85b59f9 100644 --- a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referers.getSearchEngines_day.xml +++ b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referers.getSearchEngines_day.xml @@ -1,2 +1,35 @@ <?xml version="1.0" encoding="utf-8" ?> -<result /> \ No newline at end of file +<result> + <row> + <label>Yahoo!</label> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_visits>1</nb_visits> + <nb_actions>1</nb_actions> + <max_actions>1</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>1</bounce_count> + <nb_visits_converted>1</nb_visits_converted> + <goals> + <row idgoal='2'> + <nb_conversions>1</nb_conversions> + <revenue>1</revenue> + </row> + </goals> + <nb_conversions>1</nb_conversions> + <revenue>1</revenue> + <url>http://search.yahoo.com</url> + <logo>plugins/Referers/images/searchEngines/search.yahoo.com.png</logo> + <subtable> + <row> + <label>purchase</label> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_visits>1</nb_visits> + <nb_actions>1</nb_actions> + <max_actions>1</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>1</bounce_count> + <nb_visits_converted>1</nb_visits_converted> + </row> + </subtable> + </row> +</result> \ No newline at end of file diff --git a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referers.getWebsites_day.xml b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referers.getWebsites_day.xml index c234bed59e963e268d7a9bc05348d941758c4aa9..734e6bdaebde724f79f101bbe443b01cbb61e79b 100644 --- a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referers.getWebsites_day.xml +++ b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referers.getWebsites_day.xml @@ -1,2 +1,33 @@ <?xml version="1.0" encoding="utf-8" ?> -<result /> \ No newline at end of file +<result> + <row> + <label>referer.com</label> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_visits>1</nb_visits> + <nb_actions>5</nb_actions> + <max_actions>5</max_actions> + <sum_visit_length>1620</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>1</nb_visits_converted> + <goals> + <row idgoal='1'> + <nb_conversions>1</nb_conversions> + <revenue>42</revenue> + </row> + </goals> + <nb_conversions>1</nb_conversions> + <revenue>42</revenue> + <subtable> + <row> + <label>http://referer.com/page.htm?param=valuewith some spaces</label> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_visits>1</nb_visits> + <nb_actions>5</nb_actions> + <max_actions>5</max_actions> + <sum_visit_length>1620</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>1</nb_visits_converted> + </row> + </subtable> + </row> +</result> \ No newline at end of file diff --git a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getContinent_day.xml b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getContinent_day.xml index c234bed59e963e268d7a9bc05348d941758c4aa9..393107f702aa0af6584549ab0db52b73af7f7418 100644 --- a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getContinent_day.xml +++ b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getContinent_day.xml @@ -1,2 +1,26 @@ <?xml version="1.0" encoding="utf-8" ?> -<result /> \ No newline at end of file +<result> + <row> + <label>Europe</label> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_visits>2</nb_visits> + <nb_actions>6</nb_actions> + <max_actions>5</max_actions> + <sum_visit_length>1620</sum_visit_length> + <bounce_count>1</bounce_count> + <nb_visits_converted>2</nb_visits_converted> + <goals> + <row idgoal='1'> + <nb_conversions>1</nb_conversions> + <revenue>42</revenue> + </row> + <row idgoal='2'> + <nb_conversions>1</nb_conversions> + <revenue>1</revenue> + </row> + </goals> + <nb_conversions>2</nb_conversions> + <revenue>43</revenue> + <code>Europe</code> + </row> +</result> \ No newline at end of file diff --git a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getCountry_day.xml b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getCountry_day.xml index c234bed59e963e268d7a9bc05348d941758c4aa9..94cb9ec7253a9a84e8bd91df19a551dfb196a402 100644 --- a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getCountry_day.xml +++ b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getCountry_day.xml @@ -1,2 +1,29 @@ <?xml version="1.0" encoding="utf-8" ?> -<result /> \ No newline at end of file +<result> + <row> + <label>France</label> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_visits>2</nb_visits> + <nb_actions>6</nb_actions> + <max_actions>5</max_actions> + <sum_visit_length>1620</sum_visit_length> + <bounce_count>1</bounce_count> + <nb_visits_converted>2</nb_visits_converted> + <goals> + <row idgoal='1'> + <nb_conversions>1</nb_conversions> + <revenue>42</revenue> + </row> + <row idgoal='2'> + <nb_conversions>1</nb_conversions> + <revenue>1</revenue> + </row> + </goals> + <nb_conversions>2</nb_conversions> + <revenue>43</revenue> + <code>fr</code> + <logo>plugins/UserCountry/flags/fr.png</logo> + <logoWidth>18</logoWidth> + <logoHeight>12</logoHeight> + </row> +</result> \ No newline at end of file diff --git a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getBrowserType_day.xml b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getBrowserType_day.xml index c234bed59e963e268d7a9bc05348d941758c4aa9..2f6e189d1f14136f2af113a153c4efdb0441237c 100644 --- a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getBrowserType_day.xml +++ b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getBrowserType_day.xml @@ -1,2 +1,14 @@ <?xml version="1.0" encoding="utf-8" ?> -<result /> \ No newline at end of file +<result> + <row> + <label>Gecko (Firefox)</label> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_visits>2</nb_visits> + <nb_actions>6</nb_actions> + <max_actions>5</max_actions> + <sum_visit_length>1620</sum_visit_length> + <bounce_count>1</bounce_count> + <nb_visits_converted>2</nb_visits_converted> + <shortLabel>Gecko</shortLabel> + </row> +</result> \ No newline at end of file diff --git a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getBrowser_day.xml b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getBrowser_day.xml index c234bed59e963e268d7a9bc05348d941758c4aa9..2ba9268dd3c10c27c7200176af55f833e1c2ad2e 100644 --- a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getBrowser_day.xml +++ b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getBrowser_day.xml @@ -1,2 +1,15 @@ <?xml version="1.0" encoding="utf-8" ?> -<result /> \ No newline at end of file +<result> + <row> + <label>Firefox 3.6</label> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_visits>2</nb_visits> + <nb_actions>6</nb_actions> + <max_actions>5</max_actions> + <sum_visit_length>1620</sum_visit_length> + <bounce_count>1</bounce_count> + <nb_visits_converted>2</nb_visits_converted> + <logo>plugins/UserSettings/images/browsers/FF.gif</logo> + <shortLabel>Firefox 3.6</shortLabel> + </row> +</result> \ No newline at end of file diff --git a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getConfiguration_day.xml b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getConfiguration_day.xml index c234bed59e963e268d7a9bc05348d941758c4aa9..a7f2e6f95c9f5b41073996d90ad339a17d90adff 100644 --- a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getConfiguration_day.xml +++ b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getConfiguration_day.xml @@ -1,2 +1,13 @@ <?xml version="1.0" encoding="utf-8" ?> -<result /> \ No newline at end of file +<result> + <row> + <label>Windows XP / Firefox / 1024x768</label> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_visits>2</nb_visits> + <nb_actions>6</nb_actions> + <max_actions>5</max_actions> + <sum_visit_length>1620</sum_visit_length> + <bounce_count>1</bounce_count> + <nb_visits_converted>2</nb_visits_converted> + </row> +</result> \ No newline at end of file diff --git a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getOS_day.xml b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getOS_day.xml index c234bed59e963e268d7a9bc05348d941758c4aa9..3ba193b47439329ca79864dd626512a5b83dd7e7 100644 --- a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getOS_day.xml +++ b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getOS_day.xml @@ -1,2 +1,15 @@ <?xml version="1.0" encoding="utf-8" ?> -<result /> \ No newline at end of file +<result> + <row> + <label>Windows XP</label> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_visits>2</nb_visits> + <nb_actions>6</nb_actions> + <max_actions>5</max_actions> + <sum_visit_length>1620</sum_visit_length> + <bounce_count>1</bounce_count> + <nb_visits_converted>2</nb_visits_converted> + <logo>plugins/UserSettings/images/os/WXP.gif</logo> + <shortLabel>Win XP</shortLabel> + </row> +</result> \ No newline at end of file diff --git a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getPlugin_day.xml b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getPlugin_day.xml index c234bed59e963e268d7a9bc05348d941758c4aa9..1569715a9e72163e8c7345958f28f93c1f379526 100644 --- a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getPlugin_day.xml +++ b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getPlugin_day.xml @@ -1,2 +1,63 @@ <?xml version="1.0" encoding="utf-8" ?> -<result /> \ No newline at end of file +<result> + <row> + <label>Cookie</label> + <nb_visits>2</nb_visits> + <nb_visits_percentage>100%</nb_visits_percentage> + <logo>plugins/UserSettings/images/plugins/cookie.gif</logo> + </row> + <row> + <label>Java</label> + <nb_visits>2</nb_visits> + <nb_visits_percentage>100%</nb_visits_percentage> + <logo>plugins/UserSettings/images/plugins/java.gif</logo> + </row> + <row> + <label>Flash</label> + <nb_visits>2</nb_visits> + <nb_visits_percentage>100%</nb_visits_percentage> + <logo>plugins/UserSettings/images/plugins/flash.gif</logo> + </row> + <row> + <label>Gears</label> + <nb_visits>0</nb_visits> + <nb_visits_percentage>0%</nb_visits_percentage> + <logo>plugins/UserSettings/images/plugins/gears.gif</logo> + </row> + <row> + <label>Silverlight</label> + <nb_visits>0</nb_visits> + <nb_visits_percentage>0%</nb_visits_percentage> + <logo>plugins/UserSettings/images/plugins/silverlight.gif</logo> + </row> + <row> + <label>Windowsmedia</label> + <nb_visits>0</nb_visits> + <nb_visits_percentage>0%</nb_visits_percentage> + <logo>plugins/UserSettings/images/plugins/windowsmedia.gif</logo> + </row> + <row> + <label>Quicktime</label> + <nb_visits>0</nb_visits> + <nb_visits_percentage>0%</nb_visits_percentage> + <logo>plugins/UserSettings/images/plugins/quicktime.gif</logo> + </row> + <row> + <label>Director</label> + <nb_visits>0</nb_visits> + <nb_visits_percentage>0%</nb_visits_percentage> + <logo>plugins/UserSettings/images/plugins/director.gif</logo> + </row> + <row> + <label>Pdf</label> + <nb_visits>0</nb_visits> + <nb_visits_percentage>0%</nb_visits_percentage> + <logo>plugins/UserSettings/images/plugins/pdf.gif</logo> + </row> + <row> + <label>Realplayer</label> + <nb_visits>0</nb_visits> + <nb_visits_percentage>0%</nb_visits_percentage> + <logo>plugins/UserSettings/images/plugins/realplayer.gif</logo> + </row> +</result> \ No newline at end of file diff --git a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getResolution_day.xml b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getResolution_day.xml index c234bed59e963e268d7a9bc05348d941758c4aa9..e1d16378ff4f4d17c6703acb4447ba334288b843 100644 --- a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getResolution_day.xml +++ b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getResolution_day.xml @@ -1,2 +1,13 @@ <?xml version="1.0" encoding="utf-8" ?> -<result /> \ No newline at end of file +<result> + <row> + <label>1024x768</label> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_visits>2</nb_visits> + <nb_actions>6</nb_actions> + <max_actions>5</max_actions> + <sum_visit_length>1620</sum_visit_length> + <bounce_count>1</bounce_count> + <nb_visits_converted>2</nb_visits_converted> + </row> +</result> \ No newline at end of file diff --git a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getWideScreen_day.xml b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getWideScreen_day.xml index c234bed59e963e268d7a9bc05348d941758c4aa9..a998ee581338bfa219ba56850840956e27834813 100644 --- a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getWideScreen_day.xml +++ b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getWideScreen_day.xml @@ -1,2 +1,14 @@ <?xml version="1.0" encoding="utf-8" ?> -<result /> \ No newline at end of file +<result> + <row> + <label>Normal</label> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_visits>2</nb_visits> + <nb_actions>6</nb_actions> + <max_actions>5</max_actions> + <sum_visit_length>1620</sum_visit_length> + <bounce_count>1</bounce_count> + <nb_visits_converted>2</nb_visits_converted> + <logo>plugins/UserSettings/images/screens/normal.gif</logo> + </row> +</result> \ No newline at end of file diff --git a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitTime.getVisitInformationPerLocalTime_day.xml b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitTime.getVisitInformationPerLocalTime_day.xml index c234bed59e963e268d7a9bc05348d941758c4aa9..cdb1d827a4e7e428a856e46833c7d6b7f54b92f2 100644 --- a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitTime.getVisitInformationPerLocalTime_day.xml +++ b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitTime.getVisitInformationPerLocalTime_day.xml @@ -1,2 +1,243 @@ <?xml version="1.0" encoding="utf-8" ?> -<result /> \ No newline at end of file +<result> + <row> + <label>0h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>1h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>2h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>3h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>4h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>5h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>6h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>7h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>8h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>9h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>10h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>11h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>12h</label> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_visits>2</nb_visits> + <nb_actions>6</nb_actions> + <max_actions>5</max_actions> + <sum_visit_length>1620</sum_visit_length> + <bounce_count>1</bounce_count> + <nb_visits_converted>2</nb_visits_converted> + </row> + <row> + <label>13h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>14h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>15h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>16h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>17h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>18h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>19h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>20h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>21h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>22h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>23h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> +</result> \ No newline at end of file diff --git a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitTime.getVisitInformationPerServerTime_day.xml b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitTime.getVisitInformationPerServerTime_day.xml index c234bed59e963e268d7a9bc05348d941758c4aa9..59c1da9fbc6e92f05f197cffd9a95a5f896d75e8 100644 --- a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitTime.getVisitInformationPerServerTime_day.xml +++ b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitTime.getVisitInformationPerServerTime_day.xml @@ -1,2 +1,259 @@ <?xml version="1.0" encoding="utf-8" ?> -<result /> \ No newline at end of file +<result> + <row> + <label>0h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>1h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>2h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>3h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>4h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>5h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>6h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>7h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>8h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>9h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>10h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>11h</label> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_visits>1</nb_visits> + <nb_actions>5</nb_actions> + <max_actions>5</max_actions> + <sum_visit_length>1620</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>1</nb_visits_converted> + <goals> + <row idgoal='1'> + <nb_conversions>1</nb_conversions> + <revenue>42</revenue> + </row> + </goals> + <nb_conversions>1</nb_conversions> + <revenue>42</revenue> + </row> + <row> + <label>12h</label> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_visits>1</nb_visits> + <nb_actions>1</nb_actions> + <max_actions>1</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>1</bounce_count> + <nb_visits_converted>1</nb_visits_converted> + <goals> + <row idgoal='2'> + <nb_conversions>1</nb_conversions> + <revenue>1</revenue> + </row> + </goals> + <nb_conversions>1</nb_conversions> + <revenue>1</revenue> + </row> + <row> + <label>13h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>14h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>15h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>16h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>17h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>18h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>19h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>20h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>21h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>22h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> + <row> + <label>23h</label> + <nb_uniq_visitors>0</nb_uniq_visitors> + <nb_visits>0</nb_visits> + <nb_actions>0</nb_actions> + <max_actions>0</max_actions> + <sum_visit_length>0</sum_visit_length> + <bounce_count>0</bounce_count> + <nb_visits_converted>0</nb_visits_converted> + </row> +</result> \ No newline at end of file diff --git a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitorInterest.getNumberOfVisitsPerPage_day.xml b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitorInterest.getNumberOfVisitsPerPage_day.xml index c234bed59e963e268d7a9bc05348d941758c4aa9..4f59550d968ffd99bf38412275948adce832bd43 100644 --- a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitorInterest.getNumberOfVisitsPerPage_day.xml +++ b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitorInterest.getNumberOfVisitsPerPage_day.xml @@ -1,2 +1,43 @@ <?xml version="1.0" encoding="utf-8" ?> -<result /> \ No newline at end of file +<result> + <row> + <label>1 page</label> + <nb_visits>1</nb_visits> + </row> + <row> + <label>2 pages</label> + <nb_visits>0</nb_visits> + </row> + <row> + <label>3 pages</label> + <nb_visits>0</nb_visits> + </row> + <row> + <label>4 pages</label> + <nb_visits>0</nb_visits> + </row> + <row> + <label>5 pages</label> + <nb_visits>1</nb_visits> + </row> + <row> + <label>6-7 pages</label> + <nb_visits>0</nb_visits> + </row> + <row> + <label>8-10 pages</label> + <nb_visits>0</nb_visits> + </row> + <row> + <label>11-14 pages</label> + <nb_visits>0</nb_visits> + </row> + <row> + <label>15-20 pages</label> + <nb_visits>0</nb_visits> + </row> + <row> + <label>20+ pages</label> + <nb_visits>0</nb_visits> + </row> +</result> \ No newline at end of file diff --git a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitorInterest.getNumberOfVisitsPerVisitDuration_day.xml b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitorInterest.getNumberOfVisitsPerVisitDuration_day.xml index c234bed59e963e268d7a9bc05348d941758c4aa9..f1b460acf692bf4942f835e58915ff27259069be 100644 --- a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitorInterest.getNumberOfVisitsPerVisitDuration_day.xml +++ b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitorInterest.getNumberOfVisitsPerVisitDuration_day.xml @@ -1,2 +1,39 @@ <?xml version="1.0" encoding="utf-8" ?> -<result /> \ No newline at end of file +<result> + <row> + <label>0-30s</label> + <nb_visits>1</nb_visits> + </row> + <row> + <label>30-60s</label> + <nb_visits>0</nb_visits> + </row> + <row> + <label>1-2 min</label> + <nb_visits>0</nb_visits> + </row> + <row> + <label>2-4 min</label> + <nb_visits>0</nb_visits> + </row> + <row> + <label>4-6 min</label> + <nb_visits>0</nb_visits> + </row> + <row> + <label>6-8 min</label> + <nb_visits>0</nb_visits> + </row> + <row> + <label>8-11 min</label> + <nb_visits>0</nb_visits> + </row> + <row> + <label>11-15 min</label> + <nb_visits>0</nb_visits> + </row> + <row> + <label>15+ min</label> + <nb_visits>1</nb_visits> + </row> +</result> \ No newline at end of file diff --git a/tests/integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_day.xml b/tests/integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_day.xml index 59d41116ed2b87c9ffa5dd41cd645049cfed7d6c..5c2aa61118f852da4687ebe25ebba12672685d25 100644 --- a/tests/integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_day.xml +++ b/tests/integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_day.xml @@ -7,17 +7,36 @@ <nb_visits>2</nb_visits> <nb_uniq_visitors>2</nb_uniq_visitors> <nb_hits>2</nb_hits> + <sum_time_spent>360</sum_time_spent> + <entry_nb_uniq_visitors>2</entry_nb_uniq_visitors> + <entry_nb_visits>2</entry_nb_visits> + <entry_nb_actions>3</entry_nb_actions> + <entry_sum_visit_length>360</entry_sum_visit_length> + <entry_bounce_count>1</entry_bounce_count> + <exit_nb_uniq_visitors>1</exit_nb_uniq_visitors> + <exit_nb_visits>1</exit_nb_visits> + <avg_time_on_page>180</avg_time_on_page> + <bounce_rate>50%</bounce_rate> + <exit_rate>50%</exit_rate> </row> <row> <label>first visitor</label> <nb_visits>1</nb_visits> <nb_hits>1</nb_hits> + <sum_time_spent>0</sum_time_spent> + <exit_nb_visits>1</exit_nb_visits> + <avg_time_on_page>0</avg_time_on_page> + <bounce_rate>0%</bounce_rate> + <exit_rate>100%</exit_rate> <subtable> <row> <label> second page view</label> <nb_visits>1</nb_visits> <nb_uniq_visitors>1</nb_uniq_visitors> <nb_hits>1</nb_hits> + <sum_time_spent>0</sum_time_spent> + <exit_nb_uniq_visitors>1</exit_nb_uniq_visitors> + <exit_nb_visits>1</exit_nb_visits> </row> </subtable> </row> @@ -28,23 +47,47 @@ <label>second visitor</label> <nb_visits>2</nb_visits> <nb_hits>2</nb_hits> + <sum_time_spent>360</sum_time_spent> + <entry_nb_visits>1</entry_nb_visits> + <entry_nb_actions>2</entry_nb_actions> + <entry_sum_visit_length>360</entry_sum_visit_length> + <entry_bounce_count>0</entry_bounce_count> + <exit_nb_visits>1</exit_nb_visits> + <avg_time_on_page>180</avg_time_on_page> + <bounce_rate>0%</bounce_rate> + <exit_rate>50%</exit_rate> <subtable> <row> <label>two days later</label> <nb_visits>2</nb_visits> <nb_hits>2</nb_hits> + <sum_time_spent>360</sum_time_spent> + <entry_nb_visits>1</entry_nb_visits> + <entry_nb_actions>2</entry_nb_actions> + <entry_sum_visit_length>360</entry_sum_visit_length> + <entry_bounce_count>0</entry_bounce_count> + <exit_nb_visits>1</exit_nb_visits> <subtable> <row> <label> second page view</label> <nb_visits>1</nb_visits> <nb_uniq_visitors>1</nb_uniq_visitors> <nb_hits>1</nb_hits> + <sum_time_spent>0</sum_time_spent> + <exit_nb_uniq_visitors>1</exit_nb_uniq_visitors> + <exit_nb_visits>1</exit_nb_visits> </row> <row> <label> a new visit</label> <nb_visits>1</nb_visits> <nb_uniq_visitors>1</nb_uniq_visitors> <nb_hits>1</nb_hits> + <sum_time_spent>360</sum_time_spent> + <entry_nb_uniq_visitors>1</entry_nb_uniq_visitors> + <entry_nb_visits>1</entry_nb_visits> + <entry_nb_actions>2</entry_nb_actions> + <entry_sum_visit_length>360</entry_sum_visit_length> + <entry_bounce_count>0</entry_bounce_count> </row> </subtable> </row> @@ -64,6 +107,17 @@ <nb_visits>1</nb_visits> <nb_uniq_visitors>1</nb_uniq_visitors> <nb_hits>1</nb_hits> + <sum_time_spent>0</sum_time_spent> + <entry_nb_uniq_visitors>1</entry_nb_uniq_visitors> + <entry_nb_visits>1</entry_nb_visits> + <entry_nb_actions>1</entry_nb_actions> + <entry_sum_visit_length>0</entry_sum_visit_length> + <entry_bounce_count>1</entry_bounce_count> + <exit_nb_uniq_visitors>1</exit_nb_uniq_visitors> + <exit_nb_visits>1</exit_nb_visits> + <avg_time_on_page>0</avg_time_on_page> + <bounce_rate>100%</bounce_rate> + <exit_rate>100%</exit_rate> </row> </result> <result date="2010-01-05" /> diff --git a/tests/integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_month.xml b/tests/integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_month.xml index 7b37c1b4de83229a18564366c8707e8a030e9dd2..d5cb88b0e7043688c0ea870d49b7f9125499ea14 100644 --- a/tests/integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_month.xml +++ b/tests/integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_month.xml @@ -6,29 +6,64 @@ <label> first page view</label> <nb_visits>2</nb_visits> <nb_hits>2</nb_hits> + <sum_time_spent>360</sum_time_spent> + <entry_nb_visits>2</entry_nb_visits> + <entry_nb_actions>3</entry_nb_actions> + <entry_sum_visit_length>360</entry_sum_visit_length> + <entry_bounce_count>1</entry_bounce_count> + <exit_nb_visits>1</exit_nb_visits> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> + <sum_daily_entry_nb_uniq_visitors>2</sum_daily_entry_nb_uniq_visitors> + <sum_daily_exit_nb_uniq_visitors>1</sum_daily_exit_nb_uniq_visitors> + <avg_time_on_page>180</avg_time_on_page> + <bounce_rate>50%</bounce_rate> + <exit_rate>50%</exit_rate> </row> <row> <label>second visitor</label> <nb_visits>2</nb_visits> <nb_hits>2</nb_hits> + <sum_time_spent>360</sum_time_spent> + <entry_nb_visits>1</entry_nb_visits> + <entry_nb_actions>2</entry_nb_actions> + <entry_sum_visit_length>360</entry_sum_visit_length> + <entry_bounce_count>0</entry_bounce_count> + <exit_nb_visits>1</exit_nb_visits> + <avg_time_on_page>180</avg_time_on_page> + <bounce_rate>0%</bounce_rate> + <exit_rate>50%</exit_rate> <subtable> <row> <label>two days later</label> <nb_visits>2</nb_visits> <nb_hits>2</nb_hits> + <sum_time_spent>360</sum_time_spent> + <entry_nb_visits>1</entry_nb_visits> + <entry_nb_actions>2</entry_nb_actions> + <entry_sum_visit_length>360</entry_sum_visit_length> + <entry_bounce_count>0</entry_bounce_count> + <exit_nb_visits>1</exit_nb_visits> <subtable> <row> <label> second page view</label> <nb_visits>1</nb_visits> <nb_hits>1</nb_hits> + <sum_time_spent>0</sum_time_spent> + <exit_nb_visits>1</exit_nb_visits> <sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors> + <sum_daily_exit_nb_uniq_visitors>1</sum_daily_exit_nb_uniq_visitors> </row> <row> <label> a new visit</label> <nb_visits>1</nb_visits> <nb_hits>1</nb_hits> + <sum_time_spent>360</sum_time_spent> + <entry_nb_visits>1</entry_nb_visits> + <entry_nb_actions>2</entry_nb_actions> + <entry_sum_visit_length>360</entry_sum_visit_length> + <entry_bounce_count>0</entry_bounce_count> <sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors> + <sum_daily_entry_nb_uniq_visitors>1</sum_daily_entry_nb_uniq_visitors> </row> </subtable> </row> @@ -38,12 +73,20 @@ <label>first visitor</label> <nb_visits>1</nb_visits> <nb_hits>1</nb_hits> + <sum_time_spent>0</sum_time_spent> + <exit_nb_visits>1</exit_nb_visits> + <avg_time_on_page>0</avg_time_on_page> + <bounce_rate>0%</bounce_rate> + <exit_rate>100%</exit_rate> <subtable> <row> <label> second page view</label> <nb_visits>1</nb_visits> <nb_hits>1</nb_hits> + <sum_time_spent>0</sum_time_spent> + <exit_nb_visits>1</exit_nb_visits> <sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors> + <sum_daily_exit_nb_uniq_visitors>1</sum_daily_exit_nb_uniq_visitors> </row> </subtable> </row> @@ -61,7 +104,18 @@ <label> Website 2 page view</label> <nb_visits>1</nb_visits> <nb_hits>1</nb_hits> + <sum_time_spent>0</sum_time_spent> + <entry_nb_visits>1</entry_nb_visits> + <entry_nb_actions>1</entry_nb_actions> + <entry_sum_visit_length>0</entry_sum_visit_length> + <entry_bounce_count>1</entry_bounce_count> + <exit_nb_visits>1</exit_nb_visits> <sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors> + <sum_daily_entry_nb_uniq_visitors>1</sum_daily_entry_nb_uniq_visitors> + <sum_daily_exit_nb_uniq_visitors>1</sum_daily_exit_nb_uniq_visitors> + <avg_time_on_page>0</avg_time_on_page> + <bounce_rate>100%</bounce_rate> + <exit_rate>100%</exit_rate> </row> </result> <result date="2010-02" /> diff --git a/tests/integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_week.xml b/tests/integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_week.xml index b6e85793965c85a4a9c5c2788d0abe4c6ccb918a..0cd732fa4b0e1e949eb5a65541aa8f6c1e8bdfec 100644 --- a/tests/integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_week.xml +++ b/tests/integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_week.xml @@ -6,18 +6,37 @@ <label> first page view</label> <nb_visits>2</nb_visits> <nb_hits>2</nb_hits> + <sum_time_spent>360</sum_time_spent> + <entry_nb_visits>2</entry_nb_visits> + <entry_nb_actions>3</entry_nb_actions> + <entry_sum_visit_length>360</entry_sum_visit_length> + <entry_bounce_count>1</entry_bounce_count> + <exit_nb_visits>1</exit_nb_visits> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> + <sum_daily_entry_nb_uniq_visitors>2</sum_daily_entry_nb_uniq_visitors> + <sum_daily_exit_nb_uniq_visitors>1</sum_daily_exit_nb_uniq_visitors> + <avg_time_on_page>180</avg_time_on_page> + <bounce_rate>50%</bounce_rate> + <exit_rate>50%</exit_rate> </row> <row> <label>first visitor</label> <nb_visits>1</nb_visits> <nb_hits>1</nb_hits> + <sum_time_spent>0</sum_time_spent> + <exit_nb_visits>1</exit_nb_visits> + <avg_time_on_page>0</avg_time_on_page> + <bounce_rate>0%</bounce_rate> + <exit_rate>100%</exit_rate> <subtable> <row> <label> second page view</label> <nb_visits>1</nb_visits> <nb_hits>1</nb_hits> + <sum_time_spent>0</sum_time_spent> + <exit_nb_visits>1</exit_nb_visits> <sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors> + <sum_daily_exit_nb_uniq_visitors>1</sum_daily_exit_nb_uniq_visitors> </row> </subtable> </row> @@ -27,23 +46,47 @@ <label>second visitor</label> <nb_visits>2</nb_visits> <nb_hits>2</nb_hits> + <sum_time_spent>360</sum_time_spent> + <entry_nb_visits>1</entry_nb_visits> + <entry_nb_actions>2</entry_nb_actions> + <entry_sum_visit_length>360</entry_sum_visit_length> + <entry_bounce_count>0</entry_bounce_count> + <exit_nb_visits>1</exit_nb_visits> + <avg_time_on_page>180</avg_time_on_page> + <bounce_rate>0%</bounce_rate> + <exit_rate>50%</exit_rate> <subtable> <row> <label>two days later</label> <nb_visits>2</nb_visits> <nb_hits>2</nb_hits> + <sum_time_spent>360</sum_time_spent> + <entry_nb_visits>1</entry_nb_visits> + <entry_nb_actions>2</entry_nb_actions> + <entry_sum_visit_length>360</entry_sum_visit_length> + <entry_bounce_count>0</entry_bounce_count> + <exit_nb_visits>1</exit_nb_visits> <subtable> <row> <label> second page view</label> <nb_visits>1</nb_visits> <nb_hits>1</nb_hits> + <sum_time_spent>0</sum_time_spent> + <exit_nb_visits>1</exit_nb_visits> <sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors> + <sum_daily_exit_nb_uniq_visitors>1</sum_daily_exit_nb_uniq_visitors> </row> <row> <label> a new visit</label> <nb_visits>1</nb_visits> <nb_hits>1</nb_hits> + <sum_time_spent>360</sum_time_spent> + <entry_nb_visits>1</entry_nb_visits> + <entry_nb_actions>2</entry_nb_actions> + <entry_sum_visit_length>360</entry_sum_visit_length> + <entry_bounce_count>0</entry_bounce_count> <sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors> + <sum_daily_entry_nb_uniq_visitors>1</sum_daily_entry_nb_uniq_visitors> </row> </subtable> </row> @@ -63,7 +106,18 @@ <label> Website 2 page view</label> <nb_visits>1</nb_visits> <nb_hits>1</nb_hits> + <sum_time_spent>0</sum_time_spent> + <entry_nb_visits>1</entry_nb_visits> + <entry_nb_actions>1</entry_nb_actions> + <entry_sum_visit_length>0</entry_sum_visit_length> + <entry_bounce_count>1</entry_bounce_count> + <exit_nb_visits>1</exit_nb_visits> <sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors> + <sum_daily_entry_nb_uniq_visitors>1</sum_daily_entry_nb_uniq_visitors> + <sum_daily_exit_nb_uniq_visitors>1</sum_daily_exit_nb_uniq_visitors> + <avg_time_on_page>0</avg_time_on_page> + <bounce_rate>100%</bounce_rate> + <exit_rate>100%</exit_rate> </row> </result> <result date="2010-01-11 to 2010-01-17" /> diff --git a/tests/integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_year.xml b/tests/integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_year.xml index 36eabb48cbc81a33ae6293e41a52067e5dee5527..f53e86bcad044525de9bb8d802d065e3f0f4ea6d 100644 --- a/tests/integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_year.xml +++ b/tests/integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_year.xml @@ -6,29 +6,64 @@ <label> first page view</label> <nb_visits>2</nb_visits> <nb_hits>2</nb_hits> + <sum_time_spent>360</sum_time_spent> + <entry_nb_visits>2</entry_nb_visits> + <entry_nb_actions>3</entry_nb_actions> + <entry_sum_visit_length>360</entry_sum_visit_length> + <entry_bounce_count>1</entry_bounce_count> + <exit_nb_visits>1</exit_nb_visits> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> + <sum_daily_entry_nb_uniq_visitors>2</sum_daily_entry_nb_uniq_visitors> + <sum_daily_exit_nb_uniq_visitors>1</sum_daily_exit_nb_uniq_visitors> + <avg_time_on_page>180</avg_time_on_page> + <bounce_rate>50%</bounce_rate> + <exit_rate>50%</exit_rate> </row> <row> <label>second visitor</label> <nb_visits>2</nb_visits> <nb_hits>2</nb_hits> + <sum_time_spent>360</sum_time_spent> + <entry_nb_visits>1</entry_nb_visits> + <entry_nb_actions>2</entry_nb_actions> + <entry_sum_visit_length>360</entry_sum_visit_length> + <entry_bounce_count>0</entry_bounce_count> + <exit_nb_visits>1</exit_nb_visits> + <avg_time_on_page>180</avg_time_on_page> + <bounce_rate>0%</bounce_rate> + <exit_rate>50%</exit_rate> <subtable> <row> <label>two days later</label> <nb_visits>2</nb_visits> <nb_hits>2</nb_hits> + <sum_time_spent>360</sum_time_spent> + <entry_nb_visits>1</entry_nb_visits> + <entry_nb_actions>2</entry_nb_actions> + <entry_sum_visit_length>360</entry_sum_visit_length> + <entry_bounce_count>0</entry_bounce_count> + <exit_nb_visits>1</exit_nb_visits> <subtable> <row> <label> second page view</label> <nb_visits>1</nb_visits> <nb_hits>1</nb_hits> + <sum_time_spent>0</sum_time_spent> + <exit_nb_visits>1</exit_nb_visits> <sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors> + <sum_daily_exit_nb_uniq_visitors>1</sum_daily_exit_nb_uniq_visitors> </row> <row> <label> a new visit</label> <nb_visits>1</nb_visits> <nb_hits>1</nb_hits> + <sum_time_spent>360</sum_time_spent> + <entry_nb_visits>1</entry_nb_visits> + <entry_nb_actions>2</entry_nb_actions> + <entry_sum_visit_length>360</entry_sum_visit_length> + <entry_bounce_count>0</entry_bounce_count> <sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors> + <sum_daily_entry_nb_uniq_visitors>1</sum_daily_entry_nb_uniq_visitors> </row> </subtable> </row> @@ -38,12 +73,20 @@ <label>first visitor</label> <nb_visits>1</nb_visits> <nb_hits>1</nb_hits> + <sum_time_spent>0</sum_time_spent> + <exit_nb_visits>1</exit_nb_visits> + <avg_time_on_page>0</avg_time_on_page> + <bounce_rate>0%</bounce_rate> + <exit_rate>100%</exit_rate> <subtable> <row> <label> second page view</label> <nb_visits>1</nb_visits> <nb_hits>1</nb_hits> + <sum_time_spent>0</sum_time_spent> + <exit_nb_visits>1</exit_nb_visits> <sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors> + <sum_daily_exit_nb_uniq_visitors>1</sum_daily_exit_nb_uniq_visitors> </row> </subtable> </row> @@ -61,7 +104,18 @@ <label> Website 2 page view</label> <nb_visits>1</nb_visits> <nb_hits>1</nb_hits> + <sum_time_spent>0</sum_time_spent> + <entry_nb_visits>1</entry_nb_visits> + <entry_nb_actions>1</entry_nb_actions> + <entry_sum_visit_length>0</entry_sum_visit_length> + <entry_bounce_count>1</entry_bounce_count> + <exit_nb_visits>1</exit_nb_visits> <sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors> + <sum_daily_entry_nb_uniq_visitors>1</sum_daily_entry_nb_uniq_visitors> + <sum_daily_exit_nb_uniq_visitors>1</sum_daily_exit_nb_uniq_visitors> + <avg_time_on_page>0</avg_time_on_page> + <bounce_rate>100%</bounce_rate> + <exit_rate>100%</exit_rate> </row> </result> <result date="2011" /> diff --git a/tests/integration/expected/test_apiGetReportMetadata__API.getReportMetadata.xml b/tests/integration/expected/test_apiGetReportMetadata__API.getReportMetadata.xml index 4834a90d2e2a00e6806c63f63448cb118ae55384..eb0405b730b6c55034e8fea1c467abdaae5ce58e 100644 --- a/tests/integration/expected/test_apiGetReportMetadata__API.getReportMetadata.xml +++ b/tests/integration/expected/test_apiGetReportMetadata__API.getReportMetadata.xml @@ -35,9 +35,13 @@ <action>getPageTitles</action> <dimension>Page Name</dimension> <metrics> + <nb_visits>Unique Pageviews</nb_visits> <nb_hits>Pageviews</nb_hits> - <nb_visits>Visits</nb_visits> - <nb_uniq_visitors>Unique visitors</nb_uniq_visitors> + <entry_nb_visits>Entrances</entry_nb_visits> + <avg_time_on_page>Avg. time on page</avg_time_on_page> + <bounce_rate>Bounce Rate</bounce_rate> + <exit_nb_visits>Exits</exit_nb_visits> + <exit_rate>Exit rate</exit_rate> </metrics> <uniqueId>Actions_getPageTitles</uniqueId> diff --git a/tests/integration/expected/test_apiGetReportMetadata_year__API.getReportMetadata.xml b/tests/integration/expected/test_apiGetReportMetadata_year__API.getReportMetadata.xml index 4834a90d2e2a00e6806c63f63448cb118ae55384..eb0405b730b6c55034e8fea1c467abdaae5ce58e 100644 --- a/tests/integration/expected/test_apiGetReportMetadata_year__API.getReportMetadata.xml +++ b/tests/integration/expected/test_apiGetReportMetadata_year__API.getReportMetadata.xml @@ -35,9 +35,13 @@ <action>getPageTitles</action> <dimension>Page Name</dimension> <metrics> + <nb_visits>Unique Pageviews</nb_visits> <nb_hits>Pageviews</nb_hits> - <nb_visits>Visits</nb_visits> - <nb_uniq_visitors>Unique visitors</nb_uniq_visitors> + <entry_nb_visits>Entrances</entry_nb_visits> + <avg_time_on_page>Avg. time on page</avg_time_on_page> + <bounce_rate>Bounce Rate</bounce_rate> + <exit_nb_visits>Exits</exit_nb_visits> + <exit_rate>Exit rate</exit_rate> </metrics> <uniqueId>Actions_getPageTitles</uniqueId> diff --git a/tests/integration/expected/test_noVisit__API.getDefaultProcessedMetrics.xml b/tests/integration/expected/test_noVisit__API.getDefaultProcessedMetrics.xml deleted file mode 100644 index 756ba342eda97ba32b30e6a82aae569bef7e3b37..0000000000000000000000000000000000000000 --- a/tests/integration/expected/test_noVisit__API.getDefaultProcessedMetrics.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> -<result> - <row> - <nb_actions_per_visit>Actions per Visit</nb_actions_per_visit> - <avg_time_on_site>Avg. Time on Website</avg_time_on_site> - <bounce_rate>Bounce Rate</bounce_rate> - </row> -</result> \ No newline at end of file diff --git a/tests/integration/expected/test_noVisit__VisitFrequency.getMaxActionsReturning_day.xml b/tests/integration/expected/test_noVisit__VisitFrequency.getMaxActionsReturning_day.xml deleted file mode 100644 index f5722c2b947ae81c5390b2448986be96d1bf4ff3..0000000000000000000000000000000000000000 --- a/tests/integration/expected/test_noVisit__VisitFrequency.getMaxActionsReturning_day.xml +++ /dev/null @@ -1,2 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> -<result>0</result> \ No newline at end of file diff --git a/tests/integration/proxy-piwik.php b/tests/integration/proxy-piwik.php index 3ca6bd1eb0a50577e29d87df055acb461ab81ecf..2db5f372b7a74c7549db4bd11ca803e86a6da199 100644 --- a/tests/integration/proxy-piwik.php +++ b/tests/integration/proxy-piwik.php @@ -24,6 +24,8 @@ require_once PIWIK_INCLUDE_PATH .'/libs/upgradephp/upgrade.php'; Piwik::createConfigObject(); Zend_Registry::get('config')->setTestEnvironment(); Piwik_Tracker_Config::getInstance()->setTestEnvironment(); +// Do not run scheduled tasks during tests +Piwik_Tracker_Config::getInstance()->setTestValue('Tracker', 'scheduled_tasks_min_interval', 0); // Custom IP to use for this visitor $customIp = Piwik_Common::getRequestVar('cip', false); @@ -39,5 +41,7 @@ if(!empty($customDatetime)) Piwik_Tracker::setForceDateTime($customDatetime); } +// Disable provider plugin, because it is so slow to do reverse ip lookup in dev environment somehow +Piwik_Tracker::setPluginsNotToLoad(array('Provider')); include '../../piwik.php'; ob_flush();