Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/Console.php31
-rw-r--r--core/Db/Schema/Mysql.php63
-rw-r--r--core/Menu/MenuReporting.php5
-rw-r--r--core/Metrics.php12
-rw-r--r--core/Plugin.php30
-rw-r--r--core/Plugin/ActionDimension.php149
-rw-r--r--core/Plugin/Manager.php54
-rw-r--r--core/Plugin/Menu.php1
-rw-r--r--core/Plugin/Report.php287
-rw-r--r--core/Plugin/Segment.php156
-rw-r--r--core/Plugin/ViewDataTable.php22
-rw-r--r--core/Plugin/VisitDimension.php207
-rw-r--r--core/Settings/SystemSetting.php1
-rw-r--r--core/Tracker/Action.php146
-rw-r--r--core/Tracker/ActionPageview.php12
-rw-r--r--core/Tracker/GoalManager.php136
-rw-r--r--core/Tracker/Request.php30
-rw-r--r--core/Tracker/Settings.php36
-rw-r--r--core/Tracker/Visit.php301
-rw-r--r--core/Tracker/Visitor.php94
-rw-r--r--core/ViewDataTable/Factory.php28
-rw-r--r--core/WidgetsList.php5
-rw-r--r--piwik.php4
-rw-r--r--plugins/API/API.php128
-rw-r--r--plugins/API/ProcessedReport.php44
-rw-r--r--plugins/Actions/API.php2
-rw-r--r--plugins/Actions/Actions.php817
-rw-r--r--plugins/Actions/Actions/ActionClickUrl.php (renamed from core/Tracker/ActionClickUrl.php)36
-rw-r--r--plugins/Actions/Actions/ActionDownloadUrl.php41
-rw-r--r--plugins/Actions/Actions/ActionSiteSearch.php (renamed from core/Tracker/ActionSiteSearch.php)20
-rw-r--r--plugins/Actions/Archiver.php2
-rw-r--r--plugins/Actions/Columns/ClickedUrl.php21
-rw-r--r--plugins/Actions/Columns/DestinationPage.php20
-rw-r--r--plugins/Actions/Columns/DownloadUrl.php21
-rw-r--r--plugins/Actions/Columns/EntryPageTitle.php52
-rw-r--r--plugins/Actions/Columns/EntryPageUrl.php53
-rw-r--r--plugins/Actions/Columns/ExitPageTitle.php67
-rw-r--r--plugins/Actions/Columns/ExitPageUrl.php73
-rw-r--r--plugins/Actions/Columns/Keyword.php20
-rw-r--r--plugins/Actions/Columns/KeywordwithNoSearchResult.php20
-rw-r--r--plugins/Actions/Columns/PageTitle.php34
-rw-r--r--plugins/Actions/Columns/PageUrl.php33
-rw-r--r--plugins/Actions/Columns/SearchCategory.php20
-rw-r--r--plugins/Actions/Columns/SearchDestinationPage.php20
-rw-r--r--plugins/Actions/Columns/SearchKeyword.php30
-rw-r--r--plugins/Actions/Columns/SearchNoResultKeyword.php20
-rw-r--r--plugins/Actions/Columns/ServerTime.php43
-rw-r--r--plugins/Actions/Columns/TimeSpentRefAction.php36
-rw-r--r--plugins/Actions/Columns/VisitTotalActions.php95
-rw-r--r--plugins/Actions/Columns/VisitTotalSearches.php77
-rw-r--r--plugins/Actions/Controller.php42
-rw-r--r--plugins/Actions/Menu.php6
-rw-r--r--plugins/Actions/Reports/Base.php119
-rw-r--r--plugins/Actions/Reports/Get.php36
-rw-r--r--plugins/Actions/Reports/GetDownloads.php58
-rw-r--r--plugins/Actions/Reports/GetEntryPageTitles.php61
-rw-r--r--plugins/Actions/Reports/GetEntryPageUrls.php72
-rw-r--r--plugins/Actions/Reports/GetExitPageTitles.php71
-rw-r--r--plugins/Actions/Reports/GetExitPageUrls.php84
-rw-r--r--plugins/Actions/Reports/GetOutlinks.php65
-rw-r--r--plugins/Actions/Reports/GetPageTitles.php82
-rw-r--r--plugins/Actions/Reports/GetPageTitlesFollowingSiteSearch.php71
-rw-r--r--plugins/Actions/Reports/GetPageUrls.php63
-rw-r--r--plugins/Actions/Reports/GetPageUrlsFollowingSiteSearch.php40
-rw-r--r--plugins/Actions/Reports/GetSiteSearchCategories.php65
-rw-r--r--plugins/Actions/Reports/GetSiteSearchKeywords.php54
-rw-r--r--plugins/Actions/Reports/GetSiteSearchNoResultKeywords.php51
-rw-r--r--plugins/Actions/Reports/SiteSearchBase.php40
-rw-r--r--plugins/Actions/Segment.php22
-rw-r--r--plugins/Actions/Widgets.php51
-rw-r--r--plugins/CoreHome/Columns/IdSite.php52
-rw-r--r--plugins/CoreHome/Columns/VisitFirstActionTime.php37
-rw-r--r--plugins/CoreHome/Columns/VisitGoalBuyer.php136
-rw-r--r--plugins/CoreHome/Columns/VisitGoalConverted.php57
-rw-r--r--plugins/CoreHome/Columns/VisitLastActionTime.php52
-rw-r--r--plugins/CoreHome/Columns/VisitTotalTime.php120
-rw-r--r--plugins/CoreHome/Columns/VisitorDaysSinceFirst.php57
-rw-r--r--plugins/CoreHome/Columns/VisitorDaysSinceOrder.php64
-rw-r--r--plugins/CoreHome/Columns/VisitorReturning.php84
-rw-r--r--plugins/CoreHome/Columns/VisitsCount.php57
-rw-r--r--plugins/CoreHome/Controller.php37
-rw-r--r--plugins/CoreHome/Segment.php21
-rw-r--r--plugins/CustomVariables/API.php2
-rw-r--r--plugins/CustomVariables/Columns/CustomVariablename.php20
-rw-r--r--plugins/CustomVariables/Columns/CustomVariablevalue.php20
-rw-r--r--plugins/CustomVariables/CustomVariables.php69
-rw-r--r--plugins/CustomVariables/Reports/Base.php18
-rw-r--r--plugins/CustomVariables/Reports/GetCustomVariables.php39
-rw-r--r--plugins/CustomVariables/Reports/GetCustomVariablesValuesFromNameId.php39
-rw-r--r--plugins/CustomVariables/Widgets.php20
-rw-r--r--plugins/DevicesDetection/Columns/Base.php38
-rw-r--r--plugins/DevicesDetection/Columns/BrowserName.php38
-rw-r--r--plugins/DevicesDetection/Columns/BrowserVersion.php38
-rw-r--r--plugins/DevicesDetection/Columns/DeviceBrand.php39
-rw-r--r--plugins/DevicesDetection/Columns/DeviceModel.php39
-rw-r--r--plugins/DevicesDetection/Columns/DeviceType.php62
-rw-r--r--plugins/DevicesDetection/Columns/Os.php38
-rw-r--r--plugins/DevicesDetection/Columns/OsVersion.php39
-rw-r--r--plugins/DevicesDetection/DevicesDetection.php309
-rw-r--r--plugins/DevicesDetection/Reports/Base.php19
-rw-r--r--plugins/DevicesDetection/Reports/GetBrand.php34
-rw-r--r--plugins/DevicesDetection/Reports/GetBrowserFamilies.php41
-rw-r--r--plugins/DevicesDetection/Reports/GetBrowserVersions.php40
-rw-r--r--plugins/DevicesDetection/Reports/GetModel.php34
-rw-r--r--plugins/DevicesDetection/Reports/GetOsFamilies.php42
-rw-r--r--plugins/DevicesDetection/Reports/GetOsVersions.php41
-rw-r--r--plugins/DevicesDetection/Reports/GetType.php34
-rw-r--r--plugins/DevicesDetection/Widgets.php27
-rw-r--r--plugins/Events/Actions/ActionEvent.php (renamed from core/Tracker/ActionEvent.php)43
-rw-r--r--plugins/Events/Columns/EventAction.php56
-rw-r--r--plugins/Events/Columns/EventCategory.php56
-rw-r--r--plugins/Events/Columns/EventName.php55
-rw-r--r--plugins/Events/Columns/TotalEvents.php77
-rw-r--r--plugins/Events/Events.php151
-rw-r--r--plugins/Events/Reports/Base.php117
-rw-r--r--plugins/Events/Reports/GetAction.php28
-rw-r--r--plugins/Events/Reports/GetCategory.php28
-rw-r--r--plugins/Events/Reports/GetName.php28
-rw-r--r--plugins/Events/Segment.php22
-rw-r--r--plugins/Events/Widgets.php25
-rw-r--r--plugins/Goals/Goals.php29
-rw-r--r--plugins/Live/Visitor.php9
-rw-r--r--plugins/MultiSites/Columns/Website.php20
-rw-r--r--plugins/MultiSites/MultiSites.php57
-rw-r--r--plugins/MultiSites/Reports/Base.php31
-rw-r--r--plugins/MultiSites/Reports/GetAll.php26
-rw-r--r--plugins/MultiSites/Reports/GetOne.php27
-rw-r--r--plugins/Provider/Columns/Provider.php94
-rw-r--r--plugins/Provider/Provider.php126
-rw-r--r--plugins/Provider/Reports/GetProvider.php33
-rw-r--r--plugins/Provider/Widgets.php20
-rw-r--r--plugins/Referrers/Columns/Base.php (renamed from core/Tracker/Referrer.php)110
-rw-r--r--plugins/Referrers/Columns/Campaign.php20
-rw-r--r--plugins/Referrers/Columns/Keyword.php66
-rw-r--r--plugins/Referrers/Columns/Referrer.php20
-rw-r--r--plugins/Referrers/Columns/ReferrerName.php66
-rw-r--r--plugins/Referrers/Columns/ReferrerType.php63
-rw-r--r--plugins/Referrers/Columns/ReferrerUrl.php50
-rw-r--r--plugins/Referrers/Columns/ReferrerVisitServerDate.php35
-rw-r--r--plugins/Referrers/Columns/SearchEngine.php20
-rw-r--r--plugins/Referrers/Columns/Socialnetwork.php20
-rw-r--r--plugins/Referrers/Columns/Website.php20
-rw-r--r--plugins/Referrers/Columns/WebsitePage.php20
-rw-r--r--plugins/Referrers/Referrers.php431
-rw-r--r--plugins/Referrers/Reports/Base.php18
-rw-r--r--plugins/Referrers/Reports/GetAll.php47
-rw-r--r--plugins/Referrers/Reports/GetCampaigns.php40
-rw-r--r--plugins/Referrers/Reports/GetKeywords.php44
-rw-r--r--plugins/Referrers/Reports/GetKeywordsFromCampaignId.php35
-rw-r--r--plugins/Referrers/Reports/GetKeywordsFromSearchEngineId.php34
-rw-r--r--plugins/Referrers/Reports/GetReferrerType.php77
-rw-r--r--plugins/Referrers/Reports/GetSearchEngines.php45
-rw-r--r--plugins/Referrers/Reports/GetSearchEnginesFromKeywordId.php34
-rw-r--r--plugins/Referrers/Reports/GetSocials.php55
-rw-r--r--plugins/Referrers/Reports/GetUrlsForSocial.php36
-rw-r--r--plugins/Referrers/Reports/GetUrlsFromWebsiteId.php35
-rw-r--r--plugins/Referrers/Reports/GetWebsites.php44
-rw-r--r--plugins/Referrers/Segment.php21
-rw-r--r--plugins/Referrers/Widgets.php13
-rw-r--r--plugins/UserCountry/Columns/Base.php159
-rw-r--r--plugins/UserCountry/Columns/City.php77
-rw-r--r--plugins/UserCountry/Columns/Continent.php20
-rw-r--r--plugins/UserCountry/Columns/Country.php141
-rw-r--r--plugins/UserCountry/Columns/Latitude.php77
-rw-r--r--plugins/UserCountry/Columns/Longitude.php77
-rw-r--r--plugins/UserCountry/Columns/Provider.php61
-rw-r--r--plugins/UserCountry/Columns/Region.php77
-rwxr-xr-xplugins/UserCountry/LocationProvider.php11
-rw-r--r--plugins/UserCountry/Reports/Base.php64
-rw-r--r--plugins/UserCountry/Reports/GetCity.php42
-rw-r--r--plugins/UserCountry/Reports/GetContinent.php42
-rw-r--r--plugins/UserCountry/Reports/GetCountry.php50
-rw-r--r--plugins/UserCountry/Reports/GetRegion.php42
-rw-r--r--plugins/UserCountry/Segment.php21
-rw-r--r--plugins/UserCountry/UserCountry.php345
-rw-r--r--plugins/UserCountry/Widgets.php36
-rw-r--r--plugins/UserSettings/Columns/Browser.php33
-rw-r--r--plugins/UserSettings/Columns/Browserfamily.php20
-rw-r--r--plugins/UserSettings/Columns/Browserversion.php32
-rw-r--r--plugins/UserSettings/Columns/Configuration.php20
-rw-r--r--plugins/UserSettings/Columns/Language.php37
-rw-r--r--plugins/UserSettings/Columns/MobilevsDesktop.php20
-rw-r--r--plugins/UserSettings/Columns/Operatingsystem.php33
-rw-r--r--plugins/UserSettings/Columns/Operatingsystemfamily.php20
-rw-r--r--plugins/UserSettings/Columns/Plugin.php20
-rw-r--r--plugins/UserSettings/Columns/PluginCookie.php37
-rw-r--r--plugins/UserSettings/Columns/PluginDirector.php37
-rw-r--r--plugins/UserSettings/Columns/PluginFlash.php37
-rw-r--r--plugins/UserSettings/Columns/PluginGears.php37
-rw-r--r--plugins/UserSettings/Columns/PluginJava.php37
-rw-r--r--plugins/UserSettings/Columns/PluginPdf.php37
-rw-r--r--plugins/UserSettings/Columns/PluginQuickTime.php37
-rw-r--r--plugins/UserSettings/Columns/PluginRealPlayer.php37
-rw-r--r--plugins/UserSettings/Columns/PluginSilverlight.php37
-rw-r--r--plugins/UserSettings/Columns/PluginWindowsMedia.php37
-rw-r--r--plugins/UserSettings/Columns/Resolution.php53
-rw-r--r--plugins/UserSettings/Columns/Typeofscreen.php20
-rw-r--r--plugins/UserSettings/Reports/Base.php32
-rw-r--r--plugins/UserSettings/Reports/GetBrowser.php46
-rw-r--r--plugins/UserSettings/Reports/GetBrowserType.php43
-rw-r--r--plugins/UserSettings/Reports/GetBrowserVersion.php47
-rw-r--r--plugins/UserSettings/Reports/GetConfiguration.php36
-rw-r--r--plugins/UserSettings/Reports/GetLanguage.php38
-rw-r--r--plugins/UserSettings/Reports/GetMobileVsDesktop.php43
-rw-r--r--plugins/UserSettings/Reports/GetOS.php41
-rw-r--r--plugins/UserSettings/Reports/GetOSFamily.php42
-rw-r--r--plugins/UserSettings/Reports/GetPlugin.php53
-rw-r--r--plugins/UserSettings/Reports/GetResolution.php34
-rw-r--r--plugins/UserSettings/Reports/GetWideScreen.php44
-rw-r--r--plugins/UserSettings/Segment.php21
-rw-r--r--plugins/UserSettings/UserSettings.php407
-rw-r--r--plugins/UserSettings/Widgets.php30
-rw-r--r--plugins/VisitFrequency/Reports/Get.php25
-rw-r--r--plugins/VisitFrequency/VisitFrequency.php42
-rw-r--r--plugins/VisitTime/Columns/Dayoftheweek.php20
-rw-r--r--plugins/VisitTime/Columns/Localtime.php48
-rw-r--r--plugins/VisitTime/Columns/Servertime.php33
-rw-r--r--plugins/VisitTime/Reports/Base.php41
-rw-r--r--plugins/VisitTime/Reports/GetByDayOfWeek.php72
-rw-r--r--plugins/VisitTime/Reports/GetVisitInformationPerLocalTime.php48
-rw-r--r--plugins/VisitTime/Reports/GetVisitInformationPerServerTime.php44
-rw-r--r--plugins/VisitTime/Segment.php21
-rw-r--r--plugins/VisitTime/VisitTime.php204
-rw-r--r--plugins/VisitTime/Widgets.php25
-rw-r--r--plugins/VisitorInterest/Columns/Pagespervisit.php20
-rw-r--r--plugins/VisitorInterest/Columns/Visitduration.php20
-rw-r--r--plugins/VisitorInterest/Columns/VisitsbyVisitNumber.php20
-rw-r--r--plugins/VisitorInterest/Columns/Visitsbydayssincelastvisit.php49
-rw-r--r--plugins/VisitorInterest/Reports/Base.php18
-rw-r--r--plugins/VisitorInterest/Reports/GetNumberOfVisitsByDaysSinceLast.php47
-rw-r--r--plugins/VisitorInterest/Reports/GetNumberOfVisitsByVisitCount.php55
-rw-r--r--plugins/VisitorInterest/Reports/GetNumberOfVisitsPerPage.php60
-rw-r--r--plugins/VisitorInterest/Reports/GetNumberOfVisitsPerVisitDuration.php60
-rw-r--r--plugins/VisitorInterest/VisitorInterest.php182
-rw-r--r--plugins/VisitorInterest/Widgets.php26
-rw-r--r--plugins/VisitsSummary/Reports/Get.php46
-rw-r--r--plugins/VisitsSummary/VisitsSummary.php29
-rw-r--r--tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_sortByProcessedMetric__API.getProcessedReport_day.xml2
-rw-r--r--tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_sortByProcessedMetric_constantRowsCountShouldKeepEmptyRows__API.getProcessedReport_day.xml19
-rw-r--r--tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__subtable__API.getProcessedReport_week.xml2
-rw-r--r--tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_hideColumns___API.getProcessedReport_day.xml2
-rw-r--r--tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_showColumnsWithProcessedMetrics___API.getProcessedReport_day.xml2
-rw-r--r--tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_showColumns___API.getProcessedReport_day.xml2
-rw-r--r--tests/PHPUnit/Integration/expected/test_RowEvolution_entryPageTitles__API.getRowEvolution_day.xml2
-rw-r--r--tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageTitlesFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_day.xml2
-rw-r--r--tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageTitlesFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_month.xml2
-rw-r--r--tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml2
-rw-r--r--tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_month.xml2
-rw-r--r--tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageUrlsFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_day.xml2
-rw-r--r--tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageUrlsFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_month.xml2
-rw-r--r--tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_day.xml2
-rw-r--r--tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_month.xml2
-rw-r--r--tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchCategories_firstSite_lastN__API.getProcessedReport_day.xml2
-rw-r--r--tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchCategories_firstSite_lastN__API.getProcessedReport_month.xml2
-rw-r--r--tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchKeywords_firstSite_lastN__API.getProcessedReport_day.xml2
-rw-r--r--tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchKeywords_firstSite_lastN__API.getProcessedReport_month.xml2
-rw-r--r--tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchNoResultKeywords_firstSite_lastN__API.getProcessedReport_day.xml2
-rw-r--r--tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchNoResultKeywords_firstSite_lastN__API.getProcessedReport_month.xml2
-rw-r--r--tests/PHPUnit/Integration/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_day.xml19
-rw-r--r--tests/PHPUnit/Integration/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_month.xml19
-rw-r--r--tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getOutlinks_firstSite_lastN__API.getProcessedReport_day.xml2
-rw-r--r--tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml2
-rw-r--r--tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_day.xml2
-rw-r--r--tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_MultiSites.getAll_firstSite_lastN__API.getProcessedReport_day.xml9
-rw-r--r--tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Referrers.getWebsites_firstSite_lastN__API.getProcessedReport_day.xml19
-rw-r--r--tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_VisitFrequency.get_firstSite_lastN__API.getProcessedReport_day.xml12
-rw-r--r--tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_VisitorInterest.getNumberOfVisitsByDaysSinceLast_firstSite_lastN__API.getProcessedReport_day.xml13
-rw-r--r--tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_VisitsSummary.get_firstSite_lastN__API.getProcessedReport_day.xml8
-rw-r--r--tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_month.original.html8
-rw-r--r--tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getDefaultMetricTranslations.xml27
-rw-r--r--tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getMetadata_day.xml18
-rw-r--r--tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getProcessedReport_day.xml18
-rw-r--r--tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getReportMetadata_day.xml730
-rw-r--r--tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getSegmentsMetadata.xml2
-rw-r--r--tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_phpRenderer__API.getDefaultMetricTranslations.php2
-rw-r--r--tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_showRawMetrics__API.getProcessedReport_day.xml18
-rw-r--r--tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_year__API.getProcessedReport_year.xml18
-rw-r--r--tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Metadata_VisitTime.getVisitInformationPerServerTime__API.getProcessedReport_day.xml19
-rw-r--r--tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__API.getProcessedReport_day.xml18
-rw-r--r--tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html8
-rw-r--r--tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__API.getProcessedReport_range.xml18
-rw-r--r--tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables__subtable__API.getProcessedReport_day.xml17
m---------tests/PHPUnit/UI0
-rw-r--r--tests/PHPUnit/proxy/includes.php8
284 files changed, 9899 insertions, 4864 deletions
diff --git a/core/Console.php b/core/Console.php
index a33a72d3b9..d03fe0501f 100644
--- a/core/Console.php
+++ b/core/Console.php
@@ -72,11 +72,9 @@ class Console extends Application
private function getAvailableCommands()
{
$commands = $this->getDefaultPiwikCommands();
+ $detected = PluginManager::getInstance()->findMultipleComponents('Commands', 'Piwik\\Plugin\\ConsoleCommand');
- $pluginNames = PluginManager::getInstance()->getLoadedPluginsName();
- foreach ($pluginNames as $pluginName) {
- $commands = array_merge($commands, $this->findCommandsInPlugin($pluginName));
- }
+ $commands = array_merge($commands, $detected);
/**
* Triggered to filter / restrict console commands. Plugins that want to restrict commands
@@ -101,31 +99,6 @@ class Console extends Application
return $commands;
}
- private function findCommandsInPlugin($pluginName)
- {
- $commands = array();
-
- $files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/plugins/' . $pluginName .'/Commands', '*.php');
-
- foreach ($files as $file) {
- $klassName = sprintf('Piwik\\Plugins\\%s\\Commands\\%s', $pluginName, basename($file, '.php'));
-
- if (!class_exists($klassName) || !is_subclass_of($klassName, 'Piwik\\Plugin\\ConsoleCommand')) {
- continue;
- }
-
- $klass = new \ReflectionClass($klassName);
-
- if ($klass->isAbstract()) {
- continue;
- }
-
- $commands[] = $klassName;
- }
-
- return $commands;
- }
-
private function checkCompatibility()
{
if (Common::isPhpCgiType()) {
diff --git a/core/Db/Schema/Mysql.php b/core/Db/Schema/Mysql.php
index 4eb62d7b46..7521634080 100644
--- a/core/Db/Schema/Mysql.php
+++ b/core/Db/Schema/Mysql.php
@@ -148,50 +148,9 @@ class Mysql implements SchemaInterface
idvisit INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
idsite INTEGER(10) UNSIGNED NOT NULL,
idvisitor BINARY(8) NOT NULL,
- visitor_localtime TIME NOT NULL,
- visitor_returning TINYINT(1) NOT NULL,
- visitor_count_visits SMALLINT(5) UNSIGNED NOT NULL,
- visitor_days_since_last SMALLINT(5) UNSIGNED NOT NULL,
- visitor_days_since_order SMALLINT(5) UNSIGNED NOT NULL,
- visitor_days_since_first SMALLINT(5) UNSIGNED NOT NULL,
- visit_first_action_time DATETIME NOT NULL,
visit_last_action_time DATETIME NOT NULL,
- visit_exit_idaction_url INTEGER(11) UNSIGNED NULL DEFAULT 0,
- 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_searches SMALLINT(5) UNSIGNED NOT NULL,
- visit_total_events SMALLINT(5) UNSIGNED NOT NULL,
- visit_total_time SMALLINT(5) UNSIGNED NOT NULL,
- visit_goal_converted TINYINT(1) NOT NULL,
- visit_goal_buyer TINYINT(1) NOT NULL,
- referer_type TINYINT(1) UNSIGNED NULL,
- referer_name VARCHAR(70) NULL,
- referer_url TEXT NOT NULL,
- referer_keyword VARCHAR(255) NULL,
config_id BINARY(8) NOT NULL,
- config_os CHAR(3) NOT NULL,
- config_browser_name VARCHAR(10) NOT NULL,
- config_browser_version VARCHAR(20) NOT NULL,
- config_resolution VARCHAR(9) NOT NULL,
- config_pdf TINYINT(1) NOT NULL,
- config_flash TINYINT(1) NOT NULL,
- config_java TINYINT(1) NOT NULL,
- config_director TINYINT(1) NOT NULL,
- config_quicktime TINYINT(1) NOT NULL,
- config_realplayer TINYINT(1) NOT NULL,
- config_windowsmedia TINYINT(1) NOT NULL,
- config_gears TINYINT(1) NOT NULL,
- config_silverlight TINYINT(1) NOT NULL,
- config_cookie TINYINT(1) NOT NULL,
location_ip VARBINARY(16) NOT NULL,
- location_browser_lang VARCHAR(20) NOT NULL,
- location_country CHAR(3) NOT NULL,
- location_region char(2) DEFAULT NULL,
- location_city varchar(255) DEFAULT NULL,
- location_latitude float(10, 6) DEFAULT NULL,
- location_longitude float(10, 6) DEFAULT NULL,
PRIMARY KEY(idvisit),
INDEX index_idsite_config_datetime (idsite, config_id, visit_last_action_time),
INDEX index_idsite_datetime (idsite, visit_last_action_time),
@@ -229,19 +188,6 @@ class Mysql implements SchemaInterface
server_time datetime NOT NULL,
idaction_url int(11) default NULL,
idlink_va int(11) default NULL,
- referer_visit_server_date date default NULL,
- referer_type int(10) unsigned default NULL,
- referer_name varchar(70) default NULL,
- referer_keyword varchar(255) default NULL,
- visitor_returning tinyint(1) NOT NULL,
- visitor_count_visits SMALLINT(5) UNSIGNED NOT NULL,
- visitor_days_since_first SMALLINT(5) UNSIGNED NOT NULL,
- visitor_days_since_order SMALLINT(5) UNSIGNED NOT NULL,
- location_country char(3) NOT NULL,
- location_region char(2) DEFAULT NULL,
- location_city varchar(255) DEFAULT NULL,
- location_latitude float(10, 6) DEFAULT NULL,
- location_longitude float(10, 6) DEFAULT NULL,
url text NOT NULL,
idgoal int(10) NOT NULL,
buster int unsigned NOT NULL,
@@ -264,20 +210,13 @@ class Mysql implements SchemaInterface
idlink_va INTEGER(11) UNSIGNED NOT NULL AUTO_INCREMENT,
idsite int(10) UNSIGNED NOT NULL,
idvisitor BINARY(8) NOT NULL,
- server_time DATETIME NOT NULL,
idvisit INTEGER(10) UNSIGNED NOT NULL,
- idaction_url INTEGER(10) UNSIGNED DEFAULT NULL,
idaction_url_ref INTEGER(10) UNSIGNED NULL DEFAULT 0,
- idaction_name INTEGER(10) UNSIGNED,
idaction_name_ref INTEGER(10) UNSIGNED NOT NULL,
- idaction_event_category INTEGER(10) UNSIGNED DEFAULT NULL,
- idaction_event_action INTEGER(10) UNSIGNED DEFAULT NULL,
- time_spent_ref_action INTEGER(10) UNSIGNED NOT NULL,
custom_float FLOAT NULL DEFAULT NULL,
PRIMARY KEY(idlink_va),
- INDEX index_idvisit(idvisit),
- INDEX index_idsite_servertime ( idsite, server_time )
+ INDEX index_idvisit(idvisit)
) ENGINE=$engine DEFAULT CHARSET=utf8
",
diff --git a/core/Menu/MenuReporting.php b/core/Menu/MenuReporting.php
index 146c6d08f1..67f95bb8a6 100644
--- a/core/Menu/MenuReporting.php
+++ b/core/Menu/MenuReporting.php
@@ -8,6 +8,7 @@
*/
namespace Piwik\Menu;
use Piwik\Piwik;
+use Piwik\Plugin\Report;
/**
* Contains menu entries for the Reporting menu (the menu displayed under the Piwik logo).
@@ -70,6 +71,10 @@ class MenuReporting extends MenuAbstract
foreach ($this->getAvailableMenus() as $menu) {
$menu->configureReportingMenu($this);
}
+
+ foreach (Report::getAllReports() as $report) {
+ $report->configureReportingMenu($this);
+ }
}
return parent::getMenu();
diff --git a/core/Metrics.php b/core/Metrics.php
index 4f12a8e3ab..1eee0caf24 100644
--- a/core/Metrics.php
+++ b/core/Metrics.php
@@ -323,7 +323,7 @@ class Metrics
static public function getDefaultMetricsDocumentation()
{
- $documentation = array(
+ $translations = array(
'nb_visits' => 'General_ColumnNbVisitsDocumentation',
'nb_uniq_visitors' => 'General_ColumnNbUniqVisitorsDocumentation',
'nb_actions' => 'General_ColumnNbActionsDocumentation',
@@ -335,7 +335,15 @@ class Metrics
'nb_hits' => 'General_ColumnPageviewsDocumentation',
'exit_rate' => 'General_ColumnExitRateDocumentation'
);
- return array_map(array('\\Piwik\\Piwik','translate'), $documentation);
+
+ /**
+ * Use this event to register translations for metrics documentation processed by your plugin.
+ *
+ * @param string[] $translations The array mapping of column_name => Plugin_TranslationForColumnDocumentation
+ */
+ Piwik::postEvent('Metrics.getDefaultMetricDocumentationTranslations', array(&$translations));
+
+ return array_map(array('\\Piwik\\Piwik','translate'), $translations);
}
public static function getPercentVisitColumn()
diff --git a/core/Plugin.php b/core/Plugin.php
index aeb687398e..e9cbe2feae 100644
--- a/core/Plugin.php
+++ b/core/Plugin.php
@@ -314,6 +314,36 @@ class Plugin
return new $klassName;
}
+ public function findMultipleComponents($directoryWithinPlugin, $expectedSubclass)
+ {
+ $components = array();
+
+ $files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/plugins/' . $this->pluginName .'/' . $directoryWithinPlugin, '*.php');
+
+ foreach ($files as $file) {
+ $klassName = sprintf('Piwik\\Plugins\\%s\\%s\\%s', $this->pluginName, $directoryWithinPlugin, basename($file, '.php'));
+
+ if (!class_exists($klassName)) {
+ continue;
+ }
+
+ if (!empty($expectedSubclass) && !is_subclass_of($klassName, $expectedSubclass)) {
+ continue;
+ }
+
+ $klass = new \ReflectionClass($klassName);
+
+ if ($klass->isAbstract()) {
+ continue;
+ }
+
+ $components[] = $klassName;
+ }
+
+ return $components;
+ }
+
+
/**
* Detect whether there are any missing dependencies.
*
diff --git a/core/Plugin/ActionDimension.php b/core/Plugin/ActionDimension.php
new file mode 100644
index 0000000000..f079d7da65
--- /dev/null
+++ b/core/Plugin/ActionDimension.php
@@ -0,0 +1,149 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugin;
+
+use Piwik\Common;
+use Piwik\Db;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\Request;
+use Piwik\Plugin\Manager as PluginManager;
+use Piwik\Tracker\Visitor;
+
+/**
+ * @api
+ * @since 2.4.0
+ */
+abstract class ActionDimension
+{
+ protected $name;
+
+ protected $fieldName = '';
+ protected $fieldType = '';
+
+ protected $segments = array();
+
+ public function __construct()
+ {
+ $this->init();
+ }
+
+ protected function init()
+ {
+
+ }
+
+ public function install()
+ {
+ if (empty($this->fieldName) || empty($this->fieldType)) {
+ return;
+ }
+
+ try {
+ $sql = "ALTER TABLE `" . Common::prefixTable("log_link_visit_action") . "` ADD `$this->fieldName` $this->fieldType";
+ Db::exec($sql);
+
+ } catch (\Exception $e) {
+ if (!Db::get()->isErrNo($e, '1060')) {
+ throw $e;
+ }
+ }
+ }
+
+ public function uninstall()
+ {
+ if (empty($this->fieldName) || empty($this->fieldType)) {
+ return;
+ }
+
+ try {
+ $sql = "ALTER TABLE `" . Common::prefixTable("log_link_visit_action") . "` DROP COLUMN `$this->fieldName`";
+ Db::exec($sql);
+ } catch (\Exception $e) {
+ if (!Db::get()->isErrNo($e, '1091')) {
+ throw $e;
+ }
+ }
+ }
+
+
+ public function shouldHandle()
+ {
+ return false;
+ }
+
+ /**
+ * @return string|int
+ * @throws \Exception in case not implemented
+ */
+ public function getActionId()
+ {
+ throw new \Exception('You need to overwrite the getActionId method in case you implement the onLookupAction method in class: ' . get_class($this));
+ }
+
+ protected function addSegment(Segment $segment)
+ {
+ $sqlSegment = $segment->getSqlSegment();
+ if (!empty($this->fieldName) && empty($sqlSegment)) {
+ $segment->setSqlSegment('log_link_visit_action.' . $this->fieldName);
+ }
+
+ $segment->setType(Segment::TYPE_DIMENSION);
+
+ $this->segments[] = $segment;
+ }
+
+ /**
+ * @return Segment[]
+ */
+ public function getSegments()
+ {
+ return $this->segments;
+ }
+
+ public function getFieldName()
+ {
+ return $this->fieldName;
+ }
+
+ abstract public function getName();
+
+ /** @return \Piwik\Plugin\ActionDimension[] */
+ public static function getAllDimensions()
+ {
+ $plugins = PluginManager::getInstance()->getLoadedPlugins();
+ $instances = array();
+
+ foreach ($plugins as $plugin) {
+ foreach (self::getDimensions($plugin) as $instance) {
+ $instances[] = $instance;
+ }
+ }
+
+ return $instances;
+ }
+
+ /** @return \Piwik\Plugin\ActionDimension[] */
+ public static function getDimensions(\Piwik\Plugin $plugin)
+ {
+ $dimensions = $plugin->findMultipleComponents('Columns', '\\Piwik\\Plugin\\ActionDimension');
+ $instances = array();
+
+ foreach ($dimensions as $dimension) {
+ $instances[] = new $dimension();
+ }
+
+ return $instances;
+ }
+
+ public function onNewAction(Request $request, Visitor $visitor, Action $action)
+ {
+ return false;
+ }
+
+}
diff --git a/core/Plugin/Manager.php b/core/Plugin/Manager.php
index 2bd01d4a8c..3f9611c385 100644
--- a/core/Plugin/Manager.php
+++ b/core/Plugin/Manager.php
@@ -355,6 +355,23 @@ class Manager extends Singleton
return $components;
}
+ public function findMultipleComponents($directoryWithinPlugin, $expectedSubclass)
+ {
+ $plugins = $this->getLoadedPlugins();
+ $found = array();
+
+ foreach ($plugins as $plugin) {
+ $components = $plugin->findMultipleComponents($directoryWithinPlugin, $expectedSubclass);
+
+ if (!empty($components)) {
+ $found = array_merge($found, $components);
+ }
+ }
+
+ return $found;
+ }
+
+
/**
* Uninstalls a Plugin (deletes plugin files from the disk)
* Only deactivated plugins can be uninstalled
@@ -456,7 +473,6 @@ class Manager extends Singleton
PiwikConfig::getInstance()->forceSave();
$this->clearCache($pluginName);
-
}
protected function isPluginInFilesystem($pluginName)
@@ -966,6 +982,19 @@ class Manager extends Singleton
} catch (\Exception $e) {
throw new \Piwik\Plugin\PluginException($plugin->getPluginName(), $e->getMessage());
}
+
+ try {
+ // todo not sure if this makes sense here
+ foreach (VisitDimension::getDimensions($plugin) as $dimension) {
+ $dimension->install();
+ }
+ // todo not sure if this makes sense here
+ foreach (ActionDimension::getDimensions($plugin) as $dimension) {
+ $dimension->install();
+ }
+ } catch (\Exception $e) {
+ throw new \Piwik\Plugin\PluginException($plugin->getPluginName(), $e->getMessage());
+ }
}
/**
@@ -1106,6 +1135,16 @@ class Manager extends Singleton
public function isTrackerPlugin(Plugin $plugin)
{
+ $dimensions = VisitDimension::getDimensions($plugin);
+ if (!empty($dimensions)) {
+ return true;
+ }
+
+ $dimensions = ActionDimension::getDimensions($plugin);
+ if (!empty($dimensions)) {
+ return true;
+ }
+
$hooks = $plugin->getListHooksRegistered();
$hookNames = array_keys($hooks);
foreach ($hookNames as $name) {
@@ -1259,6 +1298,19 @@ class Manager extends Singleton
$plugin->uninstall();
} catch (\Exception $e) {
}
+
+ try {
+ $plugin = $this->getLoadedPlugin($pluginName);
+ // todo not sure if this makes sense here
+ foreach (VisitDimension::getDimensions($plugin) as $dimension) {
+ $dimension->uninstall();
+ }
+ // todo not sure if this makes sense here
+ foreach (ActionDimension::getDimensions($plugin) as $dimension) {
+ $dimension->uninstall();
+ }
+ } catch (\Exception $e) {
+ }
}
/**
diff --git a/core/Plugin/Menu.php b/core/Plugin/Menu.php
index 5217bd2560..9f7240b1f3 100644
--- a/core/Plugin/Menu.php
+++ b/core/Plugin/Menu.php
@@ -23,6 +23,7 @@ use Piwik\Menu\MenuUser;
* For an example, see the {@link https://github.com/piwik/piwik/blob/master/plugins/ExampleUI/Menu.php} plugin.
*
* @api
+ * @since 2.4.0
*/
class Menu
{
diff --git a/core/Plugin/Report.php b/core/Plugin/Report.php
new file mode 100644
index 0000000000..2a38d27ef2
--- /dev/null
+++ b/core/Plugin/Report.php
@@ -0,0 +1,287 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugin;
+
+use Piwik\API\Proxy;
+use Piwik\Menu\MenuReporting;
+use Piwik\Metrics;
+use Piwik\Piwik;
+use Piwik\Plugin\Manager as PluginManager;
+use Piwik\Plugins\CoreVisualizations\Visualizations\HtmlTable;
+use Piwik\WidgetsList;
+use Piwik\ViewDataTable\Factory as ViewDataTableFactory;
+
+/**
+ * @api
+ * @since 2.4.0
+ */
+class Report
+{
+ protected $module;
+ protected $action;
+ protected $name;
+ protected $title;
+ protected $category;
+ protected $widgetTitle;
+ protected $widgetParams = array();
+ protected $menuTitle;
+ protected $processedMetrics = array();
+ protected $hasGoalMetrics = false;
+ protected $metrics = array();
+ protected $constantRowsCount = null;
+ protected $isSubtableReport = null;
+
+ /**
+ * @var \Piwik\Plugin\VisitDimension
+ */
+ protected $dimension;
+ protected $documentation;
+
+ /**
+ * @var null|Report
+ */
+ protected $actionToLoadSubTables;
+ protected $order = 1;
+
+ public function __construct()
+ {
+ $classname = get_class($this);
+ $parts = explode('\\', $classname);
+ $this->module = $parts[2];
+ $this->action = lcfirst($parts[4]);
+ $this->processedMetrics = Metrics::getDefaultProcessedMetrics();
+ $this->metrics = array_keys(Metrics::getDefaultMetrics());
+
+ $this->init();
+ }
+
+ protected function init()
+ {
+ }
+
+ public function isEnabled()
+ {
+ return true;
+ }
+
+ public function getDefaultTypeViewDataTable()
+ {
+ return HtmlTable::ID;
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+
+ }
+
+ public function render()
+ {
+ $apiProxy = Proxy::getInstance();
+
+ if (!$apiProxy->isExistingApiAction($this->module, $this->action)) {
+ throw new \Exception("Invalid action name '$this->action' for '$this->module' plugin.");
+ }
+
+ $apiAction = $apiProxy->buildApiActionName($this->module, $this->action);
+
+ $view = ViewDataTableFactory::build(null, $apiAction, 'CoreHome.renderMenuReport');
+ $rendered = $view->render();
+
+ return $rendered;
+ }
+
+ public function configureWidget(WidgetsList $widget)
+ {
+ if ($this->widgetTitle) {
+ $params = array('reportModule' => $this->module, 'reportAction' => $this->action);
+ if (!empty($this->widgetParams) && is_array($this->widgetParams)) {
+ foreach ($this->widgetParams as $key => $value) {
+ $params[$key] = $value;
+ }
+ }
+ $widget->add($this->category, $this->widgetTitle, 'CoreHome', 'renderWidget', $params);
+ }
+ }
+
+ public function configureReportingMenu(MenuReporting $menu)
+ {
+ if ($this->menuTitle) {
+ $menu->add($this->category,
+ $this->menuTitle,
+ array('module' => 'CoreHome', 'action' => 'renderMenuReport', 'reportModule' => $this->module, 'reportAction' => $this->action),
+ $this->isEnabled(),
+ $this->order);
+ }
+ }
+
+ public function getMetrics()
+ {
+ // TODO cache this
+ $translations = Metrics::getDefaultMetricTranslations();
+ $metrics = array();
+
+ foreach ($this->metrics as $metric) {
+ if (!empty($translations[$metric])) {
+ $metrics[$metric] = $translations[$metric];
+ } else {
+ $metrics[] = $metric;
+ }
+ }
+
+ return $metrics;
+ }
+
+ protected function getMetricsDocumentation()
+ {
+ // TODO cache this
+ $translations = Metrics::getDefaultMetricsDocumentation();
+ $documentation = array();
+
+ foreach ($this->metrics as $metric) {
+ if (!empty($translations[$metric])) {
+ $documentation[$metric] = $translations[$metric];
+ }
+ }
+
+ return $documentation;
+ }
+
+ public function hasGoalMetrics()
+ {
+ return $this->hasGoalMetrics;
+ }
+
+ public function toArray()
+ {
+ $report = array(
+ 'category' => $this->getCategory(),
+ 'name' => $this->getName(),
+ 'module' => $this->getModule(),
+ 'action' => $this->getAction()
+ );
+
+ if (!empty($this->dimension)) {
+ $report['dimension'] = $this->dimension->getName();
+ }
+
+ if (!empty($this->documentation)) {
+ $report['documentation'] = $this->documentation;
+ }
+
+ if (null !== $this->isSubtableReport) {
+ $report['isSubtableReport'] = $this->isSubtableReport;
+ }
+
+ $report['metrics' ] = $this->getMetrics();
+ $report['metricsDocumentation'] = $this->getMetricsDocumentation();
+ $report['processedMetrics' ] = $this->processedMetrics;
+
+ if (!empty($this->actionToLoadSubTables)) {
+ $report['actionToLoadSubTables'] = $this->actionToLoadSubTables;
+ }
+
+ if (null !== $this->constantRowsCount) {
+ $report['constantRowsCount'] = $this->constantRowsCount;
+ }
+
+ $report['order'] = $this->order;
+
+ return $report;
+ }
+
+ /**
+ * @return Report[]
+ */
+ public function getRelatedReports()
+ {
+ return array();
+ }
+
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ public function getAction()
+ {
+ return $this->action;
+ }
+
+ public function getCategory()
+ {
+ return Piwik::translate($this->category);
+ }
+
+ public function getModule()
+ {
+ return $this->module;
+ }
+
+ public static function factory($module, $action = '')
+ {
+ foreach (self::getAllReports() as $report) {
+ if ($report->module === $module && $report->action === $action) {
+ return $report;
+ }
+ }
+ }
+
+ /** @return \Piwik\Plugin\Report[] */
+ public static function getAllReports()
+ {
+ $reports = PluginManager::getInstance()->findMultipleComponents('Reports', '\\Piwik\\Plugin\\Report');
+ $instances = array();
+
+ foreach ($reports as $report) {
+ $instances[] = new $report();
+ }
+
+ usort($instances, array('self', 'sort'));
+
+ return $instances;
+ }
+
+ /**
+ * API metadata are sorted by category/name,
+ * with a little tweak to replicate the standard Piwik category ordering
+ *
+ * @param array|Report $a
+ * @param array|Report $b
+ * @return int
+ */
+ public static function sort($a, $b)
+ {
+ static $order = null;
+ if (is_null($order)) {
+ $order = array(
+ Piwik::translate('General_MultiSitesSummary'),
+ Piwik::translate('VisitsSummary_VisitsSummary'),
+ Piwik::translate('Goals_Ecommerce'),
+ Piwik::translate('General_Actions'),
+ Piwik::translate('Events_Events'),
+ Piwik::translate('Actions_SubmenuSitesearch'),
+ Piwik::translate('Referrers_Referrers'),
+ Piwik::translate('Goals_Goals'),
+ Piwik::translate('General_Visitors'),
+ Piwik::translate('DevicesDetection_DevicesDetection'),
+ Piwik::translate('UserSettings_VisitorSettings'),
+ );
+ }
+
+ $catA = is_object($a) ? $a->category : $a['category'];
+ $catB = is_object($b) ? $b->category : $b['category'];
+
+ $orderA = is_object($a) ? $a->order : @$a['order'];
+ $orderB = is_object($b) ? $b->order : @$b['order'];
+
+ return ($category = strcmp(array_search($catA, $order), array_search($catB, $order))) == 0
+ ? ($orderA < $orderB ? -1 : 1)
+ : $category;
+ }
+}
diff --git a/core/Plugin/Segment.php b/core/Plugin/Segment.php
new file mode 100644
index 0000000000..d4135a7965
--- /dev/null
+++ b/core/Plugin/Segment.php
@@ -0,0 +1,156 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugin;
+
+/**
+ * @api
+ * @since 2.4.0
+ */
+class Segment
+{
+ const TYPE_DIMENSION = 'dimension';
+ const TYPE_METRIC = 'metric';
+
+ private $type;
+ private $category;
+ private $name;
+ private $segment;
+ private $sqlSegment;
+ private $sqlFilter;
+ private $sqlFilterValue;
+ private $acceptValues;
+ private $permission;
+
+ public function __construct()
+ {
+ $this->init();
+ }
+
+ protected function init()
+ {
+
+ }
+
+ /**
+ * @param string $acceptValues
+ */
+ public function setAcceptedValues($acceptValues)
+ {
+ $this->acceptValues = $acceptValues;
+ }
+
+ /**
+ * @param string $category
+ */
+ public function setCategory($category)
+ {
+ $this->category = $category;
+ }
+
+ /**
+ * @param string $name
+ */
+ public function setName($name)
+ {
+ $this->name = $name;
+ }
+
+ /**
+ * @param string $segment
+ */
+ public function setSegment($segment)
+ {
+ $this->segment = $segment;
+ }
+
+ /**
+ * @param string|\Closure $sqlFilter
+ */
+ public function setSqlFilter($sqlFilter)
+ {
+ $this->sqlFilter = $sqlFilter;
+ }
+
+ /**
+ * @param string|array $sqlFilterValue
+ */
+ public function setSqlFilterValue($sqlFilterValue)
+ {
+ $this->sqlFilterValue = $sqlFilterValue;
+ }
+
+ /**
+ * @param string $sqlSegment
+ */
+ public function setSqlSegment($sqlSegment)
+ {
+ $this->sqlSegment = $sqlSegment;
+ }
+
+ /**
+ * @return string
+ */
+ public function getSqlSegment()
+ {
+ return $this->sqlSegment;
+ }
+
+ /**
+ * @param string $type See constansts TYPE_*
+ */
+ public function setType($type)
+ {
+ $this->type = $type;
+ }
+
+ /**
+ * @return string
+ */
+ public function getType()
+ {
+ return $this->type;
+ }
+
+ /**
+ * @param bool $permission
+ */
+ public function setPermission($permission)
+ {
+ $this->permission = $permission;
+ }
+
+ public function toArray()
+ {
+ $segment = array(
+ 'type' => $this->type,
+ 'category' => $this->category,
+ 'name' => $this->name,
+ 'segment' => $this->segment,
+ 'sqlSegment' => $this->sqlSegment,
+ );
+
+ if (!empty($this->sqlFilter)) {
+ $segment['sqlFilter'] = $this->sqlFilter;
+ }
+
+ if (!empty($this->sqlFilterValue)) {
+ $segment['sqlFilterValue'] = $this->sqlFilterValue;
+ }
+
+ if (!empty($this->acceptValues)) {
+ $segment['acceptedValues'] = $this->acceptValues;
+ }
+
+ if (isset($this->permission)) {
+ $segment['permission'] = $this->permission;
+ }
+
+ return $segment;
+ }
+}
diff --git a/core/Plugin/ViewDataTable.php b/core/Plugin/ViewDataTable.php
index 37dfce506a..2a14ff4cfe 100644
--- a/core/Plugin/ViewDataTable.php
+++ b/core/Plugin/ViewDataTable.php
@@ -191,6 +191,28 @@ abstract class ViewDataTable implements ViewInterface
$this->requestConfig->apiMethodToRequestDataTable = $apiMethodToRequestDataTable;
+ $report = Report::factory($this->requestConfig->getApiModuleToRequest(), $this->requestConfig->getApiMethodToRequest());
+
+ if (!empty($report)) {
+ $this->config->subtable_controller_action = 'renderWidget';
+ $relatedReports = $report->getRelatedReports();
+ if (!empty($relatedReports)) {
+ foreach ($relatedReports as $relatedReport) {
+ $params = array('reportModule' => $relatedReport->getModule(), 'reportAction' => $relatedReport->getAction());
+ $this->config->addRelatedReport('CoreHome.renderWidget',
+ $relatedReport->getName(),
+ $params);
+ }
+ }
+
+ $metrics = $report->getMetrics();
+ if (!empty($metrics)) {
+ $this->config->addTranslations($metrics);
+ }
+
+ $report->configureView($this);
+ }
+
/**
* Triggered during {@link ViewDataTable} construction. Subscribers should customize
* the view based on the report that is being displayed.
diff --git a/core/Plugin/VisitDimension.php b/core/Plugin/VisitDimension.php
new file mode 100644
index 0000000000..2c53c58d55
--- /dev/null
+++ b/core/Plugin/VisitDimension.php
@@ -0,0 +1,207 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugin;
+
+use Piwik\Common;
+use Piwik\Db;
+use Piwik\Plugin\Manager as PluginManager;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+use Piwik\Tracker\Action;
+
+/**
+ * @api
+ * @since 2.4.0
+ */
+abstract class VisitDimension
+{
+ protected $name;
+
+ protected $fieldName = '';
+ protected $fieldType = '';
+
+ protected $segments = array();
+
+ public function __construct()
+ {
+ $this->init();
+ }
+
+ protected function init()
+ {
+
+ }
+
+ public function hasImplementedEvent($method)
+ {
+ $reflectionObject = new \ReflectionObject($this);
+ $declaringClass = $reflectionObject->getMethod($method)->getDeclaringClass();
+
+ return get_class() !== $declaringClass->name;
+ }
+
+ public function install()
+ {
+ try {
+ if ($this->isHandlingLogVisit()) {
+ $sql = "ALTER TABLE `" . Common::prefixTable("log_visit") . "` ADD `$this->fieldName` $this->fieldType";
+ Db::exec($sql);
+ }
+ } catch (\Exception $e) {
+ if (!Db::get()->isErrNo($e, '1060')) {
+ throw $e;
+ }
+ }
+
+ try {
+ if ($this->isHandlingLogConversion()) {
+ $sql = "ALTER TABLE `" . Common::prefixTable("log_conversion") . "` ADD `$this->fieldName` $this->fieldType";
+ Db::exec($sql);
+ }
+ } catch (\Exception $e) {
+ if (!Db::get()->isErrNo($e, '1060')) {
+ throw $e;
+ }
+ }
+ }
+
+ private function isHandlingLogVisit()
+ {
+ if (empty($this->fieldName) || empty($this->fieldType)) {
+ return false;
+ }
+
+ return $this->hasImplementedEvent('onNewVisit')
+ || $this->hasImplementedEvent('onExistingVisit')
+ || $this->hasImplementedEvent('onConvertedVisit');
+ }
+
+ private function isHandlingLogConversion()
+ {
+ if (empty($this->fieldName) || empty($this->fieldType)) {
+ return false;
+ }
+
+ return $this->hasImplementedEvent('onRecordGoal');
+ }
+
+ public function uninstall()
+ {
+ if (empty($this->fieldName) || empty($this->fieldType)) {
+ return;
+ }
+
+ try {
+ if ($this->isHandlingLogVisit()) {
+ $sql = "ALTER TABLE `" . Common::prefixTable("log_visit") . "` DROP COLUMN `$this->fieldName`";
+ Db::exec($sql);
+ }
+ } catch (\Exception $e) {
+ if (!Db::get()->isErrNo($e, '1091')) {
+ throw $e;
+ }
+ }
+
+ try {
+ if ($this->isHandlingLogConversion()) {
+ $sql = "ALTER TABLE `" . Common::prefixTable("log_conversion") . "` DROP COLUMN `$this->fieldName`";
+ Db::exec($sql);
+ }
+ } catch (\Exception $e) {
+ if (!Db::get()->isErrNo($e, '1091')) {
+ throw $e;
+ }
+ }
+ }
+
+ protected function addSegment(Segment $segment)
+ {
+ $sqlSegment = $segment->getSqlSegment();
+ if (!empty($this->fieldName) && empty($sqlSegment)) {
+ $segment->setSqlSegment('log_visit.' . $this->fieldName);
+ }
+
+ $type = $segment->getType();
+
+ if (empty($type)) {
+ $segment->setType(Segment::TYPE_DIMENSION);
+ }
+
+ $this->segments[] = $segment;
+ }
+
+ /**
+ * @return Segment[]
+ */
+ public function getSegments()
+ {
+ return $this->segments;
+ }
+
+ public function getFieldName()
+ {
+ return $this->fieldName;
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ return false;
+ }
+
+ public function onExistingVisit(Request $request, Visitor $visitor, $action)
+ {
+ return false;
+ }
+
+ public function onConvertedVisit(Request $request, Visitor $visitor, $action)
+ {
+ return false;
+ }
+
+ public function onRecordGoal(Request $request, Visitor $visitor, $action)
+ {
+ return false;
+ }
+
+ abstract public function getName();
+
+ /** @return \Piwik\Plugin\VisitDimension[] */
+ public static function getAllDimensions()
+ {
+ $plugins = PluginManager::getInstance()->getLoadedPlugins();
+ $instances = array();
+ foreach ($plugins as $plugin) {
+ foreach (self::getDimensions($plugin) as $instance) {
+ $instances[] = $instance;
+ }
+ }
+
+ return $instances;
+ }
+
+ /** @return \Piwik\Plugin\VisitDimension[] */
+ public static function getDimensions(\Piwik\Plugin $plugin)
+ {
+ $dimensions = $plugin->findMultipleComponents('Columns', '\\Piwik\\Plugin\\VisitDimension');
+ $instances = array();
+
+ foreach ($dimensions as $dimension) {
+ $instances[] = new $dimension();
+ }
+
+ return $instances;
+ }
+
+}
diff --git a/core/Settings/SystemSetting.php b/core/Settings/SystemSetting.php
index c7e1c93ad1..f26c979ae1 100644
--- a/core/Settings/SystemSetting.php
+++ b/core/Settings/SystemSetting.php
@@ -27,6 +27,7 @@ class SystemSetting extends Setting
* readable by everyone.
*
* @var bool
+ * @since 2.4.0
*/
public $readableByCurrentUser = false;
diff --git a/core/Tracker/Action.php b/core/Tracker/Action.php
index 625bd9e4ed..f7d1f2ccb8 100644
--- a/core/Tracker/Action.php
+++ b/core/Tracker/Action.php
@@ -12,6 +12,8 @@ namespace Piwik\Tracker;
use Exception;
use Piwik\Common;
use Piwik\Piwik;
+use Piwik\Plugin\ActionDimension;
+use Piwik\Plugin\Manager;
use Piwik\Tracker;
/**
@@ -36,37 +38,73 @@ abstract class Action
const DB_COLUMN_CUSTOM_FLOAT = 'custom_float';
+ private static $factoryPriority = array(
+ self::TYPE_PAGE_URL, self::TYPE_SITE_SEARCH, self::TYPE_EVENT, self::TYPE_OUTLINK, self::TYPE_DOWNLOAD
+ );
+
/**
* Makes the correct Action object based on the request.
*
* @param Request $request
- * @return ActionClickUrl|ActionPageview|ActionSiteSearch
+ * @return Action
*/
static public function factory(Request $request)
{
- $downloadUrl = $request->getParam('download');
- if (!empty($downloadUrl)) {
- return new ActionClickUrl(self::TYPE_DOWNLOAD, $downloadUrl, $request);
+ /** @var Action[] $actions */
+ $actions = self::getAllActions($request);
+
+ foreach ($actions as $actionType) {
+ if (empty($action)) {
+ $action = $actionType;
+ continue;
+ }
+
+ $posPrevious = self::getPriority($action);
+ $posCurrent = self::getPriority($actionType);
+
+ if ($posCurrent > $posPrevious) {
+ $action = $actionType;
+ }
}
- $outlinkUrl = $request->getParam('link');
- if (!empty($outlinkUrl)) {
- return new ActionClickUrl(self::TYPE_OUTLINK, $outlinkUrl, $request);
+ if (!empty($action)) {
+ return $action;
}
- $url = $request->getParam('url');
+ return new ActionPageview($request);
+ }
+
+ private static function getPriority(Action $actionType)
+ {
+ $key = array_search($actionType->getActionType(), self::$factoryPriority);
- $eventCategory = $request->getParam('e_c');
- $eventAction = $request->getParam('e_a');
- if(strlen($eventCategory) > 0 && strlen($eventAction) > 0 ) {
- return new ActionEvent($eventCategory, $eventAction, $url, $request);
+ if (false === $key) {
+ return -1;
}
- $action = new ActionSiteSearch($url, $request);
- if ($action->isSearchDetected()) {
- return $action;
+ return $key;
+ }
+
+ public function shouldHandle()
+ {
+ return false;
+ }
+
+ static private function getAllActions(Request $request)
+ {
+ $actions = Manager::getInstance()->findMultipleComponents('Actions', '\\Piwik\\Tracker\\Action');
+ $instances = array();
+
+ foreach ($actions as $action) {
+ /** @var \Piwik\Tracker\Action $instance */
+ $instance = new $action($request);
+
+ if ($instance->shouldHandle()) {
+ $instances[] = $instance;
+ }
}
- return new ActionPageview($url, $request);
+
+ return $instances;
}
/**
@@ -83,7 +121,7 @@ abstract class Action
public function __construct($type, Request $request)
{
$this->actionType = $type;
- $this->request = $request;
+ $this->request = $request;
}
/**
@@ -118,7 +156,6 @@ abstract class Action
return false;
}
-
protected function setActionName($name)
{
$name = PageUrl::cleanupString((string)$name);
@@ -147,7 +184,7 @@ abstract class Action
if (!empty($url)) {
// normalize urls by stripping protocol and www
$url = PageUrl::normalizeUrl($url);
- return array($url['url'], Tracker\Action::TYPE_PAGE_URL, $url['prefixId']);
+ return array($url['url'], self::TYPE_PAGE_URL, $url['prefixId']);
}
return false;
}
@@ -159,7 +196,6 @@ abstract class Action
return (int)$idUrl;
}
-
public function getIdActionUrlForEntryAndExitIds()
{
return $this->getIdActionUrl();
@@ -223,10 +259,29 @@ abstract class Action
if(!empty($this->actionIdsCached)) {
return;
}
- $actions = $this->getActionsToLookup();
+
+ $actions = $this->getActionsToLookup();
+ $dimensions = ActionDimension::getAllDimensions();
+
+ foreach ($dimensions as $dimension) {
+ if (method_exists($dimension, 'onLookupAction')) {
+ $field = $dimension->getFieldName();
+ $value = $dimension->onLookupAction($this->request, $this);
+
+ if (empty($field)) {
+ throw new Exception('Dimension ' . get_class($dimension) . ' does not define a field name');
+ }
+
+ if ($value !== false) {
+ $actions[$field] = array($value, $dimension->getActionId());
+ Common::printDebug("$field = $value");
+ }
+ }
+ }
+
$actions = array_filter($actions, 'count');
- if(empty($actions)) {
+ if (empty($actions)) {
return;
}
@@ -239,34 +294,39 @@ abstract class Action
/**
* 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 $visitorIdCookie
* @param int $idReferrerActionUrl is the ID of the last action done by the current visit.
* @param $idReferrerActionName
- * @param int $timeSpentReferrerAction is the number of seconds since the last action was done.
- * It is directly related to idReferrerActionUrl.
+ * @param Visitor $visitor
*/
- public function record($idVisit, $visitorIdCookie, $idReferrerActionUrl, $idReferrerActionName, $timeSpentReferrerAction)
+ public function record(Visitor $visitor, $idReferrerActionUrl, $idReferrerActionName)
{
$this->loadIdsFromLogActionTable();
$visitAction = array(
- 'idvisit' => $idVisit,
- 'idsite' => $this->request->getIdSite(),
- 'idvisitor' => $visitorIdCookie,
- 'server_time' => Tracker::getDatetimeFromTimestamp($this->request->getCurrentTimestamp()),
- 'idaction_url' => $this->getIdActionUrl(),
- 'idaction_url_ref' => $idReferrerActionUrl,
- 'idaction_name_ref' => $idReferrerActionName,
- 'time_spent_ref_action' => $timeSpentReferrerAction
+ 'idvisit' => $visitor->getVisitorColumn('idvisit'),
+ 'idsite' => $this->request->getIdSite(),
+ 'idvisitor' => $visitor->getVisitorColumn('idvisitor'),
+ 'idaction_url' => $this->getIdActionUrl(),
+ 'idaction_url_ref' => $idReferrerActionUrl,
+ 'idaction_name_ref' => $idReferrerActionName
);
+ $dimensions = ActionDimension::getAllDimensions();
+
+ foreach ($dimensions as $dimension) {
+ $value = $dimension->onNewAction($this->request, $visitor, $this);
+
+ if ($value !== false) {
+ $visitAction[$dimension->getFieldName()] = $value;
+ }
+ }
+
// idaction_name is NULLable. we only set it when applicable
- if($this->isActionHasActionName()) {
+ if ($this->isActionHasActionName()) {
$visitAction['idaction_name'] = (int)$this->getIdActionName();
}
- foreach($this->actionIdsCached as $field => $idAction) {
+ foreach ($this->actionIdsCached as $field => $idAction) {
$visitAction[$field] = ($idAction === false) ? 0 : $idAction;
}
@@ -282,9 +342,9 @@ abstract class Action
}
$visitAction = array_merge($visitAction, $customVariables);
- $fields = implode(", ", array_keys($visitAction));
- $bind = array_values($visitAction);
- $values = Common::getSqlStringFieldsArray($visitAction);
+ $fields = implode(", ", array_keys($visitAction));
+ $bind = array_values($visitAction);
+ $values = Common::getSqlStringFieldsArray($visitAction);
$sql = "INSERT INTO " . Common::prefixTable('log_link_visit_action') . " ($fields) VALUES ($values)";
Tracker::getDatabase()->query($sql, $bind);
@@ -310,8 +370,8 @@ abstract class Action
*/
protected function isActionHasActionName()
{
- return in_array($this->getActionType(), array(Tracker\Action::TYPE_PAGE_TITLE,
- Tracker\Action::TYPE_PAGE_URL,
- Tracker\Action::TYPE_SITE_SEARCH));
+ return in_array($this->getActionType(), array(self::TYPE_PAGE_TITLE,
+ self::TYPE_PAGE_URL,
+ self::TYPE_SITE_SEARCH));
}
}
diff --git a/core/Tracker/ActionPageview.php b/core/Tracker/ActionPageview.php
index 3dc5ab93fb..1dc8ea77a2 100644
--- a/core/Tracker/ActionPageview.php
+++ b/core/Tracker/ActionPageview.php
@@ -20,10 +20,11 @@ class ActionPageview extends Action
{
protected $timeGeneration = false;
- function __construct($url, Request $request)
+ function __construct(Request $request)
{
parent::__construct(Action::TYPE_PAGE_URL, $request);
+ $url = $request->getParam('url');
$this->setActionUrl($url);
$actionName = $request->getParam('action_name');
@@ -41,12 +42,17 @@ class ActionPageview extends Action
);
}
- function getCustomFloatValue()
+ public function getCustomFloatValue()
{
return $this->request->getPageGenerationTime();
}
- protected function cleanupActionName($actionName)
+ public function shouldHandle()
+ {
+ return true;
+ }
+
+ private function cleanupActionName($actionName)
{
// get the delimiter, by default '/'; BC, we read the old action_category_delimiter first (see #1067)
$actionCategoryDelimiter = isset(Config::getInstance()->General['action_category_delimiter'])
diff --git a/core/Tracker/GoalManager.php b/core/Tracker/GoalManager.php
index b2b0c03ba8..d33a331ba8 100644
--- a/core/Tracker/GoalManager.php
+++ b/core/Tracker/GoalManager.php
@@ -10,8 +10,8 @@ namespace Piwik\Tracker;
use Exception;
use Piwik\Common;
-use Piwik\Config;
use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
use Piwik\Plugins\CustomVariables\CustomVariables;
use Piwik\Tracker;
@@ -20,8 +20,6 @@ use Piwik\Tracker;
class GoalManager
{
// log_visit.visit_goal_buyer
- const TYPE_BUYER_NONE = 0;
- const TYPE_BUYER_ORDERED = 1;
const TYPE_BUYER_OPEN_CART = 2;
const TYPE_BUYER_ORDERED_AND_OPEN_CART = 3;
@@ -44,13 +42,14 @@ class GoalManager
*/
protected $action = null;
protected $convertedGoals = array();
- protected $isThereExistingCartInVisit = false;
/**
* @var Request
*/
protected $request;
protected $orderId;
+ protected $isThereExistingCartInVisit = false;
+
/**
* Constructor
* @param Request $request
@@ -69,26 +68,15 @@ class GoalManager
$this->requestIsEcommerce = ($this->idGoal == 0);
}
- function getBuyerType($existingType = GoalManager::TYPE_BUYER_NONE)
+ public function detectIsThereExistingCartInVisit($visitInformation)
{
- // Was there a Cart for this visit prior to the order?
- $this->isThereExistingCartInVisit = in_array($existingType,
- array(GoalManager::TYPE_BUYER_OPEN_CART,
- GoalManager::TYPE_BUYER_ORDERED_AND_OPEN_CART));
+ if (!empty($visitInformation['visit_goal_buyer'])) {
+ $goalBuyer = $visitInformation['visit_goal_buyer'];
+ $types = array(GoalManager::TYPE_BUYER_OPEN_CART, GoalManager::TYPE_BUYER_ORDERED_AND_OPEN_CART);
- if (!$this->requestIsEcommerce) {
- return $existingType;
- }
- if ($this->isGoalAnOrder) {
- return self::TYPE_BUYER_ORDERED;
- }
- // request is Add to Cart
- if ($existingType == self::TYPE_BUYER_ORDERED
- || $existingType == self::TYPE_BUYER_ORDERED_AND_OPEN_CART
- ) {
- return self::TYPE_BUYER_ORDERED_AND_OPEN_CART;
+ // Was there a Cart for this visit prior to the order?
+ $this->isThereExistingCartInVisit = in_array($goalBuyer, $types);
}
- return self::TYPE_BUYER_OPEN_CART;
}
static public function getGoalDefinitions($idSite)
@@ -186,43 +174,23 @@ class GoalManager
/**
* Records one or several goals matched in this request.
*
- * @param int $idSite
+ * @param Visitor $visitor
* @param array $visitorInformation
* @param array $visitCustomVariables
* @param Action $action
*/
- public function recordGoals($idSite, $visitorInformation, $visitCustomVariables, $action)
+ public function recordGoals(Visitor $visitor, $visitorInformation, $visitCustomVariables, $action)
{
- $referrerTimestamp = $this->request->getParam('_refts');
- $referrerUrl = $this->request->getParam('_ref');
- $referrerCampaignName = trim(urldecode($this->request->getParam('_rcn')));
- $referrerCampaignKeyword = trim(urldecode($this->request->getParam('_rck')));
- $browserLanguage = $this->request->getBrowserLanguage();
-
- $location_country = isset($visitorInformation['location_country'])
- ? $visitorInformation['location_country']
- : Common::getCountry(
- $browserLanguage,
- $enableLanguageToCountryGuess = Config::getInstance()->Tracker['enable_language_to_country_guess'],
- $visitorInformation['location_ip']
- );
-
$goal = array(
- 'idvisit' => $visitorInformation['idvisit'],
- 'idsite' => $idSite,
- 'idvisitor' => $visitorInformation['idvisitor'],
- 'server_time' => Tracker::getDatetimeFromTimestamp($visitorInformation['visit_last_action_time']),
- 'location_country' => $location_country,
- 'visitor_returning' => $visitorInformation['visitor_returning'],
- 'visitor_days_since_first' => $visitorInformation['visitor_days_since_first'],
- 'visitor_days_since_order' => $visitorInformation['visitor_days_since_order'],
- 'visitor_count_visits' => $visitorInformation['visitor_count_visits'],
+ 'idvisit' => $visitorInformation['idvisit'],
+ 'idvisitor' => $visitorInformation['idvisitor'],
+ 'server_time' => Tracker::getDatetimeFromTimestamp($visitorInformation['visit_last_action_time'])
);
- $extraLocationCols = array('location_region', 'location_city', 'location_latitude', 'location_longitude');
- foreach ($extraLocationCols as $col) {
- if (isset($visitorInformation[$col])) {
- $goal[$col] = $visitorInformation[$col];
+ foreach (VisitDimension::getAllDimensions() as $dimension) {
+ $value = $dimension->onRecordGoal($this->request, $visitor, $action);
+ if (false !== $value) {
+ $goal[$dimension->getFieldName()] = $value;
}
}
@@ -244,55 +212,6 @@ class GoalManager
}
}
- // Attributing the correct Referrer to this conversion.
- // Priority order is as follows:
- // 0) In some cases, the campaign is not passed from the JS so we look it up from the current visit
- // 1) Campaign name/kwd parsed in the JS
- // 2) Referrer URL stored in the _ref cookie
- // 3) If no info from the cookie, attribute to the current visit referrer
-
- // 3) Default values: current referrer
- $type = $visitorInformation['referer_type'];
- $name = $visitorInformation['referer_name'];
- $keyword = $visitorInformation['referer_keyword'];
- $time = $visitorInformation['visit_first_action_time'];
-
- // 0) In some (unknown!?) cases the campaign is not found in the attribution cookie, but the URL ref was found.
- // In this case we look up if the current visit is credited to a campaign and will credit this campaign rather than the URL ref (since campaigns have higher priority)
- if (empty($referrerCampaignName)
- && $type == Common::REFERRER_TYPE_CAMPAIGN
- && !empty($name)
- ) {
- // Use default values per above
- } // 1) Campaigns from 1st party cookie
- elseif (!empty($referrerCampaignName)) {
- $type = Common::REFERRER_TYPE_CAMPAIGN;
- $name = $referrerCampaignName;
- $keyword = $referrerCampaignKeyword;
- $time = $referrerTimestamp;
- } // 2) Referrer URL parsing
- elseif (!empty($referrerUrl)) {
- $referrer = new Referrer();
- $referrer = $referrer->getReferrerInformation($referrerUrl, $currentUrl = '', $idSite);
-
- // if the parsed referrer is interesting enough, ie. website or search engine
- if (in_array($referrer['referer_type'], array(Common::REFERRER_TYPE_SEARCH_ENGINE, Common::REFERRER_TYPE_WEBSITE))) {
- $type = $referrer['referer_type'];
- $name = $referrer['referer_name'];
- $keyword = $referrer['referer_keyword'];
- $time = $referrerTimestamp;
- }
- }
- $this->setCampaignValuesToLowercase($type, $name, $keyword);
-
- $goal += array(
- 'referer_type' => $type,
- 'referer_name' => $name,
- 'referer_keyword' => $keyword,
- // this field is currently unused
- 'referer_visit_server_date' => date("Y-m-d", $time),
- );
-
// some goals are converted, so must be ecommerce Order or Cart Update
if ($this->requestIsEcommerce) {
$this->recordEcommerceGoal($goal, $visitorInformation);
@@ -359,7 +278,7 @@ class GoalManager
}
$conversion['items'] = $itemsCount;
- if($this->isThereExistingCartInVisit) {
+ if ($this->isThereExistingCartInVisit) {
$updateWhere = array(
'idvisit' => $visitInformation['idvisit'],
'idgoal' => self::IDGOAL_CART,
@@ -841,23 +760,6 @@ class GoalManager
}
/**
- * @param $type
- * @param $name
- * @param $keyword
- */
- protected function setCampaignValuesToLowercase($type, &$name, &$keyword)
- {
- if ($type === Common::REFERRER_TYPE_CAMPAIGN) {
- if (!empty($name)) {
- $name = Common::mb_strtolower($name);
- }
- if (!empty($keyword)) {
- $keyword = Common::mb_strtolower($keyword);
- }
- }
- }
-
- /**
* @param $goal
* @param $pattern_type
* @param $url
diff --git a/core/Tracker/Request.php b/core/Tracker/Request.php
index fe54533e06..ccd044320d 100644
--- a/core/Tracker/Request.php
+++ b/core/Tracker/Request.php
@@ -300,6 +300,11 @@ class Request
return $value;
}
+ public function getParams()
+ {
+ return $this->params;
+ }
+
public function getCurrentTimestamp()
{
return $this->timestamp;
@@ -518,31 +523,6 @@ class Request
return $this->forcedVisitorId;
}
- public function overrideLocation(&$visitorInfo)
- {
- if (!$this->isAuthenticated()) {
- return;
- }
-
- // check for location override query parameters (ie, lat, long, country, region, city)
- static $locationOverrideParams = array(
- 'country' => array('string', 'location_country'),
- 'region' => array('string', 'location_region'),
- 'city' => array('string', 'location_city'),
- 'lat' => array('float', 'location_latitude'),
- 'long' => array('float', 'location_longitude'),
- );
- foreach ($locationOverrideParams as $queryParamName => $info) {
- list($type, $visitorInfoKey) = $info;
-
- $value = Common::getRequestVar($queryParamName, false, $type, $this->params);
- if (!empty($value)) {
- $visitorInfo[$visitorInfoKey] = $value;
- }
- }
- return;
- }
-
public function getPlugins()
{
static $pluginsInOrder = array('fla', 'java', 'dir', 'qt', 'realp', 'pdf', 'wma', 'gears', 'ag', 'cookie');
diff --git a/core/Tracker/Settings.php b/core/Tracker/Settings.php
index c43aff0813..6b43ebcb5f 100644
--- a/core/Tracker/Settings.php
+++ b/core/Tracker/Settings.php
@@ -15,17 +15,18 @@ class Settings
{
function __construct(Request $request, $ip)
{
- $this->request = $request;
+ $this->request = $request;
$this->ipAddress = $ip;
- $this->params = array();
+ $this->configId = null;
}
- function getInfo()
+ function getConfigId()
{
- if(empty($this->params)) {
+ if (empty($this->configId)) {
$this->loadInfo();
}
- return $this->params;
+
+ return $this->configId;
}
protected function loadInfo()
@@ -33,7 +34,6 @@ class Settings
list($plugin_Flash, $plugin_Java, $plugin_Director, $plugin_Quicktime, $plugin_RealPlayer, $plugin_PDF,
$plugin_WindowsMedia, $plugin_Gears, $plugin_Silverlight, $plugin_Cookie) = $this->request->getPlugins();
- $resolution = $this->request->getParam('res');
$userAgent = $this->request->getUserAgent();
$deviceDetector = new \DeviceDetector($userAgent);
@@ -41,14 +41,15 @@ class Settings
$deviceDetector->parse();
$aBrowserInfo = $deviceDetector->getBrowser();
- $browserName = !empty($aBrowserInfo['short_name']) ? $aBrowserInfo['short_name'] : 'UNK';
+ $browserName = !empty($aBrowserInfo['short_name']) ? $aBrowserInfo['short_name'] : 'UNK';
$browserVersion = !empty($aBrowserInfo['version']) ? $aBrowserInfo['version'] : '';
$os = $deviceDetector->getOS();
$os = empty($os['short_name']) ? 'UNK' : $os['short_name'];
$browserLang = substr($this->request->getBrowserLanguage(), 0, 20); // limit the length of this string to match db
- $configurationHash = $this->getConfigHash(
+
+ $this->configId = $this->getConfigHash(
$os,
$browserName,
$browserVersion,
@@ -64,25 +65,6 @@ class Settings
$plugin_Cookie,
$this->ipAddress,
$browserLang);
-
- $this->params = array(
- 'config_id' => $configurationHash,
- 'config_os' => $os,
- 'config_browser_name' => $browserName,
- 'config_browser_version' => $browserVersion,
- 'config_resolution' => $resolution,
- 'config_pdf' => $plugin_PDF,
- 'config_flash' => $plugin_Flash,
- 'config_java' => $plugin_Java,
- 'config_director' => $plugin_Director,
- 'config_quicktime' => $plugin_Quicktime,
- 'config_realplayer' => $plugin_RealPlayer,
- 'config_windowsmedia' => $plugin_WindowsMedia,
- 'config_gears' => $plugin_Gears,
- 'config_silverlight' => $plugin_Silverlight,
- 'config_cookie' => $plugin_Cookie,
- 'location_browser_lang' => $browserLang,
- );
}
diff --git a/core/Tracker/Visit.php b/core/Tracker/Visit.php
index 81365ae297..75dc1e4877 100644
--- a/core/Tracker/Visit.php
+++ b/core/Tracker/Visit.php
@@ -9,12 +9,11 @@
namespace Piwik\Tracker;
-use DeviceDetector;
use Piwik\Common;
use Piwik\Config;
use Piwik\IP;
use Piwik\Piwik;
-use Piwik\Plugins\CustomVariables\CustomVariables;
+use Piwik\Plugin\VisitDimension;
use Piwik\Tracker;
/**
@@ -50,7 +49,6 @@ class Visit implements VisitInterface
*/
protected $userSettings;
protected $visitorCustomVariables = array();
- protected $visitorKnown;
/**
* @param Request $request
@@ -83,10 +81,9 @@ class Visit implements VisitInterface
public function handle()
{
// the IP is needed by isExcluded() and GoalManager->recordGoals()
- $ip = $this->request->getIp();
- $this->visitorInfo['location_ip'] = $ip;
+ $this->visitorInfo['location_ip'] = $this->request->getIp();
- $excluded = new VisitExcluded($this->request, $ip);
+ $excluded = new VisitExcluded($this->request, $this->visitorInfo['location_ip']);
if ($excluded->isExcluded()) {
return;
}
@@ -94,9 +91,9 @@ class Visit implements VisitInterface
/**
* Triggered after visits are tested for exclusion so plugins can modify the IP address
* persisted with a visit.
- *
+ *
* This event is primarily used by the **PrivacyManager** plugin to anonymize IP addresses.
- *
+ *
* @param string &$ip The visitor's IP address.
*/
Piwik::postEvent('Tracker.setVisitorIp', array(&$this->visitorInfo['location_ip']));
@@ -144,13 +141,13 @@ class Visit implements VisitInterface
/***
* Visitor recognition
*/
- $visitor = new Visitor($this->request, $this->getSettingsObject(), $this->visitorInfo, $this->visitorCustomVariables);
+ $visitorId = $this->getSettingsObject()->getConfigId();
+ $visitor = new Visitor($this->request, $visitorId, $this->visitorInfo, $this->visitorCustomVariables);
$visitor->recognize();
- $this->visitorKnown = $visitor->isVisitorKnown();
$this->visitorInfo = $visitor->getVisitorInfo();
- $isLastActionInTheSameVisit = $this->isLastActionInTheSameVisit();
+ $isLastActionInTheSameVisit = $this->isLastActionInTheSameVisit($visitor);
if (!$isLastActionInTheSameVisit) {
Common::printDebug("Visitor detected, but last action was more than 30 minutes ago...");
@@ -162,20 +159,16 @@ class Visit implements VisitInterface
// )
// AND
// - the last page view for this visitor was less than 30 minutes ago @see isLastActionInTheSameVisit()
- if ($this->isVisitorKnown()
+ if ($visitor->isVisitorKnown()
&& $isLastActionInTheSameVisit
) {
- $idReferrerActionUrl = $this->visitorInfo['visit_exit_idaction_url'];
+ $idReferrerActionUrl = $this->visitorInfo['visit_exit_idaction_url'];
$idReferrerActionName = $this->visitorInfo['visit_exit_idaction_name'];
try {
- $this->handleExistingVisit($action, $visitIsConverted);
+ $this->goalManager->detectIsThereExistingCartInVisit($this->visitorInfo);
+ $this->handleExistingVisit($visitor, $action, $visitIsConverted);
if (!is_null($action)) {
- $action->record($this->visitorInfo['idvisit'],
- $this->visitorInfo['idvisitor'],
- $idReferrerActionUrl,
- $idReferrerActionName,
- $this->visitorInfo['time_spent_ref_action']
- );
+ $action->record($visitor, $idReferrerActionUrl, $idReferrerActionName);
}
} catch (VisitorNotFoundInDb $e) {
@@ -192,7 +185,7 @@ class Visit implements VisitInterface
} // When the row wasn't found in the logs, and this is a pageview or
// goal matching URL, we force a new visitor
else {
- $this->visitorKnown = false;
+ $visitor->setIsVisitorKnown(false);
}
}
}
@@ -201,12 +194,12 @@ class Visit implements VisitInterface
// - the visitor has the Piwik cookie but the last action was performed more than 30 min ago @see isLastActionInTheSameVisit()
// - the visitor doesn't have the Piwik cookie, and couldn't be matched in @see recognizeTheVisitor()
// - the visitor does have the Piwik cookie but the idcookie and idvisit found in the cookie didn't match to any existing visit in the DB
- if (!$this->isVisitorKnown()
+ if (!$visitor->isVisitorKnown()
|| !$isLastActionInTheSameVisit
) {
- $this->handleNewVisit($action, $visitIsConverted);
+ $this->handleNewVisit($visitor, $action, $visitIsConverted);
if (!is_null($action)) {
- $action->record($this->visitorInfo['idvisit'], $this->visitorInfo['idvisitor'], 0, 0, 0);
+ $action->record($visitor, 0, 0);
}
}
@@ -216,7 +209,7 @@ class Visit implements VisitInterface
// record the goals if applicable
if ($someGoalsConverted) {
$this->goalManager->recordGoals(
- $this->request->getIdSite(),
+ $visitor,
$this->visitorInfo,
$this->visitorCustomVariables,
$action
@@ -232,19 +225,21 @@ class Visit implements VisitInterface
* 1) Insert the new action
* 2) Update the visit information
*
+ * @param Visitor $visitor
* @param Action $action
* @param $visitIsConverted
* @throws VisitorNotFoundInDb
*/
- protected function handleExistingVisit($action, $visitIsConverted)
+ protected function handleExistingVisit($visitor, $action, $visitIsConverted)
{
Common::printDebug("Visit is known (IP = " . IP::N2P($this->getVisitorIp()) . ")");
- $valuesToUpdate = $this->getExistingVisitFieldsToUpdate($action, $visitIsConverted);
+ $valuesToUpdate = $this->getExistingVisitFieldsToUpdate($visitor, $action, $visitIsConverted);
+ // TODO we should not have to sync this->visitorInfo and $visitor columns.
+ // TODO it should be its own dimension
$this->visitorInfo['time_spent_ref_action'] = $this->getTimeSpentReferrerAction();
-
- $this->request->overrideLocation($valuesToUpdate);
+ $visitor->setVisitorColumn('time_spent_ref_action', $this->visitorInfo['time_spent_ref_action']);
// update visitorInfo
foreach ($valuesToUpdate AS $name => $value) {
@@ -254,10 +249,10 @@ class Visit implements VisitInterface
/**
* Triggered before a [visit entity](/guides/persistence-and-the-mysql-backend#visits) is updated when
* tracking an action for an existing visit.
- *
+ *
* This event can be used to modify the visit properties that will be updated before the changes
* are persisted.
- *
+ *
* @param array &$valuesToUpdate Visit entity properties that will be updated.
* @param array $visit The entire visit entity. Read [this](/guides/persistence-and-the-mysql-backend#visits)
* to see what it contains.
@@ -265,6 +260,9 @@ class Visit implements VisitInterface
Piwik::postEvent('Tracker.existingVisitInformation', array(&$valuesToUpdate, $this->visitorInfo));
$this->updateExistingVisit($valuesToUpdate);
+
+ $this->visitorInfo['visit_last_action_time'] = $this->request->getCurrentTimestamp();
+ $visitor->setVisitorColumn('visit_last_action_time', $this->visitorInfo['visit_last_action_time']);
}
/**
@@ -288,27 +286,34 @@ class Visit implements VisitInterface
*
* 2) Insert the visit information
*
+ * @param Visitor $visitor
* @param Action $action
* @param bool $visitIsConverted
*/
- protected function handleNewVisit($action, $visitIsConverted)
+ protected function handleNewVisit($visitor, $action, $visitIsConverted)
{
Common::printDebug("New Visit (IP = " . IP::N2P($this->getVisitorIp()) . ")");
- $this->visitorInfo = $this->getNewVisitorInformation($action);
+ $this->visitorInfo = $this->getNewVisitorInformation($visitor);
// Add Custom variable key,value to the visitor array
$this->visitorInfo = array_merge($this->visitorInfo, $this->visitorCustomVariables);
- $this->visitorInfo['visit_goal_converted'] = $visitIsConverted ? 1 : 0;
+ foreach ($this->visitorInfo as $key => $value) {
+ $visitor->setVisitorColumn($key, $value);
+ }
+
+ $dimensions = VisitDimension::getAllDimensions();
+
+ $this->triggerHookOnDimensions($dimensions, 'onNewVisit', $visitor, $action);
- $this->visitorInfo['referer_name'] = substr($this->visitorInfo['referer_name'], 0, 70);
- $this->visitorInfo['referer_keyword'] = substr($this->visitorInfo['referer_keyword'], 0, 255);
- $this->visitorInfo['config_resolution'] = substr($this->visitorInfo['config_resolution'], 0, 9);
+ if ($visitIsConverted) {
+ $this->triggerHookOnDimensions($dimensions, 'onConvertedVisit', $visitor, $action);
+ }
/**
* Triggered before a new [visit entity](/guides/persistence-and-the-mysql-backend#visits) is persisted.
- *
+ *
* This event can be used to modify the visit entity or add new information to it before it is persisted.
* The UserCountry plugin, for example, uses this event to add location information for each visit.
*
@@ -318,7 +323,6 @@ class Visit implements VisitInterface
*/
Piwik::postEvent('Tracker.newVisitorInformation', array(&$this->visitorInfo, $this->request));
- $this->request->overrideLocation($this->visitorInfo);
$this->printVisitorInformation();
$idVisit = $this->insertNewVisit( $this->visitorInfo );
@@ -327,19 +331,9 @@ class Visit implements VisitInterface
$this->visitorInfo['visit_first_action_time'] = $this->request->getCurrentTimestamp();
$this->visitorInfo['visit_last_action_time'] = $this->request->getCurrentTimestamp();
- }
-
- static private function cleanupVisitTotalTime($t)
- {
- $t = (int)$t;
- if ($t < 0) {
- $t = 0;
- }
- $smallintMysqlLimit = 65534;
- if ($t > $smallintMysqlLimit) {
- $t = $smallintMysqlLimit;
- }
- return $t;
+ $visitor->setVisitorColumn('idvisit', $this->visitorInfo['idvisit']);
+ $visitor->setVisitorColumn('visit_first_action_time', $this->visitorInfo['visit_first_action_time']);
+ $visitor->setVisitorColumn('visit_last_action_time', $this->visitorInfo['visit_last_action_time']);
}
/**
@@ -347,17 +341,19 @@ class Visit implements VisitInterface
*
* @return string binary
*/
- protected function getVisitorIdcookie()
+ protected function getVisitorIdcookie(Visitor $visitor)
{
- if ($this->isVisitorKnown()) {
+ if ($visitor->isVisitorKnown()) {
return $this->visitorInfo['idvisitor'];
}
+
// If the visitor had a first party ID cookie, then we use this value
if (!empty($this->visitorInfo['idvisitor'])
&& strlen($this->visitorInfo['idvisitor']) == Tracker::LENGTH_BINARY_ID
) {
return $this->visitorInfo['idvisitor'];
}
+
return Common::hex2bin($this->generateUniqueVisitorId());
}
@@ -397,20 +393,13 @@ class Visit implements VisitInterface
* Returns true if the last action was done during the last 30 minutes
* @return bool
*/
- protected function isLastActionInTheSameVisit()
+ protected function isLastActionInTheSameVisit(Visitor $visitor)
{
- return isset($this->visitorInfo['visit_last_action_time'])
- && ($this->visitorInfo['visit_last_action_time']
- > ($this->request->getCurrentTimestamp() - Config::getInstance()->Tracker['visit_standard_length']));
- }
+ $lastActionTime = $visitor->getVisitorColumn('visit_last_action_time');
- /**
- * Returns true if the recognizeTheVisitor() method did recognize the visitor
- * @return bool
- */
- protected function isVisitorKnown()
- {
- return $this->visitorKnown === true;
+ return isset($lastActionTime)
+ && false !== $lastActionTime
+ && ($lastActionTime > ($this->request->getCurrentTimestamp() - Config::getInstance()->Tracker['visit_standard_length']));
}
// is the referrer host any of the registered URLs for this website?
@@ -474,8 +463,6 @@ class Visit implements VisitInterface
$result = Tracker::getDatabase()->query($sqlQuery, $sqlBind);
- $this->visitorInfo['visit_last_action_time'] = $this->request->getCurrentTimestamp();
-
// Debug output
if (isset($valuesToUpdate['idvisitor'])) {
$valuesToUpdate['idvisitor'] = bin2hex($valuesToUpdate['idvisitor']);
@@ -500,167 +487,71 @@ class Visit implements VisitInterface
Common::printDebug($debugVisitInfo);
}
- protected function getNewVisitorInformation($action)
+ protected function getNewVisitorInformation($visitor)
{
- $actionType = $idActionName = $idActionUrl = false;
- if($action) {
- $idActionUrl = $action->getIdActionUrlForEntryAndExitIds();
- $idActionName = $action->getIdActionNameForEntryAndExitIds();
- $actionType = $action->getActionType();
- }
-
- $daysSinceFirstVisit = $this->request->getDaysSinceFirstVisit();
- $visitCount = $this->request->getVisitCount();
- $daysSinceLastVisit = $this->request->getDaysSinceLastVisit();
-
- $daysSinceLastOrder = $this->request->getDaysSinceLastOrder();
- $isReturningCustomer = ($daysSinceLastOrder !== false);
-
- if ($daysSinceLastOrder === false) {
- $daysSinceLastOrder = 0;
- }
-
- // User settings
- $userInfo = $this->getSettingsObject();
- $userInfo = $userInfo->getInfo();
-
- // Referrer data
- $referrer = new Referrer();
- $referrerUrl = $this->request->getParam('urlref');
- $currentUrl = $this->request->getParam('url');
- $referrerInfo = $referrer->getReferrerInformation($referrerUrl, $currentUrl, $this->request->getIdSite());
-
- $visitorReturning = $isReturningCustomer
- ? 2 /* Returning customer */
- : ($visitCount > 1 || $this->isVisitorKnown() || $daysSinceLastVisit > 0
- ? 1 /* Returning */
- : 0 /* New */);
- $defaultTimeOnePageVisit = Config::getInstance()->Tracker['default_time_one_page_visit'];
-
return array(
- 'idsite' => $this->request->getIdSite(),
- 'visitor_localtime' => $this->request->getLocalTime(),
- 'idvisitor' => $this->getVisitorIdcookie(),
- 'visitor_returning' => $visitorReturning,
- 'visitor_count_visits' => $visitCount,
- 'visitor_days_since_last' => $daysSinceLastVisit,
- 'visitor_days_since_order' => $daysSinceLastOrder,
- 'visitor_days_since_first' => $daysSinceFirstVisit,
- 'visit_first_action_time' => Tracker::getDatetimeFromTimestamp($this->request->getCurrentTimestamp()),
- 'visit_last_action_time' => Tracker::getDatetimeFromTimestamp($this->request->getCurrentTimestamp()),
- 'visit_entry_idaction_url' => (int)$idActionUrl,
- 'visit_entry_idaction_name' => (int)$idActionName,
- 'visit_exit_idaction_url' => (int)$idActionUrl,
- 'visit_exit_idaction_name' => (int)$idActionName,
- 'visit_total_actions' => in_array($actionType,
- array(Action::TYPE_PAGE_URL,
- Action::TYPE_DOWNLOAD,
- Action::TYPE_OUTLINK,
- Action::TYPE_SITE_SEARCH,
- Action::TYPE_EVENT))
- ? 1 : 0, // if visit starts with something else (e.g. ecommerce order), don't record as an action
- 'visit_total_searches' => $actionType == Action::TYPE_SITE_SEARCH ? 1 : 0,
- 'visit_total_events' => $actionType == Action::TYPE_EVENT ? 1 : 0,
- 'visit_total_time' => self::cleanupVisitTotalTime($defaultTimeOnePageVisit),
- 'visit_goal_buyer' => $this->goalManager->getBuyerType(),
- 'referer_type' => $referrerInfo['referer_type'],
- 'referer_name' => $referrerInfo['referer_name'],
- 'referer_url' => $referrerInfo['referer_url'],
- 'referer_keyword' => $referrerInfo['referer_keyword'],
- 'config_id' => $userInfo['config_id'],
- 'config_os' => $userInfo['config_os'],
- 'config_browser_name' => $userInfo['config_browser_name'],
- 'config_browser_version' => $userInfo['config_browser_version'],
- 'config_resolution' => $userInfo['config_resolution'],
- 'config_pdf' => $userInfo['config_pdf'],
- 'config_flash' => $userInfo['config_flash'],
- 'config_java' => $userInfo['config_java'],
- 'config_director' => $userInfo['config_director'],
- 'config_quicktime' => $userInfo['config_quicktime'],
- 'config_realplayer' => $userInfo['config_realplayer'],
- 'config_windowsmedia' => $userInfo['config_windowsmedia'],
- 'config_gears' => $userInfo['config_gears'],
- 'config_silverlight' => $userInfo['config_silverlight'],
- 'config_cookie' => $userInfo['config_cookie'],
- 'location_ip' => $this->getVisitorIp(),
- 'location_browser_lang' => $userInfo['location_browser_lang'],
+ 'idvisitor' => $this->getVisitorIdcookie($visitor),
+ 'config_id' => $this->getSettingsObject()->getConfigId(),
+ 'location_ip' => $this->getVisitorIp(),
);
}
/**
* Gather fields=>values that needs to be updated for the existing visit in log_visit
*
- * @param $action
+ * @param Visitor $visitor
+ * @param Action|null $action
* @param $visitIsConverted
* @return array
*/
- protected function getExistingVisitFieldsToUpdate($action, $visitIsConverted)
+ protected function getExistingVisitFieldsToUpdate($visitor, $action, $visitIsConverted)
{
$valuesToUpdate = array();
- if ($action) {
- $idActionUrl = $action->getIdActionUrlForEntryAndExitIds();
- $idActionName = $action->getIdActionNameForEntryAndExitIds();
- $actionType = $action->getActionType();
-
- if ($idActionName !== false) {
- $valuesToUpdate['visit_exit_idaction_name'] = $idActionName;
- }
-
- $incrementActions = false;
- if ($idActionUrl !== false) {
- $valuesToUpdate['visit_exit_idaction_url'] = $idActionUrl;
- $incrementActions = true;
- }
- if ($actionType == Action::TYPE_SITE_SEARCH) {
- $valuesToUpdate['visit_total_searches'] = 'visit_total_searches + 1';
- $incrementActions = true;
- } else if ($actionType == Action::TYPE_EVENT) {
- $valuesToUpdate['visit_total_events'] = 'visit_total_events + 1';
- $incrementActions = true;
- }
-
- if ($incrementActions) {
- $valuesToUpdate['visit_total_actions'] = 'visit_total_actions + 1';
- }
- }
-
- $datetimeServer = Tracker::getDatetimeFromTimestamp($this->request->getCurrentTimestamp());
- $valuesToUpdate['visit_last_action_time'] = $datetimeServer;
-
- // Add 1 so it's always > 0
- $visitTotalTime = 1 + $this->request->getCurrentTimestamp() - $this->visitorInfo['visit_first_action_time'];
- $valuesToUpdate['visit_total_time'] = self::cleanupVisitTotalTime($visitTotalTime);
-
- // Goal conversion
- if ($visitIsConverted) {
- $valuesToUpdate['visit_goal_converted'] = 1;
- // If a pageview and goal conversion in the same second, with previously a goal conversion recorded
- // the request would not "update" the row since all values are the same as previous
- // therefore the request below throws exception, instead we make sure the UPDATE will affect the row
- $valuesToUpdate['visit_total_time'] = self::cleanupVisitTotalTime(
- $valuesToUpdate['visit_total_time']
- + $this->goalManager->idGoal
- // +2 to offset idgoal=-1 and idgoal=0
- + 2);
- }
-
// Might update the idvisitor when it was forced or overwritten for this visit
if (strlen($this->visitorInfo['idvisitor']) == Tracker::LENGTH_BINARY_ID) {
$valuesToUpdate['idvisitor'] = $this->visitorInfo['idvisitor'];
+ $visitor->setVisitorColumn('idvisitor', $this->visitorInfo['idvisitor']);
}
- // Ecommerce buyer status
- $visitEcommerceStatus = $this->goalManager->getBuyerType($this->visitorInfo['visit_goal_buyer']);
+ $dimensions = VisitDimension::getAllDimensions();
+ $valuesToUpdate = $this->triggerHookOnDimensions($dimensions, 'onExistingVisit', $visitor, $action, $valuesToUpdate);
- if($visitEcommerceStatus != GoalManager::TYPE_BUYER_NONE
- // only update if the value has changed (prevents overwriting the value in case a request has updated it in the meantime)
- && $visitEcommerceStatus != $this->visitorInfo['visit_goal_buyer']) {
- $valuesToUpdate['visit_goal_buyer'] = $visitEcommerceStatus;
+ if ($visitIsConverted) {
+ $valuesToUpdate = $this->triggerHookOnDimensions($dimensions, 'onConvertedVisit', $visitor, $action, $valuesToUpdate);
}
// Custom Variables overwrite previous values on each page view
$valuesToUpdate = array_merge($valuesToUpdate, $this->visitorCustomVariables);
return $valuesToUpdate;
}
+
+ /**
+ * @param VisitDimension[] $dimensions
+ * @param string $hook
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @param array|null $valuesToUpdate If null, $this->visitorInfo will be updated
+ *
+ * @return array|null The updated $valuesToUpdate or null if no $valuesToUpdate given
+ */
+ private function triggerHookOnDimensions($dimensions, $hook, $visitor, $action, $valuesToUpdate = null)
+ {
+ foreach ($dimensions as $dimension) {
+ $value = $dimension->$hook($this->request, $visitor, $action);
+
+ if ($value !== false) {
+ $fieldName = $dimension->getFieldName();
+ $visitor->setVisitorColumn($fieldName, $value);
+
+ if ($valuesToUpdate !== null) {
+ $valuesToUpdate[$fieldName] = $value;
+ } else {
+ $this->visitorInfo[$fieldName] = $value;
+ }
+ }
+ }
+
+ return $valuesToUpdate;
+ }
}
diff --git a/core/Tracker/Visitor.php b/core/Tracker/Visitor.php
index 758839abdf..63320d00b8 100644
--- a/core/Tracker/Visitor.php
+++ b/core/Tracker/Visitor.php
@@ -10,18 +10,24 @@ namespace Piwik\Tracker;
use Piwik\Common;
use Piwik\Config;
+use Piwik\Plugin\VisitDimension;
use Piwik\Plugins\CustomVariables\CustomVariables;
use Piwik\Piwik;
use Piwik\Tracker;
class Visitor
{
- function __construct(Request $request, Tracker\Settings $settings, $visitorInfo = array(), $customVariables = null)
+ private $visitorKnown = false;
+ private $request;
+ private $visitorInfo;
+ private $configId;
+
+ public function __construct(Request $request, $configId, $visitorInfo = array(), $customVariables = null)
{
$this->request = $request;
$this->visitorInfo = $visitorInfo;
$this->customVariables = $customVariables;
- $this->userInfo = $settings->getInfo();
+ $this->configId = $configId;
}
/**
@@ -31,11 +37,11 @@ class Visitor
* - Known visitor
* - New visitor
*/
- function recognize()
+ public function recognize()
{
- $this->visitorKnown = false;
+ $this->setIsVisitorKnown(false);
- $configId = $this->userInfo['config_id'];
+ $configId = $this->configId;
$idVisitor = $this->request->getVisitorId();
$isVisitorIdToLookup = !empty($idVisitor);
@@ -58,12 +64,13 @@ class Visitor
}
$persistedVisitAttributes = self::getVisitFieldsPersist();
+ array_unshift($persistedVisitAttributes, 'visit_first_action_time');
+ array_unshift($persistedVisitAttributes, 'visit_last_action_time');
+ $persistedVisitAttributes = array_unique($persistedVisitAttributes);
$selectFields = implode(", ", $persistedVisitAttributes);
$select = "SELECT
- visit_last_action_time,
- visit_first_action_time,
$selectFields
$selectCustomVariables
";
@@ -155,14 +162,15 @@ class Visitor
&& $visitRow
&& count($visitRow) > 0
) {
- // These values will be used throughout the request
- $this->visitorInfo['visit_last_action_time'] = strtotime($visitRow['visit_last_action_time']);
- $this->visitorInfo['visit_first_action_time'] = strtotime($visitRow['visit_first_action_time']);
+ // These values will be used throughout the request
foreach($persistedVisitAttributes as $field) {
$this->visitorInfo[$field] = $visitRow[$field];
}
+ $this->visitorInfo['visit_last_action_time'] = strtotime($visitRow['visit_last_action_time']);
+ $this->visitorInfo['visit_first_action_time'] = strtotime($visitRow['visit_first_action_time']);
+
// Custom Variables copied from Visit in potential later conversion
if (!empty($selectCustomVariables)) {
$maxCustomVariables = CustomVariables::getMaxCustomVariables();
@@ -180,7 +188,7 @@ class Visitor
}
}
- $this->visitorKnown = true;
+ $this->setIsVisitorKnown(true);
Common::printDebug("The visitor is known (idvisitor = " . bin2hex($this->visitorInfo['idvisitor']) . ",
config_id = " . bin2hex($configId) . ",
idvisit = {$this->visitorInfo['idvisit']},
@@ -248,7 +256,6 @@ class Visitor
'visitor_days_since_first',
'visitor_days_since_order',
'visitor_count_visits',
- 'visit_goal_buyer',
'location_country',
'location_region',
@@ -261,36 +268,63 @@ class Visitor
'referer_type',
);
+ $dimensions = VisitDimension::getAllDimensions();
+ foreach ($dimensions as $dimension) {
+ if ($dimension->hasImplementedEvent('onExistingVisit')) {
+ $fields[] = $dimension->getFieldName();
+ }
+
+ /**
+ * This event collects a list of [visit entity]() properties that should be loaded when reading
+ * the existing visit. Properties that appear in this list will be available in other tracking
+ * events such as 'onExistingVisit'.
+ *
+ * Plugins can use this event to load additional visit entity properties for later use during tracking.
+ *
+ * This way all dimensions cannot only make sure the column values are loaded that they need, we can later
+ * even implement to resolve required dimensions before the defining dimension is resolved.
+ */
+ if (method_exists($dimension, 'getRequiredVisitFields')) {
+ foreach ($dimension->getRequiredVisitFields() as $field) {
+ $fields[] = $field;
+ }
+ }
+ }
+
/**
- * Triggered when checking if the current action being tracked belongs to an existing visit.
- *
- * This event collects a list of [visit entity]() properties that should be loaded when reading
- * the existing visit. Properties that appear in this list will be available in other tracking
- * events such as {@hook Tracker.newConversionInformation} and {@hook Tracker.newVisitorInformation}.
- *
- * Plugins can use this event to load additional visit entity properties for later use during tracking.
- * When you add fields to this $fields array, they will be later available in Tracker.newConversionInformation
- *
- * **Example**
- *
- * Piwik::addAction('Tracker.getVisitFieldsToPersist', function (&$fields) {
- * $fields[] = 'custom_visit_property';
- * });
- *
- * @param array &$fields The list of visit properties to load.
+ * @ignore
*/
Piwik::postEvent('Tracker.getVisitFieldsToPersist', array(&$fields));
return $fields;
}
- function getVisitorInfo()
+ public function getVisitorInfo()
{
return $this->visitorInfo;
}
- function isVisitorKnown()
+ public function setVisitorColumn($column, $value)
+ {
+ $this->visitorInfo[$column] = $value;
+ }
+
+ public function getVisitorColumn($column)
+ {
+ if (array_key_exists($column, $this->visitorInfo)) {
+ return $this->visitorInfo[$column];
+ }
+
+ return false;
+ }
+
+ public function isVisitorKnown()
{
return $this->visitorKnown === true;
}
+
+ public function setIsVisitorKnown($isVisitorKnown)
+ {
+ return $this->visitorKnown = $isVisitorKnown;
+ }
}
diff --git a/core/ViewDataTable/Factory.php b/core/ViewDataTable/Factory.php
index 7f4f32be0a..aa42c9de68 100644
--- a/core/ViewDataTable/Factory.php
+++ b/core/ViewDataTable/Factory.php
@@ -10,6 +10,7 @@ namespace Piwik\ViewDataTable;
use Piwik\Common;
use Piwik\Piwik;
+use Piwik\Plugin\Report;
use Piwik\Plugins\CoreVisualizations\Visualizations\HtmlTable;
/**
@@ -106,6 +107,7 @@ class Factory
$params = array();
} else {
$login = Piwik::getCurrentUserLogin();
+ // TODO this won't work as currently all reports use CoreHome.renderMenuReport
$params = Manager::getViewDataTableParameters($login, $controllerAction);
}
@@ -148,6 +150,13 @@ class Factory
*/
private static function getDefaultViewTypeForReport($apiAction)
{
+ list($module, $action) = explode('.', $apiAction);
+ $report = Report::factory($module, $action);
+
+ if (!empty($report) && $report->isEnabled()) {
+ return $report->getDefaultTypeViewDataTable();
+ }
+
$defaultViewTypes = self::getDefaultTypeViewDataTable();
return isset($defaultViewTypes[$apiAction]) ? $defaultViewTypes[$apiAction] : false;
}
@@ -161,24 +170,7 @@ class Factory
if (null === self::$defaultViewTypes) {
self::$defaultViewTypes = array();
/**
- * Triggered when gathering the default view types for all available reports.
- *
- * If you define your own report, you may want to subscribe to this event to
- * make sure the correct default Visualization is used (for example, a pie graph,
- * bar graph, or something else).
- *
- * If there is no default type associated with a report, the **table** visualization
- * used.
- *
- * **Example**
- *
- * public function getDefaultTypeViewDataTable(&$defaultViewTypes)
- * {
- * $defaultViewTypes['Referrers.getSocials'] = HtmlTable::ID;
- * $defaultViewTypes['Referrers.getUrlsForSocial'] = Pie::ID;
- * }
- *
- * @param array &$defaultViewTypes The array mapping report IDs with visualization IDs.
+ * @ignore
*/
Piwik::postEvent('ViewDataTable.getDefaultType', array(&self::$defaultViewTypes));
}
diff --git a/core/WidgetsList.php b/core/WidgetsList.php
index b79b94d922..9d1f13abfa 100644
--- a/core/WidgetsList.php
+++ b/core/WidgetsList.php
@@ -9,6 +9,7 @@
namespace Piwik;
use Piwik\Plugin\Manager as PluginManager;
+use Piwik\Plugin\Report;
/**
* Manages the global list of reports that can be displayed as dashboard widgets.
@@ -83,6 +84,10 @@ class WidgetsList extends Singleton
$widgets = PluginManager::getInstance()->findComponents('Widgets', 'Piwik\\Plugin\\Widgets');
$widgetsList = self::getInstance();
+ foreach (Report::getAllReports() as $report) {
+ $report->configureWidget($widgetsList);
+ }
+
foreach ($widgets as $widget) {
$widget->configure($widgetsList);
}
diff --git a/piwik.php b/piwik.php
index 6dd640dcb0..3e5ef800be 100644
--- a/piwik.php
+++ b/piwik.php
@@ -69,12 +69,8 @@ require_once PIWIK_INCLUDE_PATH . '/core/Tracker/GoalManager.php';
require_once PIWIK_INCLUDE_PATH . '/core/Tracker/PageUrl.php';
require_once PIWIK_INCLUDE_PATH . '/core/Tracker/TableLogAction.php';
require_once PIWIK_INCLUDE_PATH . '/core/Tracker/Action.php';
-require_once PIWIK_INCLUDE_PATH . '/core/Tracker/ActionClickUrl.php';
-require_once PIWIK_INCLUDE_PATH . '/core/Tracker/ActionEvent.php';
require_once PIWIK_INCLUDE_PATH . '/core/Tracker/ActionPageview.php';
-require_once PIWIK_INCLUDE_PATH . '/core/Tracker/ActionSiteSearch.php';
require_once PIWIK_INCLUDE_PATH . '/core/Tracker/Request.php';
-require_once PIWIK_INCLUDE_PATH . '/core/Tracker/Referrer.php';
require_once PIWIK_INCLUDE_PATH . '/core/Tracker/VisitExcluded.php';
require_once PIWIK_INCLUDE_PATH . '/core/Tracker/VisitorNotFoundInDb.php';
require_once PIWIK_INCLUDE_PATH . '/core/CacheFile.php';
diff --git a/plugins/API/API.php b/plugins/API/API.php
index 66313b0a15..b0a9147b47 100644
--- a/plugins/API/API.php
+++ b/plugins/API/API.php
@@ -15,13 +15,13 @@ use Piwik\DataTable;
use Piwik\DataTable\Filter\ColumnDelete;
use Piwik\DataTable\Row;
use Piwik\Date;
-use Piwik\Menu\MenuTop;
use Piwik\Metrics;
use Piwik\Period;
use Piwik\Period\Range;
use Piwik\Piwik;
+use Piwik\Plugin\ActionDimension;
+use Piwik\Plugin\VisitDimension;
use Piwik\Plugins\CoreAdminHome\CustomLogo;
-use Piwik\Tracker\GoalManager;
use Piwik\Translate;
use Piwik\Version;
@@ -82,6 +82,18 @@ class API extends \Piwik\Plugin\API
{
$segments = array();
+ foreach (VisitDimension::getAllDimensions() as $dimension) {
+ foreach ($dimension->getSegments() as $segment) {
+ $segments[] = $segment->toArray();
+ }
+ }
+
+ foreach (ActionDimension::getAllDimensions() as $dimension) {
+ foreach ($dimension->getSegments() as $segment) {
+ $segments[] = $segment->toArray();
+ }
+ }
+
/**
* Triggered when gathering all available segment dimensions.
*
@@ -162,88 +174,6 @@ class API extends \Piwik\Plugin\API
'sqlFilterValue' => array('Piwik\IP', 'P2N'),
'permission' => $isAuthenticatedWithViewAccess,
);
- $segments[] = array(
- 'type' => 'metric',
- 'category' => Piwik::translate('General_Visit'),
- 'name' => 'General_NbActions',
- 'segment' => 'actions',
- 'sqlSegment' => 'log_visit.visit_total_actions',
- );
- $segments[] = array(
- 'type' => 'metric',
- 'category' => Piwik::translate('General_Visit'),
- 'name' => 'General_NbSearches',
- 'segment' => 'searches',
- 'sqlSegment' => 'log_visit.visit_total_searches',
- 'acceptedValues' => 'To select all visits who used internal Site Search, use: &segment=searches>0',
- );
- $segments[] = array(
- 'type' => 'metric',
- 'category' => Piwik::translate('General_Visit'),
- 'name' => 'General_ColumnVisitDuration',
- 'segment' => 'visitDuration',
- 'sqlSegment' => 'log_visit.visit_total_time',
- );
- $segments[] = array(
- 'type' => 'dimension',
- 'category' => Piwik::translate('General_Visit'),
- 'name' => Piwik::translate('General_VisitType'),
- 'segment' => 'visitorType',
- 'acceptedValues' => 'new, returning, returningCustomer' . ". " . Piwik::translate('General_VisitTypeExample', '"&segment=visitorType==returning,visitorType==returningCustomer"'),
- 'sqlSegment' => 'log_visit.visitor_returning',
- 'sqlFilterValue' => function ($type) {
- return $type == "new" ? 0 : ($type == "returning" ? 1 : 2);
- }
- );
- $segments[] = array(
- 'type' => 'metric',
- 'category' => Piwik::translate('General_Visit'),
- 'name' => 'General_DaysSinceLastVisit',
- 'segment' => 'daysSinceLastVisit',
- 'sqlSegment' => 'log_visit.visitor_days_since_last',
- );
- $segments[] = array(
- 'type' => 'metric',
- 'category' => Piwik::translate('General_Visit'),
- 'name' => 'General_DaysSinceFirstVisit',
- 'segment' => 'daysSinceFirstVisit',
- 'sqlSegment' => 'log_visit.visitor_days_since_first',
- );
- $segments[] = array(
- 'type' => 'metric',
- 'category' => Piwik::translate('General_Visit'),
- 'name' => 'General_NumberOfVisits',
- 'segment' => 'visitCount',
- 'sqlSegment' => 'log_visit.visitor_count_visits',
- );
-
- $segments[] = array(
- 'type' => 'dimension',
- 'category' => Piwik::translate('General_Visit'),
- 'name' => 'General_VisitConvertedGoal',
- 'segment' => 'visitConverted',
- 'acceptedValues' => '0, 1',
- 'sqlSegment' => 'log_visit.visit_goal_converted',
- );
-
- $segments[] = array(
- 'type' => 'dimension',
- 'category' => Piwik::translate('General_Visit'),
- 'name' => Piwik::translate('General_EcommerceVisitStatusDesc'),
- 'segment' => 'visitEcommerceStatus',
- 'acceptedValues' => implode(", ", self::$visitEcommerceStatus)
- . '. ' . Piwik::translate('General_EcommerceVisitStatusEg', '"&segment=visitEcommerceStatus==ordered,visitEcommerceStatus==orderedThenAbandonedCart"'),
- 'sqlSegment' => 'log_visit.visit_goal_buyer',
- 'sqlFilterValue' => __NAMESPACE__ . '\API::getVisitEcommerceStatus',
- );
-
- $segments[] = array(
- 'type' => 'metric',
- 'category' => Piwik::translate('General_Visit'),
- 'name' => 'General_DaysSinceLastEcommerceOrder',
- 'segment' => 'daysSinceLastEcommerceOrder',
- 'sqlSegment' => 'log_visit.visitor_days_since_order',
- );
foreach ($segments as &$segment) {
$segment['name'] = Piwik::translate($segment['name']);
@@ -260,36 +190,6 @@ class API extends \Piwik\Plugin\API
return $segments;
}
- static protected $visitEcommerceStatus = array(
- GoalManager::TYPE_BUYER_NONE => 'none',
- GoalManager::TYPE_BUYER_ORDERED => 'ordered',
- GoalManager::TYPE_BUYER_OPEN_CART => 'abandonedCart',
- GoalManager::TYPE_BUYER_ORDERED_AND_OPEN_CART => 'orderedThenAbandonedCart',
- );
-
- /**
- * @ignore
- */
- static public function getVisitEcommerceStatusFromId($id)
- {
- if (!isset(self::$visitEcommerceStatus[$id])) {
- throw new \Exception("Unexpected ECommerce status value ");
- }
- return self::$visitEcommerceStatus[$id];
- }
-
- /**
- * @ignore
- */
- static public function getVisitEcommerceStatus($status)
- {
- $id = array_search($status, self::$visitEcommerceStatus);
- if ($id === false) {
- throw new \Exception("Invalid 'visitEcommerceStatus' segment value $status");
- }
- return $id;
- }
-
private function sortSegments($row1, $row2)
{
$columns = array('type', 'category', 'name', 'segment');
diff --git a/plugins/API/ProcessedReport.php b/plugins/API/ProcessedReport.php
index 4ffdb697ee..7a9d12ae70 100644
--- a/plugins/API/ProcessedReport.php
+++ b/plugins/API/ProcessedReport.php
@@ -20,6 +20,7 @@ use Piwik\Metrics;
use Piwik\MetricsFormatter;
use Piwik\Period;
use Piwik\Piwik;
+use Piwik\Plugin\Report;
use Piwik\Site;
use Piwik\Timer;
use Piwik\Url;
@@ -152,6 +153,12 @@ class ProcessedReport
$availableReports = array();
+ foreach (Report::getAllReports() as $report) {
+ if ($report->isEnabled()) {
+ $availableReports[] = $report->toArray();
+ }
+ }
+
/**
* Triggered when gathering metadata for all available reports.
*
@@ -198,10 +205,13 @@ class ProcessedReport
* TODO: put dimensions section in all about analytics data
*/
Piwik::postEvent('API.getReportMetadata', array(&$availableReports, $parameters));
+
foreach ($availableReports as &$availableReport) {
+ // can be removed once we remove hook API.getReportMetadata
if (!isset($availableReport['metrics'])) {
$availableReport['metrics'] = Metrics::getDefaultMetrics();
}
+ // can be removed once we remove hook API.getReportMetadata
if (!isset($availableReport['processedMetrics'])) {
$availableReport['processedMetrics'] = Metrics::getDefaultProcessedMetrics();
}
@@ -211,6 +221,7 @@ class ProcessedReport
unset($availableReport['metricsDocumentation']);
} else if (!isset($availableReport['metricsDocumentation'])) {
// set metric documentation to default if it's not set
+ // can be removed once we remove hook API.getReportMetadata
$availableReport['metricsDocumentation'] = Metrics::getDefaultMetricsDocumentation();
}
}
@@ -238,7 +249,7 @@ class ProcessedReport
Piwik::postEvent('API.getReportMetadata.end', array(&$availableReports, $parameters));
// Sort results to ensure consistent order
- usort($availableReports, array($this, 'sort'));
+ usort($availableReports, array('\Piwik\Plugin\Report', 'sort'));
// Add the magic API.get report metadata aggregating all plugins API.get API calls automatically
$this->addApiGetMetdata($availableReports);
@@ -310,37 +321,6 @@ class ProcessedReport
}
/**
- * API metadata are sorted by category/name,
- * with a little tweak to replicate the standard Piwik category ordering
- *
- * @param string $a
- * @param string $b
- * @return int
- */
- private function sort($a, $b)
- {
- static $order = null;
- if (is_null($order)) {
- $order = array(
- Piwik::translate('General_MultiSitesSummary'),
- Piwik::translate('VisitsSummary_VisitsSummary'),
- Piwik::translate('Goals_Ecommerce'),
- Piwik::translate('General_Actions'),
- Piwik::translate('Events_Events'),
- Piwik::translate('Actions_SubmenuSitesearch'),
- Piwik::translate('Referrers_Referrers'),
- Piwik::translate('Goals_Goals'),
- Piwik::translate('General_Visitors'),
- Piwik::translate('DevicesDetection_DevicesDetection'),
- Piwik::translate('UserSettings_VisitorSettings'),
- );
- }
- return ($category = strcmp(array_search($a['category'], $order), array_search($b['category'], $order))) == 0
- ? (@$a['order'] < @$b['order'] ? -1 : 1)
- : $category;
- }
-
- /**
* Add the metadata for the API.get report
* In other plugins, this would hook on 'API.getReportMetadata'
*/
diff --git a/plugins/Actions/API.php b/plugins/Actions/API.php
index 60f774536a..c915060885 100644
--- a/plugins/Actions/API.php
+++ b/plugins/Actions/API.php
@@ -17,8 +17,8 @@ use Piwik\Date;
use Piwik\Metrics;
use Piwik\Piwik;
use Piwik\Plugins\CustomVariables\API as APICustomVariables;
+use Piwik\Plugins\Actions\Actions\ActionSiteSearch;
use Piwik\Tracker\Action;
-use Piwik\Tracker\ActionSiteSearch;
use Piwik\Tracker\PageUrl;
/**
diff --git a/plugins/Actions/Actions.php b/plugins/Actions/Actions.php
index f39e150fd7..91042fce4f 100644
--- a/plugins/Actions/Actions.php
+++ b/plugins/Actions/Actions.php
@@ -8,15 +8,12 @@
*/
namespace Piwik\Plugins\Actions;
-use Piwik\API\Request;
use Piwik\ArchiveProcessor;
use Piwik\Common;
use Piwik\Db;
-use Piwik\MetricsFormatter;
-use Piwik\Piwik;
+use Piwik\Site;
use Piwik\Plugin\ViewDataTable;
use Piwik\Plugins\CoreVisualizations\Visualizations\HtmlTable;
-use Piwik\Site;
/**
* Actions plugin
@@ -33,15 +30,57 @@ class Actions extends \Piwik\Plugin
*/
public function getListHooksRegistered()
{
- $hooks = array(
- 'API.getReportMetadata' => 'getReportMetadata',
- 'API.getSegmentDimensionMetadata' => 'getSegmentsMetadata',
+ return array(
'ViewDataTable.configure' => 'configureViewDataTable',
'AssetManager.getStylesheetFiles' => 'getStylesheetFiles',
'AssetManager.getJavaScriptFiles' => 'getJsFiles',
- 'Insights.addReportToOverview' => 'addReportToInsightsOverview'
+ 'Insights.addReportToOverview' => 'addReportToInsightsOverview',
+ 'Metrics.getDefaultMetricTranslations' => 'addMetricTranslations',
+ 'Metrics.getDefaultMetricDocumentationTranslations' => 'addMetricDocumentationTranslations'
);
- return $hooks;
+ }
+
+ public function addMetricTranslations(&$translations)
+ {
+ $metrics = array(
+ 'nb_pageviews' => 'General_ColumnPageviews',
+ 'nb_uniq_pageviews' => 'General_ColumnUniquePageviews',
+ 'nb_downloads' => 'General_Downloads',
+ 'nb_uniq_downloads' => 'Actions_ColumnUniqueDownloads',
+ 'nb_outlinks' => 'General_Outlinks',
+ 'nb_uniq_outlinks' => 'Actions_ColumnUniqueOutlinks',
+ 'nb_searches' => 'Actions_ColumnSearches',
+ 'nb_keywords' => 'Actions_ColumnSiteSearchKeywords',
+ 'avg_time_generation' => 'General_ColumnAverageGenerationTime',
+ 'exit_rate' => 'General_ColumnExitRate',
+ 'entry_nb_visits' => 'General_ColumnEntrances',
+ 'entry_bounce_count' => 'General_ColumnBounces',
+ 'exit_nb_visits' => 'General_ColumnExits',
+ 'nb_pages_per_search' => 'Actions_ColumnPagesPerSearch',
+ 'nb_hits_following_search' => 'General_ColumnViewedAfterSearch',
+ );
+
+ $translations = array_merge($translations, $metrics);
+ }
+
+ public function addMetricDocumentationTranslations(&$translations)
+ {
+ $metrics = array(
+ 'nb_pageviews' => 'General_ColumnPageviewsDocumentation',
+ 'nb_uniq_pageviews' => 'General_ColumnUniquePageviewsDocumentation',
+ 'nb_downloads' => 'Actions_ColumnClicksDocumentation',
+ 'nb_uniq_downloads' => 'Actions_ColumnUniqueClicksDocumentation',
+ 'nb_outlinks' => 'Actions_ColumnClicksDocumentation',
+ 'nb_uniq_outlinks' => 'Actions_ColumnUniqueClicksDocumentation',
+ 'nb_searches' => 'Actions_ColumnSearchesDocumentation',
+ 'avg_time_generation' => 'General_ColumnAverageGenerationTimeDocumentation',
+ 'entry_nb_visits' => 'General_ColumnEntrancesDocumentation',
+ 'entry_bounce_count' => 'General_ColumnBouncesDocumentation',
+ 'exit_nb_visits' => 'General_ColumnExitsDocumentation',
+ 'exit_rate' => 'General_ColumnExitRateDocumentation'
+ );
+
+ $translations = array_merge($translations, $metrics);
}
public function addReportToInsightsOverview(&$reports)
@@ -61,403 +100,6 @@ class Actions extends \Piwik\Plugin
$jsFiles[] = "plugins/Actions/javascripts/actionsDataTable.js";
}
- public function getSegmentsMetadata(&$segments)
- {
- $sqlFilter = '\\Piwik\\Tracker\\TableLogAction::getIdActionFromSegment';
-
- // entry and exit pages of visit
- $segments[] = array(
- 'type' => 'dimension',
- 'category' => 'General_Actions',
- 'name' => 'Actions_ColumnEntryPageURL',
- 'segment' => 'entryPageUrl',
- 'sqlSegment' => 'log_visit.visit_entry_idaction_url',
- 'sqlFilter' => $sqlFilter,
- );
- $segments[] = array(
- 'type' => 'dimension',
- 'category' => 'General_Actions',
- 'name' => 'Actions_ColumnEntryPageTitle',
- 'segment' => 'entryPageTitle',
- 'sqlSegment' => 'log_visit.visit_entry_idaction_name',
- 'sqlFilter' => $sqlFilter,
- );
- $segments[] = array(
- 'type' => 'dimension',
- 'category' => 'General_Actions',
- 'name' => 'Actions_ColumnExitPageURL',
- 'segment' => 'exitPageUrl',
- 'sqlSegment' => 'log_visit.visit_exit_idaction_url',
- 'sqlFilter' => $sqlFilter,
- );
- $segments[] = array(
- 'type' => 'dimension',
- 'category' => 'General_Actions',
- 'name' => 'Actions_ColumnExitPageTitle',
- 'segment' => 'exitPageTitle',
- 'sqlSegment' => 'log_visit.visit_exit_idaction_name',
- 'sqlFilter' => $sqlFilter,
- );
-
- // single pages
- $segments[] = array(
- 'type' => 'dimension',
- 'category' => 'General_Actions',
- 'name' => 'Actions_ColumnPageURL',
- 'segment' => 'pageUrl',
- 'sqlSegment' => 'log_link_visit_action.idaction_url',
- 'sqlFilter' => $sqlFilter,
- 'acceptedValues' => "All these segments must be URL encoded, for example: " . urlencode('http://example.com/path/page?query'),
- );
- $segments[] = array(
- 'type' => 'dimension',
- 'category' => 'General_Actions',
- 'name' => 'Actions_ColumnPageName',
- 'segment' => 'pageTitle',
- 'sqlSegment' => 'log_link_visit_action.idaction_name',
- 'sqlFilter' => $sqlFilter,
- );
- $segments[] = array(
- 'type' => 'dimension',
- 'category' => 'General_Actions',
- 'name' => 'Actions_SiteSearchKeyword',
- 'segment' => 'siteSearchKeyword',
- 'sqlSegment' => 'log_link_visit_action.idaction_name',
- 'sqlFilter' => $sqlFilter,
- );
- }
-
- public function getReportMetadata(&$reports)
- {
- $reports[] = array(
- 'category' => Piwik::translate('General_Actions'),
- 'name' => Piwik::translate('General_Actions') . ' - ' . Piwik::translate('General_MainMetrics'),
- 'module' => 'Actions',
- 'action' => 'get',
- 'metrics' => array(
- 'nb_pageviews' => Piwik::translate('General_ColumnPageviews'),
- 'nb_uniq_pageviews' => Piwik::translate('General_ColumnUniquePageviews'),
- 'nb_downloads' => Piwik::translate('General_Downloads'),
- 'nb_uniq_downloads' => Piwik::translate('Actions_ColumnUniqueDownloads'),
- 'nb_outlinks' => Piwik::translate('General_Outlinks'),
- 'nb_uniq_outlinks' => Piwik::translate('Actions_ColumnUniqueOutlinks'),
- 'nb_searches' => Piwik::translate('Actions_ColumnSearches'),
- 'nb_keywords' => Piwik::translate('Actions_ColumnSiteSearchKeywords'),
- 'avg_time_generation' => Piwik::translate('General_ColumnAverageGenerationTime'),
- ),
- 'metricsDocumentation' => array(
- 'nb_pageviews' => Piwik::translate('General_ColumnPageviewsDocumentation'),
- 'nb_uniq_pageviews' => Piwik::translate('General_ColumnUniquePageviewsDocumentation'),
- 'nb_downloads' => Piwik::translate('Actions_ColumnClicksDocumentation'),
- 'nb_uniq_downloads' => Piwik::translate('Actions_ColumnUniqueClicksDocumentation'),
- 'nb_outlinks' => Piwik::translate('Actions_ColumnClicksDocumentation'),
- 'nb_uniq_outlinks' => Piwik::translate('Actions_ColumnUniqueClicksDocumentation'),
- 'nb_searches' => Piwik::translate('Actions_ColumnSearchesDocumentation'),
- 'avg_time_generation' => Piwik::translate('General_ColumnAverageGenerationTimeDocumentation'),
-// 'nb_keywords' => Piwik::translate('Actions_ColumnSiteSearchKeywords'),
- ),
- 'processedMetrics' => false,
- 'order' => 1
- );
-
- $metrics = array(
- 'nb_hits' => Piwik::translate('General_ColumnPageviews'),
- 'nb_visits' => Piwik::translate('General_ColumnUniquePageviews'),
- 'bounce_rate' => Piwik::translate('General_ColumnBounceRate'),
- 'avg_time_on_page' => Piwik::translate('General_ColumnAverageTimeOnPage'),
- 'exit_rate' => Piwik::translate('General_ColumnExitRate'),
- 'avg_time_generation' => Piwik::translate('General_ColumnAverageGenerationTime')
- );
-
- $documentation = array(
- 'nb_hits' => Piwik::translate('General_ColumnPageviewsDocumentation'),
- 'nb_visits' => Piwik::translate('General_ColumnUniquePageviewsDocumentation'),
- 'bounce_rate' => Piwik::translate('General_ColumnPageBounceRateDocumentation'),
- 'avg_time_on_page' => Piwik::translate('General_ColumnAverageTimeOnPageDocumentation'),
- 'exit_rate' => Piwik::translate('General_ColumnExitRateDocumentation'),
- 'avg_time_generation' => Piwik::translate('General_ColumnAverageGenerationTimeDocumentation'),
- );
-
- // pages report
- $reports[] = array(
- 'category' => Piwik::translate('General_Actions'),
- 'name' => Piwik::translate('Actions_PageUrls'),
- 'module' => 'Actions',
- 'action' => 'getPageUrls',
- 'dimension' => Piwik::translate('Actions_ColumnPageURL'),
- 'metrics' => $metrics,
- 'metricsDocumentation' => $documentation,
- 'documentation' => Piwik::translate('Actions_PagesReportDocumentation', '<br />')
- . '<br />' . Piwik::translate('General_UsePlusMinusIconsDocumentation'),
- 'processedMetrics' => false,
- 'actionToLoadSubTables' => 'getPageUrls',
- 'order' => 2
- );
-
- // entry pages report
- $reports[] = array(
- 'category' => Piwik::translate('General_Actions'),
- 'name' => Piwik::translate('Actions_SubmenuPagesEntry'),
- 'module' => 'Actions',
- 'action' => 'getEntryPageUrls',
- 'dimension' => Piwik::translate('Actions_ColumnPageURL'),
- 'metrics' => array(
- 'entry_nb_visits' => Piwik::translate('General_ColumnEntrances'),
- 'entry_bounce_count' => Piwik::translate('General_ColumnBounces'),
- 'bounce_rate' => Piwik::translate('General_ColumnBounceRate'),
- ),
- 'metricsDocumentation' => array(
- 'entry_nb_visits' => Piwik::translate('General_ColumnEntrancesDocumentation'),
- 'entry_bounce_count' => Piwik::translate('General_ColumnBouncesDocumentation'),
- 'bounce_rate' => Piwik::translate('General_ColumnBounceRateForPageDocumentation')
- ),
- 'documentation' => Piwik::translate('Actions_EntryPagesReportDocumentation', '<br />')
- . ' ' . Piwik::translate('General_UsePlusMinusIconsDocumentation'),
- 'processedMetrics' => false,
- 'actionToLoadSubTables' => 'getEntryPageUrls',
- 'order' => 3
- );
-
- // exit pages report
- $reports[] = array(
- 'category' => Piwik::translate('General_Actions'),
- 'name' => Piwik::translate('Actions_SubmenuPagesExit'),
- 'module' => 'Actions',
- 'action' => 'getExitPageUrls',
- 'dimension' => Piwik::translate('Actions_ColumnPageURL'),
- 'metrics' => array(
- 'exit_nb_visits' => Piwik::translate('General_ColumnExits'),
- 'nb_visits' => Piwik::translate('General_ColumnUniquePageviews'),
- 'exit_rate' => Piwik::translate('General_ColumnExitRate')
- ),
- 'metricsDocumentation' => array(
- 'exit_nb_visits' => Piwik::translate('General_ColumnExitsDocumentation'),
- 'nb_visits' => Piwik::translate('General_ColumnUniquePageviewsDocumentation'),
- 'exit_rate' => Piwik::translate('General_ColumnExitRateDocumentation')
- ),
- 'documentation' => Piwik::translate('Actions_ExitPagesReportDocumentation', '<br />')
- . ' ' . Piwik::translate('General_UsePlusMinusIconsDocumentation'),
- 'processedMetrics' => false,
- 'actionToLoadSubTables' => 'getExitPageUrls',
- 'order' => 4
- );
-
- // page titles report
- $reports[] = array(
- 'category' => Piwik::translate('General_Actions'),
- 'name' => Piwik::translate('Actions_SubmenuPageTitles'),
- 'module' => 'Actions',
- 'action' => 'getPageTitles',
- 'dimension' => Piwik::translate('Actions_ColumnPageName'),
- 'metrics' => $metrics,
- 'metricsDocumentation' => $documentation,
- 'documentation' => Piwik::translate('Actions_PageTitlesReportDocumentation', array('<br />', htmlentities('<title>'))),
- 'processedMetrics' => false,
- 'actionToLoadSubTables' => 'getPageTitles',
- 'order' => 5,
-
- );
-
- // entry page titles report
- $reports[] = array(
- 'category' => Piwik::translate('General_Actions'),
- 'name' => Piwik::translate('Actions_EntryPageTitles'),
- 'module' => 'Actions',
- 'action' => 'getEntryPageTitles',
- 'dimension' => Piwik::translate('Actions_ColumnPageName'),
- 'metrics' => array(
- 'entry_nb_visits' => Piwik::translate('General_ColumnEntrances'),
- 'entry_bounce_count' => Piwik::translate('General_ColumnBounces'),
- 'bounce_rate' => Piwik::translate('General_ColumnBounceRate'),
- ),
- 'metricsDocumentation' => array(
- 'entry_nb_visits' => Piwik::translate('General_ColumnEntrancesDocumentation'),
- 'entry_bounce_count' => Piwik::translate('General_ColumnBouncesDocumentation'),
- 'bounce_rate' => Piwik::translate('General_ColumnBounceRateForPageDocumentation')
- ),
- 'documentation' => Piwik::translate('Actions_ExitPageTitlesReportDocumentation', '<br />')
- . ' ' . Piwik::translate('General_UsePlusMinusIconsDocumentation'),
- 'processedMetrics' => false,
- 'actionToLoadSubTables' => 'getEntryPageTitles',
- 'order' => 6
- );
-
- // exit page titles report
- $reports[] = array(
- 'category' => Piwik::translate('General_Actions'),
- 'name' => Piwik::translate('Actions_ExitPageTitles'),
- 'module' => 'Actions',
- 'action' => 'getExitPageTitles',
- 'dimension' => Piwik::translate('Actions_ColumnPageName'),
- 'metrics' => array(
- 'exit_nb_visits' => Piwik::translate('General_ColumnExits'),
- 'nb_visits' => Piwik::translate('General_ColumnUniquePageviews'),
- 'exit_rate' => Piwik::translate('General_ColumnExitRate')
- ),
- 'metricsDocumentation' => array(
- 'exit_nb_visits' => Piwik::translate('General_ColumnExitsDocumentation'),
- 'nb_visits' => Piwik::translate('General_ColumnUniquePageviewsDocumentation'),
- 'exit_rate' => Piwik::translate('General_ColumnExitRateDocumentation')
- ),
- 'documentation' => Piwik::translate('Actions_EntryPageTitlesReportDocumentation', '<br />')
- . ' ' . Piwik::translate('General_UsePlusMinusIconsDocumentation'),
- 'processedMetrics' => false,
- 'actionToLoadSubTables' => 'getExitPageTitles',
- 'order' => 7
- );
-
- $documentation = array(
- 'nb_visits' => Piwik::translate('Actions_ColumnUniqueClicksDocumentation'),
- 'nb_hits' => Piwik::translate('Actions_ColumnClicksDocumentation')
- );
-
- // outlinks report
- $reports[] = array(
- 'category' => Piwik::translate('General_Actions'),
- 'name' => Piwik::translate('General_Outlinks'),
- 'module' => 'Actions',
- 'action' => 'getOutlinks',
- 'dimension' => Piwik::translate('Actions_ColumnClickedURL'),
- 'metrics' => array(
- 'nb_visits' => Piwik::translate('Actions_ColumnUniqueClicks'),
- 'nb_hits' => Piwik::translate('Actions_ColumnClicks')
- ),
- 'metricsDocumentation' => $documentation,
- 'documentation' => Piwik::translate('Actions_OutlinksReportDocumentation') . ' '
- . Piwik::translate('Actions_OutlinkDocumentation') . '<br />'
- . Piwik::translate('General_UsePlusMinusIconsDocumentation'),
- 'processedMetrics' => false,
- 'actionToLoadSubTables' => 'getOutlinks',
- 'order' => 8,
- );
-
- // downloads report
- $reports[] = array(
- 'category' => Piwik::translate('General_Actions'),
- 'name' => Piwik::translate('General_Downloads'),
- 'module' => 'Actions',
- 'action' => 'getDownloads',
- 'dimension' => Piwik::translate('Actions_ColumnDownloadURL'),
- 'metrics' => array(
- 'nb_visits' => Piwik::translate('Actions_ColumnUniqueDownloads'),
- 'nb_hits' => Piwik::translate('General_Downloads')
- ),
- 'metricsDocumentation' => $documentation,
- 'documentation' => Piwik::translate('Actions_DownloadsReportDocumentation', '<br />'),
- 'processedMetrics' => false,
- 'actionToLoadSubTables' => 'getDownloads',
- 'order' => 9,
- );
-
- if ($this->isSiteSearchEnabled()) {
- // Search Keywords
- $reports[] = array(
- 'category' => Piwik::translate('Actions_SubmenuSitesearch'),
- 'name' => Piwik::translate('Actions_WidgetSearchKeywords'),
- 'module' => 'Actions',
- 'action' => 'getSiteSearchKeywords',
- 'dimension' => Piwik::translate('General_ColumnKeyword'),
- 'metrics' => array(
- 'nb_visits' => Piwik::translate('Actions_ColumnSearches'),
- 'nb_pages_per_search' => Piwik::translate('Actions_ColumnPagesPerSearch'),
- 'exit_rate' => Piwik::translate('Actions_ColumnSearchExits'),
- ),
- 'metricsDocumentation' => array(
- 'nb_visits' => Piwik::translate('Actions_ColumnSearchesDocumentation'),
- 'nb_pages_per_search' => Piwik::translate('Actions_ColumnPagesPerSearchDocumentation'),
- 'exit_rate' => Piwik::translate('Actions_ColumnSearchExitsDocumentation'),
- ),
- 'documentation' => Piwik::translate('Actions_SiteSearchKeywordsDocumentation') . '<br/><br/>' . Piwik::translate('Actions_SiteSearchIntro') . '<br/><br/>'
- . '<a href="http://piwik.org/docs/site-search/" target="_blank">' . Piwik::translate('Actions_LearnMoreAboutSiteSearchLink') . '</a>',
- 'processedMetrics' => false,
- 'order' => 15
- );
- // No Result Search Keywords
- $reports[] = array(
- 'category' => Piwik::translate('Actions_SubmenuSitesearch'),
- 'name' => Piwik::translate('Actions_WidgetSearchNoResultKeywords'),
- 'module' => 'Actions',
- 'action' => 'getSiteSearchNoResultKeywords',
- 'dimension' => Piwik::translate('Actions_ColumnNoResultKeyword'),
- 'metrics' => array(
- 'nb_visits' => Piwik::translate('Actions_ColumnSearches'),
- 'exit_rate' => Piwik::translate('Actions_ColumnSearchExits'),
- ),
- 'metricsDocumentation' => array(
- 'nb_visits' => Piwik::translate('Actions_ColumnSearchesDocumentation'),
- 'exit_rate' => Piwik::translate('Actions_ColumnSearchExitsDocumentation'),
- ),
- 'documentation' => Piwik::translate('Actions_SiteSearchIntro') . '<br /><br />' . Piwik::translate('Actions_SiteSearchKeywordsNoResultDocumentation'),
- 'processedMetrics' => false,
- 'order' => 16
- );
-
- if (self::isCustomVariablesPluginsEnabled()) {
- // Search Categories
- $reports[] = array(
- 'category' => Piwik::translate('Actions_SubmenuSitesearch'),
- 'name' => Piwik::translate('Actions_WidgetSearchCategories'),
- 'module' => 'Actions',
- 'action' => 'getSiteSearchCategories',
- 'dimension' => Piwik::translate('Actions_ColumnSearchCategory'),
- 'metrics' => array(
- 'nb_visits' => Piwik::translate('Actions_ColumnSearches'),
- 'nb_pages_per_search' => Piwik::translate('Actions_ColumnPagesPerSearch'),
- 'exit_rate' => Piwik::translate('Actions_ColumnSearchExits'),
- ),
- 'metricsDocumentation' => array(
- 'nb_visits' => Piwik::translate('Actions_ColumnSearchesDocumentation'),
- 'nb_pages_per_search' => Piwik::translate('Actions_ColumnPagesPerSearchDocumentation'),
- 'exit_rate' => Piwik::translate('Actions_ColumnSearchExitsDocumentation'),
- ),
- 'documentation' => Piwik::translate('Actions_SiteSearchCategories1') . '<br/>' . Piwik::translate('Actions_SiteSearchCategories2'),
- 'processedMetrics' => false,
- 'order' => 17
- );
- }
-
- $documentation = Piwik::translate('Actions_SiteSearchFollowingPagesDoc') . '<br/>' . Piwik::translate('General_UsePlusMinusIconsDocumentation');
- // Pages URLs following Search
- $reports[] = array(
- 'category' => Piwik::translate('Actions_SubmenuSitesearch'),
- 'name' => Piwik::translate('Actions_WidgetPageUrlsFollowingSearch'),
- 'module' => 'Actions',
- 'action' => 'getPageUrlsFollowingSiteSearch',
- 'dimension' => Piwik::translate('General_ColumnDestinationPage'),
- 'metrics' => array(
- 'nb_hits_following_search' => Piwik::translate('General_ColumnViewedAfterSearch'),
- 'nb_hits' => Piwik::translate('General_ColumnTotalPageviews'),
- ),
- 'metricsDocumentation' => array(
- 'nb_hits_following_search' => Piwik::translate('General_ColumnViewedAfterSearchDocumentation'),
- 'nb_hits' => Piwik::translate('General_ColumnPageviewsDocumentation'),
- ),
- 'documentation' => $documentation,
- 'processedMetrics' => false,
- 'order' => 18
- );
- // Pages Titles following Search
- $reports[] = array(
- 'category' => Piwik::translate('Actions_SubmenuSitesearch'),
- 'name' => Piwik::translate('Actions_WidgetPageTitlesFollowingSearch'),
- 'module' => 'Actions',
- 'action' => 'getPageTitlesFollowingSiteSearch',
- 'dimension' => Piwik::translate('General_ColumnDestinationPage'),
- 'metrics' => array(
- 'nb_hits_following_search' => Piwik::translate('General_ColumnViewedAfterSearch'),
- 'nb_hits' => Piwik::translate('General_ColumnTotalPageviews'),
- ),
- 'metricsDocumentation' => array(
- 'nb_hits_following_search' => Piwik::translate('General_ColumnViewedAfterSearchDocumentation'),
- 'nb_hits' => Piwik::translate('General_ColumnPageviewsDocumentation'),
- ),
- 'documentation' => $documentation,
- 'processedMetrics' => false,
- 'order' => 19
- );
- }
- }
-
public function isSiteSearchEnabled()
{
$idSite = Common::getRequestVar('idSite', 0, 'int');
@@ -495,48 +137,6 @@ class Actions extends \Piwik\Plugin
public function configureViewDataTable(ViewDataTable $view)
{
- switch ($view->requestConfig->apiMethodToRequestDataTable) {
- case 'Actions.getPageUrls':
- $this->configureViewForPageUrls($view);
- break;
- case 'Actions.getEntryPageUrls':
- $this->configureViewForEntryPageUrls($view);
- break;
- case 'Actions.getExitPageUrls':
- $this->configureViewForExitPageUrls($view);
- break;
- case 'Actions.getSiteSearchKeywords':
- $this->configureViewForSiteSearchKeywords($view);
- break;
- case 'Actions.getSiteSearchNoResultKeywords':
- $this->configureViewForSiteSearchNoResultKeywords($view);
- break;
- case 'Actions.getSiteSearchCategories':
- $this->configureViewForSiteSearchCategories($view);
- break;
- case 'Actions.getPageUrlsFollowingSiteSearch':
- $this->configureViewForGetPageUrlsOrTitlesFollowingSiteSearch($view, false);
- break;
- case 'Actions.getPageTitlesFollowingSiteSearch':
- $this->configureViewForGetPageUrlsOrTitlesFollowingSiteSearch($view, true);
- break;
- case 'Actions.getPageTitles':
- $this->configureViewForGetPageTitles($view);
- break;
- case 'Actions.getEntryPageTitles':
- $this->configureViewForGetEntryPageTitles($view);
- break;
- case 'Actions.getExitPageTitles':
- $this->configureViewForGetExitPageTitles($view);
- break;
- case 'Actions.getDownloads':
- $this->configureViewForGetDownloads($view);
- break;
- case 'Actions.getOutlinks':
- $this->configureViewForGetOutlinks($view);
- break;
- }
-
if ($this->pluginName == $view->requestConfig->getApiModuleToRequest()) {
if ($view->isRequestingSingleDataTable()) {
// make sure custom visualizations are shown on actions reports
@@ -548,36 +148,6 @@ class Actions extends \Piwik\Plugin
}
}
- private function addBaseDisplayProperties(ViewDataTable $view)
- {
- $view->config->datatable_js_type = 'ActionsDataTable';
- $view->config->search_recursive = true;
- $view->config->show_table_all_columns = false;
- $view->requestConfig->filter_limit = self::ACTIONS_REPORT_ROWS_DISPLAY;
- $view->config->show_all_views_icons = false;
-
- if ($view->isViewDataTableId(HtmlTable::ID)) {
- $view->config->show_embedded_subtable = true;
- }
-
- if (Request::shouldLoadExpanded()) {
-
- if ($view->isViewDataTableId(HtmlTable::ID)) {
- $view->config->show_expanded = true;
- }
-
- $view->config->filters[] = function ($dataTable) {
- Actions::setDataTableRowLevels($dataTable);
- };
- }
-
- $view->config->filters[] = function ($dataTable) use ($view) {
- if ($view->isViewDataTableId(HtmlTable::ID)) {
- $view->config->datatable_css_class = 'dataTableActions';
- }
- };
- }
-
/**
* @param \Piwik\DataTable $dataTable
* @param int $level
@@ -594,297 +164,6 @@ class Actions extends \Piwik\Plugin
}
}
- private function addExcludeLowPopDisplayProperties(ViewDataTable $view)
- {
- if (Common::getRequestVar('enable_filter_excludelowpop', '0', 'string') != '0') {
- $view->requestConfig->filter_excludelowpop = 'nb_hits';
- $view->requestConfig->filter_excludelowpop_value = function () {
- // computing minimum value to exclude (2 percent of the total number of actions)
- $visitsInfo = \Piwik\Plugins\VisitsSummary\Controller::getVisitsSummary()->getFirstRow();
- $nbActions = $visitsInfo->getColumn('nb_actions');
- $nbActionsLowPopulationThreshold = floor(0.02 * $nbActions);
-
- // we remove 1 to make sure some actions/downloads are displayed in the case we have a very few of them
- // and each of them has 1 or 2 hits...
- return min($visitsInfo->getColumn('max_actions') - 1, $nbActionsLowPopulationThreshold - 1);
- };
- }
- }
-
- private function addPageDisplayProperties(ViewDataTable $view)
- {
- $view->config->addTranslations(array(
- 'nb_hits' => Piwik::translate('General_ColumnPageviews'),
- 'nb_visits' => Piwik::translate('General_ColumnUniquePageviews'),
- 'avg_time_on_page' => Piwik::translate('General_ColumnAverageTimeOnPage'),
- 'bounce_rate' => Piwik::translate('General_ColumnBounceRate'),
- 'exit_rate' => Piwik::translate('General_ColumnExitRate'),
- 'avg_time_generation' => Piwik::translate('General_ColumnAverageGenerationTime'),
- ));
-
- // prettify avg_time_on_page column
- $getPrettyTimeFromSeconds = '\Piwik\MetricsFormatter::getPrettyTimeFromSeconds';
- $view->config->filters[] = array('ColumnCallbackReplace', array('avg_time_on_page', $getPrettyTimeFromSeconds));
-
- // prettify avg_time_generation column
- $avgTimeCallback = function ($time) {
- return $time ? MetricsFormatter::getPrettyTimeFromSeconds($time, true, true, false) : "-";
- };
- $view->config->filters[] = array('ColumnCallbackReplace', array('avg_time_generation', $avgTimeCallback));
-
- // add avg_generation_time tooltip
- $tooltipCallback = function ($hits, $min, $max) {
- if (!$hits) {
- return false;
- }
-
- return Piwik::translate("Actions_AvgGenerationTimeTooltip", array(
- $hits,
- "<br />",
- MetricsFormatter::getPrettyTimeFromSeconds($min),
- MetricsFormatter::getPrettyTimeFromSeconds($max)
- ));
- };
- $view->config->filters[] = array('ColumnCallbackAddMetadata',
- array(
- array('nb_hits_with_time_generation', 'min_time_generation', 'max_time_generation'),
- 'avg_time_generation_tooltip',
- $tooltipCallback
- )
- );
-
- $this->addExcludeLowPopDisplayProperties($view);
- }
-
- public function configureViewForPageUrls(ViewDataTable $view)
- {
- $view->config->addTranslation('label', Piwik::translate('Actions_ColumnPageURL'));
- $view->config->columns_to_display = array('label', 'nb_hits', 'nb_visits', 'bounce_rate',
- 'avg_time_on_page', 'exit_rate', 'avg_time_generation');
-
- $this->addPageDisplayProperties($view);
- $this->addBaseDisplayProperties($view);
- }
-
- public function configureViewForEntryPageUrls(ViewDataTable $view)
- {
- // link to the page, not just the report, but only if not a widget
- $widget = Common::getRequestVar('widget', false);
-
- $view->config->self_url = Request::getCurrentUrlWithoutGenericFilters(array(
- 'module' => 'Actions',
- 'action' => $widget === false ? 'indexEntryPageUrls' : 'getEntryPageUrls'
- ));
-
- $view->config->addTranslations(array(
- 'label' => Piwik::translate('Actions_ColumnEntryPageURL'),
- 'entry_bounce_count' => Piwik::translate('General_ColumnBounces'),
- 'entry_nb_visits' => Piwik::translate('General_ColumnEntrances'))
- );
-
- $view->config->title = Piwik::translate('Actions_SubmenuPagesEntry');
- $view->config->addRelatedReport('Actions.getEntryPageTitles', Piwik::translate('Actions_EntryPageTitles'));
- $view->config->columns_to_display = array('label', 'entry_nb_visits', 'entry_bounce_count', 'bounce_rate');
- $view->requestConfig->filter_sort_column = 'entry_nb_visits';
- $view->requestConfig->filter_sort_order = 'desc';
-
- $this->addPageDisplayProperties($view);
- $this->addBaseDisplayProperties($view);
- }
-
- public function configureViewForExitPageUrls(ViewDataTable $view)
- {
- // link to the page, not just the report, but only if not a widget
- $widget = Common::getRequestVar('widget', false);
-
- $view->config->self_url = Request::getCurrentUrlWithoutGenericFilters(array(
- 'module' => 'Actions',
- 'action' => $widget === false ? 'indexExitPageUrls' : 'getExitPageUrls'
- ));
-
- $view->config->addTranslations(array(
- 'label' => Piwik::translate('Actions_ColumnExitPageURL'),
- 'exit_nb_visits' => Piwik::translate('General_ColumnExits'))
- );
-
- $view->config->title = Piwik::translate('Actions_SubmenuPagesExit');
- $view->config->addRelatedReport('Actions.getExitPageTitles', Piwik::translate('Actions_ExitPageTitles'));
-
- $view->config->columns_to_display = array('label', 'exit_nb_visits', 'nb_visits', 'exit_rate');
- $view->requestConfig->filter_sort_column = 'exit_nb_visits';
- $view->requestConfig->filter_sort_order = 'desc';
-
- $this->addPageDisplayProperties($view);
- $this->addBaseDisplayProperties($view);
- }
-
- private function addSiteSearchDisplayProperties(ViewDataTable $view)
- {
- $view->config->addTranslations(array(
- 'nb_visits' => Piwik::translate('Actions_ColumnSearches'),
- 'exit_rate' => str_replace("% ", "%&nbsp;", Piwik::translate('Actions_ColumnSearchExits')),
- 'nb_pages_per_search' => Piwik::translate('Actions_ColumnPagesPerSearch')
- ));
-
- $view->config->show_bar_chart = false;
- $view->config->show_table_all_columns = false;
- }
-
- public function configureViewForSiteSearchKeywords(ViewDataTable $view)
- {
- $view->config->addTranslation('label', Piwik::translate('General_ColumnKeyword'));
- $view->config->columns_to_display = array('label', 'nb_visits', 'nb_pages_per_search', 'exit_rate');
-
- $this->addSiteSearchDisplayProperties($view);
- }
-
- public function configureViewForSiteSearchNoResultKeywords(ViewDataTable $view)
- {
- $view->config->addTranslation('label', Piwik::translate('Actions_ColumnNoResultKeyword'));
- $view->config->columns_to_display = array('label', 'nb_visits', 'exit_rate');
-
- $this->addSiteSearchDisplayProperties($view);
- }
-
- public function configureViewForSiteSearchCategories(ViewDataTable $view)
- {
- $view->config->addTranslations(array(
- 'label' => Piwik::translate('Actions_ColumnSearchCategory'),
- 'nb_visits' => Piwik::translate('Actions_ColumnSearches'),
- 'nb_pages_per_search' => Piwik::translate('Actions_ColumnPagesPerSearch')
- ));
-
- $view->config->columns_to_display = array('label', 'nb_visits', 'nb_pages_per_search');
- $view->config->show_table_all_columns = false;
- $view->config->show_bar_chart = false;
-
- if ($view->isViewDataTableId(HtmlTable::ID)) {
- $view->config->disable_row_evolution = false;
- }
- }
-
- public function configureViewForGetPageUrlsOrTitlesFollowingSiteSearch(ViewDataTable $view, $isTitle)
- {
- $title = $isTitle ? Piwik::translate('Actions_WidgetPageTitlesFollowingSearch')
- : Piwik::translate('Actions_WidgetPageUrlsFollowingSearch');
-
- $relatedReports = array(
- 'Actions.getPageTitlesFollowingSiteSearch' => Piwik::translate('Actions_WidgetPageTitlesFollowingSearch'),
- 'Actions.getPageUrlsFollowingSiteSearch' => Piwik::translate('Actions_WidgetPageUrlsFollowingSearch'),
- );
-
- $view->config->addRelatedReports($relatedReports);
- $view->config->addTranslations(array(
- 'label' => Piwik::translate('General_ColumnDestinationPage'),
- 'nb_hits_following_search' => Piwik::translate('General_ColumnViewedAfterSearch'),
- 'nb_hits' => Piwik::translate('General_ColumnTotalPageviews')
- ));
-
- $view->config->title = $title;
- $view->config->columns_to_display = array('label', 'nb_hits_following_search', 'nb_hits');
- $view->config->show_exclude_low_population = false;
- $view->requestConfig->filter_sort_column = 'nb_hits_following_search';
- $view->requestConfig->filter_sort_order = 'desc';
-
- $this->addExcludeLowPopDisplayProperties($view);
- $this->addBaseDisplayProperties($view);
- }
-
- public function configureViewForGetPageTitles(ViewDataTable $view)
- {
- // link to the page, not just the report, but only if not a widget
- $widget = Common::getRequestVar('widget', false);
-
- $view->config->self_url = Request::getCurrentUrlWithoutGenericFilters(array(
- 'module' => 'Actions',
- 'action' => $widget === false ? 'indexPageTitles' : 'getPageTitles'
- ));
-
- $view->config->title = Piwik::translate('Actions_SubmenuPageTitles');
- $view->config->addRelatedReports(array(
- 'Actions.getEntryPageTitles' => Piwik::translate('Actions_EntryPageTitles'),
- 'Actions.getExitPageTitles' => Piwik::translate('Actions_ExitPageTitles'),
- ));
-
- $view->config->addTranslation('label', Piwik::translate('Actions_ColumnPageName'));
- $view->config->columns_to_display = array('label', 'nb_hits', 'nb_visits', 'bounce_rate',
- 'avg_time_on_page', 'exit_rate', 'avg_time_generation');
-
- $this->addPageDisplayProperties($view);
- $this->addBaseDisplayProperties($view);
- }
-
- public function configureViewForGetEntryPageTitles(ViewDataTable $view)
- {
- $entryPageUrlAction =
- Common::getRequestVar('widget', false) === false ? 'indexEntryPageUrls' : 'getEntryPageUrls';
- $view->config->addTranslations(array(
- 'label' => Piwik::translate('Actions_ColumnEntryPageTitle'),
- 'entry_bounce_count' => Piwik::translate('General_ColumnBounces'),
- 'entry_nb_visits' => Piwik::translate('General_ColumnEntrances'),
- ));
- $view->config->addRelatedReports(array(
- 'Actions.getPageTitles' => Piwik::translate('Actions_SubmenuPageTitles'),
- "Actions.$entryPageUrlAction" => Piwik::translate('Actions_SubmenuPagesEntry')
- ));
-
- $view->config->columns_to_display = array('label', 'entry_nb_visits', 'entry_bounce_count', 'bounce_rate');
- $view->config->title = Piwik::translate('Actions_EntryPageTitles');
-
- $view->requestConfig->filter_sort_column = 'entry_nb_visits';
-
- $this->addPageDisplayProperties($view);
- $this->addBaseDisplayProperties($view);
- }
-
- public function configureViewForGetExitPageTitles(ViewDataTable $view)
- {
- $exitPageUrlAction =
- Common::getRequestVar('widget', false) === false ? 'indexExitPageUrls' : 'getExitPageUrls';
-
- $view->config->addTranslations(array(
- 'label' => Piwik::translate('Actions_ColumnExitPageTitle'),
- 'exit_nb_visits' => Piwik::translate('General_ColumnExits'),
- ));
- $view->config->addRelatedReports(array(
- 'Actions.getPageTitles' => Piwik::translate('Actions_SubmenuPageTitles'),
- "Actions.$exitPageUrlAction" => Piwik::translate('Actions_SubmenuPagesExit'),
- ));
-
- $view->config->title = Piwik::translate('Actions_ExitPageTitles');
- $view->config->columns_to_display = array('label', 'exit_nb_visits', 'nb_visits', 'exit_rate');
-
- $this->addPageDisplayProperties($view);
- $this->addBaseDisplayProperties($view);
- }
-
- public function configureViewForGetDownloads(ViewDataTable $view)
- {
- $view->config->addTranslations(array(
- 'label' => Piwik::translate('Actions_ColumnDownloadURL'),
- 'nb_visits' => Piwik::translate('Actions_ColumnUniqueDownloads'),
- 'nb_hits' => Piwik::translate('General_Downloads'),
- ));
-
- $view->config->columns_to_display = array('label', 'nb_visits', 'nb_hits');
- $view->config->show_exclude_low_population = false;
-
- $this->addBaseDisplayProperties($view);
- }
-
- public function configureViewForGetOutlinks(ViewDataTable $view)
- {
- $view->config->addTranslations(array(
- 'label' => Piwik::translate('Actions_ColumnClickedURL'),
- 'nb_visits' => Piwik::translate('Actions_ColumnUniqueClicks'),
- 'nb_hits' => Piwik::translate('Actions_ColumnClicks'),
- ));
-
- $view->config->columns_to_display = array('label', 'nb_visits', 'nb_hits');
- $view->config->show_exclude_low_population = false;
-
- $this->addBaseDisplayProperties($view);
- }
}
diff --git a/core/Tracker/ActionClickUrl.php b/plugins/Actions/Actions/ActionClickUrl.php
index cd05491293..471a91a84a 100644
--- a/core/Tracker/ActionClickUrl.php
+++ b/plugins/Actions/Actions/ActionClickUrl.php
@@ -7,37 +7,46 @@
*
*/
-namespace Piwik\Tracker;
+namespace Piwik\Plugins\Actions\Actions;
use Piwik\Common;
-use Piwik\Tracker;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visit;
/**
- * This class represents a download or an outlink.
+ * This class represents an outlink.
* This is a particular type of Action: it has no 'name'
*
*/
class ActionClickUrl extends Action
{
- function __construct($type, $url, Request $request)
+ public function __construct(Request $request)
{
- parent::__construct($type, $request);
- $this->setActionUrl($url);
+ parent::__construct(self::TYPE_OUTLINK, $request);
+ $this->setActionUrl($request->getParam('link'));
+ }
+
+ public function shouldHandle()
+ {
+ $outlinkUrl = $this->request->getParam('link');
+
+ return !empty($outlinkUrl);
}
protected function getActionsToLookup()
{
return array(
- // Note: we do not normalize download/oulink URL
+ // Note: we do not normalize outlink URL
'idaction_url' => array($this->getActionUrl(), $this->getActionType())
);
}
- function writeDebugInfo()
+ public function writeDebugInfo()
{
parent::writeDebugInfo();
- if (self::detectActionIsOutlinkOnAliasHost($this, $this->request->getIdSite())) {
+ if ($this->detectActionIsOutlinkOnAliasHost($this, $this->request->getIdSite())) {
Common::printDebug("INFO: The outlink URL host is one of the known host for this website. ");
}
}
@@ -48,16 +57,15 @@ class ActionClickUrl extends Action
* @param Action $action
* @return bool true if the outlink the visitor clicked on points to one of the known hosts for this website
*/
- public static function detectActionIsOutlinkOnAliasHost(Action $action, $idSite)
+ protected function detectActionIsOutlinkOnAliasHost(Action $action, $idSite)
{
- if ($action->getActionType() != Action::TYPE_OUTLINK) {
- return false;
- }
$decodedActionUrl = $action->getActionUrl();
- $actionUrlParsed = @parse_url($decodedActionUrl);
+ $actionUrlParsed = @parse_url($decodedActionUrl);
+
if (!isset($actionUrlParsed['host'])) {
return false;
}
+
return Visit::isHostKnownAliasHost($actionUrlParsed['host'], $idSite);
}
}
diff --git a/plugins/Actions/Actions/ActionDownloadUrl.php b/plugins/Actions/Actions/ActionDownloadUrl.php
new file mode 100644
index 0000000000..a33bed1765
--- /dev/null
+++ b/plugins/Actions/Actions/ActionDownloadUrl.php
@@ -0,0 +1,41 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+
+namespace Piwik\Plugins\Actions\Actions;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\Request;
+
+/**
+ * This class represents a download.
+ * This is a particular type of Action: it has no 'name'
+ */
+class ActionDownloadUrl extends Action
+{
+ public function __construct(Request $request)
+ {
+ parent::__construct(self::TYPE_DOWNLOAD, $request);
+ $this->setActionUrl($request->getParam('download'));
+ }
+
+ public function shouldHandle()
+ {
+ $downloadUrl = $this->request->getParam('download');
+
+ return !empty($downloadUrl);
+ }
+
+ protected function getActionsToLookup()
+ {
+ return array(
+ // Note: we do not normalize download URL
+ 'idaction_url' => array($this->getActionUrl(), $this->getActionType())
+ );
+ }
+
+}
diff --git a/core/Tracker/ActionSiteSearch.php b/plugins/Actions/Actions/ActionSiteSearch.php
index 8b76a52c96..eb12d9d732 100644
--- a/core/Tracker/ActionSiteSearch.php
+++ b/plugins/Actions/Actions/ActionSiteSearch.php
@@ -7,10 +7,13 @@
*
*/
-namespace Piwik\Tracker;
+namespace Piwik\Plugins\Actions\Actions;
use Piwik\Common;
-use Piwik\Tracker;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\PageUrl;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Cache;
use Piwik\UrlHelper;
/**
@@ -30,11 +33,15 @@ class ActionSiteSearch extends Action
const CVAR_INDEX_SEARCH_CATEGORY = '4';
const CVAR_INDEX_SEARCH_COUNT = '5';
-
- function __construct($url, Request $request)
+ public function __construct(Request $request)
{
parent::__construct(Action::TYPE_SITE_SEARCH, $request);
- $this->originalUrl = $url;
+ $this->originalUrl = $request->getParam('url');
+ }
+
+ public function shouldHandle()
+ {
+ return $this->isSearchDetected();
}
protected function getActionsToLookup()
@@ -56,7 +63,7 @@ class ActionSiteSearch extends Action
return $this->request->getPageGenerationTime();
}
- function isSearchDetected()
+ public function isSearchDetected()
{
$siteSearch = $this->detectSiteSearch($this->originalUrl);
@@ -78,7 +85,6 @@ class ActionSiteSearch extends Action
return true;
}
-
public function getCustomVariables()
{
$customVariables = parent::getCustomVariables();
diff --git a/plugins/Actions/Archiver.php b/plugins/Actions/Archiver.php
index 2829ce47ab..758e3acb85 100644
--- a/plugins/Actions/Archiver.php
+++ b/plugins/Actions/Archiver.php
@@ -12,7 +12,7 @@ use Piwik\DataTable;
use Piwik\Metrics;
use Piwik\RankingQuery;
use Piwik\Tracker\Action;
-use Piwik\Tracker\ActionSiteSearch;
+use Piwik\Plugins\Actions\Actions\ActionSiteSearch;
/**
* Class encapsulating logic to process Day/Period Archiving for the Actions reports
diff --git a/plugins/Actions/Columns/ClickedUrl.php b/plugins/Actions/Columns/ClickedUrl.php
new file mode 100644
index 0000000000..60790e39ab
--- /dev/null
+++ b/plugins/Actions/Columns/ClickedUrl.php
@@ -0,0 +1,21 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ActionDimension;
+
+class ClickedUrl extends ActionDimension
+{
+ public function getName()
+ {
+ return Piwik::translate('Actions_ColumnClickedURL');
+ }
+
+}
diff --git a/plugins/Actions/Columns/DestinationPage.php b/plugins/Actions/Columns/DestinationPage.php
new file mode 100644
index 0000000000..1e372b473e
--- /dev/null
+++ b/plugins/Actions/Columns/DestinationPage.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+
+class DestinationPage extends VisitDimension
+{
+ public function getName()
+ {
+ return Piwik::translate('General_ColumnDestinationPage');
+ }
+} \ No newline at end of file
diff --git a/plugins/Actions/Columns/DownloadUrl.php b/plugins/Actions/Columns/DownloadUrl.php
new file mode 100644
index 0000000000..23b039b7a1
--- /dev/null
+++ b/plugins/Actions/Columns/DownloadUrl.php
@@ -0,0 +1,21 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ActionDimension;
+
+class DownloadUrl extends ActionDimension
+{
+ public function getName()
+ {
+ return Piwik::translate('Actions_ColumnDownloadURL');
+ }
+
+}
diff --git a/plugins/Actions/Columns/EntryPageTitle.php b/plugins/Actions/Columns/EntryPageTitle.php
new file mode 100644
index 0000000000..47045f13cf
--- /dev/null
+++ b/plugins/Actions/Columns/EntryPageTitle.php
@@ -0,0 +1,52 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugins\Actions\Segment;
+use Piwik\Plugin\VisitDimension;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+
+class EntryPageTitle extends VisitDimension
+{
+ protected $fieldName = 'visit_entry_idaction_name';
+ protected $fieldType = 'INTEGER(11) UNSIGNED NOT NULL';
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setSegment('entryPageTitle');
+ $segment->setName('Actions_ColumnEntryPageTitle');
+ $this->addSegment($segment);
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ $idActionName = false;
+
+ if (!empty($action)) {
+ $idActionName = $action->getIdActionNameForEntryAndExitIds();
+ }
+
+ return (int) $idActionName;
+ }
+
+ public function getName()
+ {
+ return Piwik::translate('Actions_ColumnEntryPageTitle');
+ }
+}
diff --git a/plugins/Actions/Columns/EntryPageUrl.php b/plugins/Actions/Columns/EntryPageUrl.php
new file mode 100644
index 0000000000..5c89117df3
--- /dev/null
+++ b/plugins/Actions/Columns/EntryPageUrl.php
@@ -0,0 +1,53 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugins\Actions\Segment;
+use Piwik\Plugin\VisitDimension;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+
+class EntryPageUrl extends VisitDimension
+{
+ protected $fieldName = 'visit_entry_idaction_url';
+ protected $fieldType = 'INTEGER(11) UNSIGNED NOT NULL';
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setSegment('entryPageUrl');
+ $segment->setName('Actions_ColumnEntryPageURL');
+ $this->addSegment($segment);
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ $idActionUrl = false;
+
+ if (!empty($action)) {
+ $idActionUrl = $action->getIdActionUrlForEntryAndExitIds();
+ }
+
+ return (int) $idActionUrl;
+ }
+
+ public function getName()
+ {
+ return Piwik::translate('Actions_ColumnEntryPageURL');
+ }
+
+}
diff --git a/plugins/Actions/Columns/ExitPageTitle.php b/plugins/Actions/Columns/ExitPageTitle.php
new file mode 100644
index 0000000000..c606035fb3
--- /dev/null
+++ b/plugins/Actions/Columns/ExitPageTitle.php
@@ -0,0 +1,67 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugins\Actions\Segment;
+use Piwik\Plugin\VisitDimension;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+
+class ExitPageTitle extends VisitDimension
+{
+ protected $fieldName = 'visit_exit_idaction_name';
+ protected $fieldType = 'INTEGER(11) UNSIGNED NOT NULL';
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setSegment('exitPageTitle');
+ $segment->setName('Actions_ColumnExitPageTitle');
+ $this->addSegment($segment);
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return int|bool
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ $idActionName = false;
+
+ if (!empty($action)) {
+ $idActionName = $action->getIdActionNameForEntryAndExitIds();
+ }
+
+ return (int) $idActionName;
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return int|bool
+ */
+ public function onExistingVisit(Request $request, Visitor $visitor, $action)
+ {
+ if (empty($action)) {
+ return false;
+ }
+
+ return $action->getIdActionNameForEntryAndExitIds();
+ }
+
+ public function getName()
+ {
+ return Piwik::translate('Actions_ColumnExitPageTitle');
+ }
+}
diff --git a/plugins/Actions/Columns/ExitPageUrl.php b/plugins/Actions/Columns/ExitPageUrl.php
new file mode 100644
index 0000000000..b85e26ad50
--- /dev/null
+++ b/plugins/Actions/Columns/ExitPageUrl.php
@@ -0,0 +1,73 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugins\Actions\Segment;
+use Piwik\Plugin\VisitDimension;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+
+class ExitPageUrl extends VisitDimension
+{
+ protected $fieldName = 'visit_exit_idaction_url';
+ protected $fieldType = 'INTEGER(11) UNSIGNED NULL DEFAULT 0';
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setSegment('exitPageUrl');
+ $segment->setName('Actions_ColumnExitPageURL');
+ $this->addSegment($segment);
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return int|bool
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ $idActionUrl = false;
+
+ if (!empty($action)) {
+ $idActionUrl = $action->getIdActionUrlForEntryAndExitIds();
+ }
+
+ return (int) $idActionUrl;
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return int
+ */
+ public function onExistingVisit(Request $request, Visitor $visitor, $action)
+ {
+ if (empty($action)) {
+ return false;
+ }
+
+ $id = $action->getIdActionUrlForEntryAndExitIds();
+
+ if (!empty($id)) {
+ $id = (int) $id;
+ }
+
+ return $id;
+ }
+
+ public function getName()
+ {
+ return Piwik::translate('Actions_ColumnExitPageURL');
+ }
+}
diff --git a/plugins/Actions/Columns/Keyword.php b/plugins/Actions/Columns/Keyword.php
new file mode 100644
index 0000000000..2bc1d0a001
--- /dev/null
+++ b/plugins/Actions/Columns/Keyword.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+
+class Keyword extends VisitDimension
+{
+ public function getName()
+ {
+ return Piwik::translate('General_ColumnKeyword');
+ }
+} \ No newline at end of file
diff --git a/plugins/Actions/Columns/KeywordwithNoSearchResult.php b/plugins/Actions/Columns/KeywordwithNoSearchResult.php
new file mode 100644
index 0000000000..0f9c8041e9
--- /dev/null
+++ b/plugins/Actions/Columns/KeywordwithNoSearchResult.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+
+class KeywordwithNoSearchResult extends VisitDimension
+{
+ public function getName()
+ {
+ return Piwik::translate('Actions_ColumnNoResultKeyword');
+ }
+} \ No newline at end of file
diff --git a/plugins/Actions/Columns/PageTitle.php b/plugins/Actions/Columns/PageTitle.php
new file mode 100644
index 0000000000..5c4ff21372
--- /dev/null
+++ b/plugins/Actions/Columns/PageTitle.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ActionDimension;
+use Piwik\Plugins\Actions\Segment;
+use Piwik\Tracker\Request;
+
+class PageTitle extends ActionDimension
+{
+ protected $fieldName = 'idaction_name';
+ protected $fieldType = 'INTEGER(10) UNSIGNED';
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setSegment('pageTitle');
+ $segment->setName('Actions_ColumnPageName');
+ $this->addSegment($segment);
+ }
+
+ public function getName()
+ {
+ return Piwik::translate('Actions_ColumnPageName');
+ }
+
+}
diff --git a/plugins/Actions/Columns/PageUrl.php b/plugins/Actions/Columns/PageUrl.php
new file mode 100644
index 0000000000..56d21e6ed1
--- /dev/null
+++ b/plugins/Actions/Columns/PageUrl.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ActionDimension;
+use Piwik\Plugins\Actions\Segment;
+
+class PageUrl extends ActionDimension
+{
+ protected $fieldName = 'idaction_url';
+ protected $fieldType = 'INTEGER(10) UNSIGNED DEFAULT NULL';
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setSegment('pageUrl');
+ $segment->setName('Actions_ColumnPageURL');
+ $segment->setAcceptedValues('All these segments must be URL encoded, for example: ' . urlencode('http://example.com/path/page?query'));
+ $this->addSegment($segment);
+ }
+
+ public function getName()
+ {
+ return Piwik::translate('Actions_ColumnPageURL');
+ }
+}
diff --git a/plugins/Actions/Columns/SearchCategory.php b/plugins/Actions/Columns/SearchCategory.php
new file mode 100644
index 0000000000..9d05f059bd
--- /dev/null
+++ b/plugins/Actions/Columns/SearchCategory.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+
+class SearchCategory extends VisitDimension
+{
+ public function getName()
+ {
+ return Piwik::translate('Actions_ColumnSearchCategory');
+ }
+} \ No newline at end of file
diff --git a/plugins/Actions/Columns/SearchDestinationPage.php b/plugins/Actions/Columns/SearchDestinationPage.php
new file mode 100644
index 0000000000..efb3b104b5
--- /dev/null
+++ b/plugins/Actions/Columns/SearchDestinationPage.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+
+class SearchDestinationPage extends VisitDimension
+{
+ public function getName()
+ {
+ return Piwik::translate('General_ColumnDestinationPage');
+ }
+}
diff --git a/plugins/Actions/Columns/SearchKeyword.php b/plugins/Actions/Columns/SearchKeyword.php
new file mode 100644
index 0000000000..ab80e0c765
--- /dev/null
+++ b/plugins/Actions/Columns/SearchKeyword.php
@@ -0,0 +1,30 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ActionDimension;
+use Piwik\Plugins\Actions\Segment;
+
+class SearchKeyword extends ActionDimension
+{
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setSegment('siteSearchKeyword');
+ $segment->setName('Actions_SiteSearchKeyword');
+ $segment->setSqlSegment('log_link_visit_action.idaction_name');
+ $this->addSegment($segment);
+ }
+
+ public function getName()
+ {
+ return Piwik::translate('General_ColumnKeyword');
+ }
+}
diff --git a/plugins/Actions/Columns/SearchNoResultKeyword.php b/plugins/Actions/Columns/SearchNoResultKeyword.php
new file mode 100644
index 0000000000..1f067fcec6
--- /dev/null
+++ b/plugins/Actions/Columns/SearchNoResultKeyword.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+
+class SearchNoResultKeyword extends VisitDimension
+{
+ public function getName()
+ {
+ return Piwik::translate('Actions_ColumnNoResultKeyword');
+ }
+}
diff --git a/plugins/Actions/Columns/ServerTime.php b/plugins/Actions/Columns/ServerTime.php
new file mode 100644
index 0000000000..8ca5d52470
--- /dev/null
+++ b/plugins/Actions/Columns/ServerTime.php
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Columns;
+
+use Piwik\Common;
+use Piwik\Db;
+use Piwik\Plugin\ActionDimension;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+use Piwik\Tracker;
+
+class ServerTime extends ActionDimension
+{
+ protected $fieldName = 'server_time';
+ protected $fieldType = 'DATETIME NOT NULL';
+
+ public function install()
+ {
+ parent::install();
+
+ $sql = "ALTER TABLE `" . Common::prefixTable("log_link_visit_action") . "` ADD INDEX index_idsite_servertime ( idsite, server_time )";
+ Db::exec($sql);
+ }
+
+ public function getName()
+ {
+ return '';
+ }
+
+ public function onNewAction(Request $request, Visitor $visitor, Action $action)
+ {
+ $timestamp = $request->getCurrentTimestamp();
+
+ return Tracker::getDatetimeFromTimestamp($timestamp);
+ }
+}
diff --git a/plugins/Actions/Columns/TimeSpentRefAction.php b/plugins/Actions/Columns/TimeSpentRefAction.php
new file mode 100644
index 0000000000..ef79927eb4
--- /dev/null
+++ b/plugins/Actions/Columns/TimeSpentRefAction.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Columns;
+
+use Piwik\Plugin\ActionDimension;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+
+class TimeSpentRefAction extends ActionDimension
+{
+ protected $fieldName = 'time_spent_ref_action';
+ protected $fieldType = 'INTEGER(10) UNSIGNED NOT NULL';
+
+ public function getName()
+ {
+ return '';
+ }
+
+ public function onNewAction(Request $request, Visitor $visitor, Action $action)
+ {
+ $timeSpent = $visitor->getVisitorColumn('time_spent_ref_action');
+
+ if (empty($timeSpent)) {
+ return 0;
+ }
+
+ return $timeSpent;
+ }
+}
diff --git a/plugins/Actions/Columns/VisitTotalActions.php b/plugins/Actions/Columns/VisitTotalActions.php
new file mode 100644
index 0000000000..5705d822f0
--- /dev/null
+++ b/plugins/Actions/Columns/VisitTotalActions.php
@@ -0,0 +1,95 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Columns;
+
+use Piwik\Plugin\VisitDimension;
+use Piwik\Plugins\CoreHome\Segment;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\Request;
+use Piwik\Tracker;
+use Piwik\Tracker\Visitor;
+
+class VisitTotalActions extends VisitDimension
+{
+ protected $fieldName = 'visit_total_actions';
+ protected $fieldType = 'SMALLINT(5) UNSIGNED NOT NULL';
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setType(Segment::TYPE_METRIC);
+ $segment->setSegment('actions');
+ $segment->setName('General_NbActions');
+ $this->addSegment($segment);
+ }
+
+ public function getName()
+ {
+ return '';
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return int
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ $actionType = false;
+ if ($action) {
+ $actionType = $action->getActionType();
+ }
+
+ $actions = array(
+ Action::TYPE_PAGE_URL,
+ Action::TYPE_DOWNLOAD,
+ Action::TYPE_OUTLINK,
+ Action::TYPE_SITE_SEARCH,
+ Action::TYPE_EVENT
+ );
+
+ // if visit starts with something else (e.g. ecommerce order), don't record as an action
+ if (in_array($actionType, $actions)) {
+ return 1;
+ }
+
+ return 0;
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return int
+ */
+ public function onExistingVisit(Request $request, Visitor $visitor, $action)
+ {
+ if (!$action) {
+ return false;
+ }
+
+ $increment = 'visit_total_actions + 1';
+
+ $idActionUrl = $action->getIdActionUrlForEntryAndExitIds();
+
+ if ($idActionUrl !== false) {
+ return $increment;
+ }
+
+ $actionType = $action->getActionType();
+
+ if (in_array($actionType, array(Action::TYPE_SITE_SEARCH, Action::TYPE_EVENT))) {
+ return $increment;
+ }
+
+ return false;
+ }
+
+} \ No newline at end of file
diff --git a/plugins/Actions/Columns/VisitTotalSearches.php b/plugins/Actions/Columns/VisitTotalSearches.php
new file mode 100644
index 0000000000..ca09132bce
--- /dev/null
+++ b/plugins/Actions/Columns/VisitTotalSearches.php
@@ -0,0 +1,77 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Columns;
+
+use Piwik\Plugin\VisitDimension;
+use Piwik\Plugins\CoreHome\Segment;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\Request;
+use Piwik\Tracker;
+use Piwik\Tracker\Visitor;
+
+class VisitTotalSearches extends VisitDimension
+{
+ protected $fieldName = 'visit_total_searches';
+ protected $fieldType = 'SMALLINT(5) UNSIGNED NOT NULL';
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setType(Segment::TYPE_METRIC);
+ $segment->setSegment('searches');
+ $segment->setName('General_NbSearches');
+ $segment->setAcceptedValues('To select all visits who used internal Site Search, use: &segment=searches>0');
+ $this->addSegment($segment);
+ }
+
+ public function getName()
+ {
+ return '';
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return int
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ if ($this->isSiteSearchAction($action)) {
+ return 1;
+ }
+
+ return 0;
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return int
+ */
+ public function onExistingVisit(Request $request, Visitor $visitor, $action)
+ {
+ if ($this->isSiteSearchAction($action)) {
+ return 'visit_total_searches + 1';
+ }
+
+ return false;
+ }
+
+ /**
+ * @param Action|null $action
+ * @return bool
+ */
+ private function isSiteSearchAction($action)
+ {
+ return ($action && $action->getActionType() == Action::TYPE_SITE_SEARCH);
+ }
+
+} \ No newline at end of file
diff --git a/plugins/Actions/Controller.php b/plugins/Actions/Controller.php
index 2a298dc335..0ebb8f91e8 100644
--- a/plugins/Actions/Controller.php
+++ b/plugins/Actions/Controller.php
@@ -9,6 +9,10 @@
namespace Piwik\Plugins\Actions;
use Piwik\Piwik;
+use Piwik\Plugins\Actions\Reports\GetPageUrlsFollowingSiteSearch;
+use Piwik\Plugins\Actions\Reports\GetSiteSearchCategories;
+use Piwik\Plugins\Actions\Reports\GetSiteSearchKeywords;
+use Piwik\Plugins\Actions\Reports\GetSiteSearchNoResultKeywords;
use Piwik\View;
/**
@@ -21,6 +25,27 @@ class Controller extends \Piwik\Plugin\Controller
// Actions that render whole pages
//
+ public function indexSiteSearch()
+ {
+ $view = new View('@Actions/indexSiteSearch');
+
+ $keyword = new GetSiteSearchKeywords();
+ $noResult = new GetSiteSearchNoResultKeywords();
+ $pageUrls = new GetPageUrlsFollowingSiteSearch();
+
+ $view->keywords = $keyword->render();
+ $view->noResultKeywords = $noResult->render();
+ $view->pagesUrlsFollowingSiteSearch = $pageUrls->render();
+
+ $categoryTrackingEnabled = Actions::isCustomVariablesPluginsEnabled();
+ if ($categoryTrackingEnabled) {
+ $categories = new GetSiteSearchCategories();
+ $view->categories = $categories->render();
+ }
+
+ return $view->render();
+ }
+
public function indexPageUrls()
{
return View::singleReport(
@@ -42,22 +67,6 @@ class Controller extends \Piwik\Plugin\Controller
$this->getExitPageUrls(true));
}
- public function indexSiteSearch()
- {
- $view = new View('@Actions/indexSiteSearch');
-
- $view->keywords = $this->getSiteSearchKeywords(true);
- $view->noResultKeywords = $this->getSiteSearchNoResultKeywords(true);
- $view->pagesUrlsFollowingSiteSearch = $this->getPageUrlsFollowingSiteSearch(true);
-
- $categoryTrackingEnabled = \Piwik\Plugin\Manager::getInstance()->isPluginActivated('CustomVariables');
- if ($categoryTrackingEnabled) {
- $view->categories = $this->getSiteSearchCategories(true);
- }
-
- return $view->render();
- }
-
public function indexPageTitles()
{
return View::singleReport(
@@ -147,4 +156,5 @@ class Controller extends \Piwik\Plugin\Controller
{
return $this->renderReport(__FUNCTION__);
}
+
}
diff --git a/plugins/Actions/Menu.php b/plugins/Actions/Menu.php
index 740b5a69ae..85465a8836 100644
--- a/plugins/Actions/Menu.php
+++ b/plugins/Actions/Menu.php
@@ -15,12 +15,6 @@ class Menu extends \Piwik\Plugin\Menu
public function configureReportingMenu(MenuReporting $menu)
{
$menu->add('General_Actions', '', array('module' => 'Actions', 'action' => 'indexPageUrls'), true, 15);
- $menu->add('General_Actions', 'General_Pages', array('module' => 'Actions', 'action' => 'indexPageUrls'), true, 1);
- $menu->add('General_Actions', 'Actions_SubmenuPagesEntry', array('module' => 'Actions', 'action' => 'indexEntryPageUrls'), true, 2);
- $menu->add('General_Actions', 'Actions_SubmenuPagesExit', array('module' => 'Actions', 'action' => 'indexExitPageUrls'), true, 3);
- $menu->add('General_Actions', 'Actions_SubmenuPageTitles', array('module' => 'Actions', 'action' => 'indexPageTitles'), true, 4);
- $menu->add('General_Actions', 'General_Outlinks', array('module' => 'Actions', 'action' => 'indexOutlinks'), true, 6);
- $menu->add('General_Actions', 'General_Downloads', array('module' => 'Actions', 'action' => 'indexDownloads'), true, 7);
$actions = new Actions();
if ($actions->isSiteSearchEnabled()) {
diff --git a/plugins/Actions/Reports/Base.php b/plugins/Actions/Reports/Base.php
new file mode 100644
index 0000000000..c931663c3a
--- /dev/null
+++ b/plugins/Actions/Reports/Base.php
@@ -0,0 +1,119 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Reports;
+
+use Piwik\Common;
+use Piwik\MetricsFormatter;
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\Actions\Actions;
+use Piwik\Plugins\CoreVisualizations\Visualizations\HtmlTable;
+use Piwik\API\Request;
+
+abstract class Base extends \Piwik\Plugin\Report
+{
+ protected function init()
+ {
+ $this->category = 'General_Actions';
+ $this->processedMetrics = false;
+ }
+
+ protected function addBaseDisplayProperties(ViewDataTable $view)
+ {
+ $view->config->datatable_js_type = 'ActionsDataTable';
+ $view->config->search_recursive = true;
+ $view->config->show_table_all_columns = false;
+ $view->requestConfig->filter_limit = Actions::ACTIONS_REPORT_ROWS_DISPLAY;
+ $view->config->show_all_views_icons = false;
+
+ if ($view->isViewDataTableId(HtmlTable::ID)) {
+ $view->config->show_embedded_subtable = true;
+ }
+
+ if (Request::shouldLoadExpanded()) {
+
+ if ($view->isViewDataTableId(HtmlTable::ID)) {
+ $view->config->show_expanded = true;
+ }
+
+ $view->config->filters[] = function ($dataTable) {
+ Actions::setDataTableRowLevels($dataTable);
+ };
+ }
+
+ $view->config->filters[] = function ($dataTable) use ($view) {
+ if ($view->isViewDataTableId(HtmlTable::ID)) {
+ $view->config->datatable_css_class = 'dataTableActions';
+ }
+ };
+ }
+
+ protected function addPageDisplayProperties(ViewDataTable $view)
+ {
+ $view->config->addTranslations(array(
+ 'nb_hits' => Piwik::translate('General_ColumnPageviews'),
+ 'nb_visits' => Piwik::translate('General_ColumnUniquePageviews'),
+ 'avg_time_on_page' => Piwik::translate('General_ColumnAverageTimeOnPage'),
+ 'bounce_rate' => Piwik::translate('General_ColumnBounceRate'),
+ 'exit_rate' => Piwik::translate('General_ColumnExitRate'),
+ 'avg_time_generation' => Piwik::translate('General_ColumnAverageGenerationTime'),
+ ));
+
+ // prettify avg_time_on_page column
+ $getPrettyTimeFromSeconds = '\Piwik\MetricsFormatter::getPrettyTimeFromSeconds';
+ $view->config->filters[] = array('ColumnCallbackReplace', array('avg_time_on_page', $getPrettyTimeFromSeconds));
+
+ // prettify avg_time_generation column
+ $avgTimeCallback = function ($time) {
+ return $time ? MetricsFormatter::getPrettyTimeFromSeconds($time, true, true, false) : "-";
+ };
+ $view->config->filters[] = array('ColumnCallbackReplace', array('avg_time_generation', $avgTimeCallback));
+
+ // add avg_generation_time tooltip
+ $tooltipCallback = function ($hits, $min, $max) {
+ if (!$hits) {
+ return false;
+ }
+
+ return Piwik::translate("Actions_AvgGenerationTimeTooltip", array(
+ $hits,
+ "<br />",
+ MetricsFormatter::getPrettyTimeFromSeconds($min),
+ MetricsFormatter::getPrettyTimeFromSeconds($max)
+ ));
+ };
+ $view->config->filters[] = array('ColumnCallbackAddMetadata',
+ array(
+ array('nb_hits_with_time_generation', 'min_time_generation', 'max_time_generation'),
+ 'avg_time_generation_tooltip',
+ $tooltipCallback
+ )
+ );
+
+ $this->addExcludeLowPopDisplayProperties($view);
+ }
+
+ protected function addExcludeLowPopDisplayProperties(ViewDataTable $view)
+ {
+ if (Common::getRequestVar('enable_filter_excludelowpop', '0', 'string') != '0') {
+ $view->requestConfig->filter_excludelowpop = 'nb_hits';
+ $view->requestConfig->filter_excludelowpop_value = function () {
+ // computing minimum value to exclude (2 percent of the total number of actions)
+ $visitsInfo = \Piwik\Plugins\VisitsSummary\Controller::getVisitsSummary()->getFirstRow();
+ $nbActions = $visitsInfo->getColumn('nb_actions');
+ $nbActionsLowPopulationThreshold = floor(0.02 * $nbActions);
+
+ // we remove 1 to make sure some actions/downloads are displayed in the case we have a very few of them
+ // and each of them has 1 or 2 hits...
+ return min($visitsInfo->getColumn('max_actions') - 1, $nbActionsLowPopulationThreshold - 1);
+ };
+ }
+ }
+
+}
diff --git a/plugins/Actions/Reports/Get.php b/plugins/Actions/Reports/Get.php
new file mode 100644
index 0000000000..7205350be5
--- /dev/null
+++ b/plugins/Actions/Reports/Get.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\Actions\API;
+
+class Get extends Base
+{
+ protected function init()
+ {
+ parent::init();
+
+ $this->name = Piwik::translate('General_Actions') . ' - ' . Piwik::translate('General_MainMetrics');
+ $this->documentation = ''; // TODO
+ $this->order = 1;
+ $this->metrics = array(
+ 'nb_pageviews',
+ 'nb_uniq_pageviews',
+ 'nb_downloads',
+ 'nb_uniq_downloads',
+ 'nb_outlinks',
+ 'nb_uniq_outlinks',
+ 'nb_searches',
+ 'nb_keywords',
+ 'avg_time_generation'
+ );
+ }
+}
diff --git a/plugins/Actions/Reports/GetDownloads.php b/plugins/Actions/Reports/GetDownloads.php
new file mode 100644
index 0000000000..099fcb271b
--- /dev/null
+++ b/plugins/Actions/Reports/GetDownloads.php
@@ -0,0 +1,58 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\Actions\Columns\DownloadUrl;
+
+class GetDownloads extends Base
+{
+ protected function init()
+ {
+ parent::init();
+
+ $this->dimension = new DownloadUrl();
+ $this->name = Piwik::translate('General_Downloads');
+ $this->documentation = Piwik::translate('Actions_DownloadsReportDocumentation', '<br />');
+ $this->metrics = array_keys($this->getMetrics());
+
+ $this->actionToLoadSubTables = $this->action;
+ $this->order = 9;
+
+ $this->menuTitle = 'General_Downloads';
+ $this->widgetTitle = 'General_Downloads';
+ }
+
+ public function getMetrics()
+ {
+ return array(
+ 'nb_visits' => Piwik::translate('Actions_ColumnUniqueDownloads'),
+ 'nb_hits' => Piwik::translate('General_Downloads')
+ );
+ }
+
+ protected function getMetricsDocumentation()
+ {
+ return array(
+ 'nb_visits' => Piwik::translate('Actions_ColumnUniqueClicksDocumentation'),
+ 'nb_hits' => Piwik::translate('Actions_ColumnClicksDocumentation')
+ );
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->config->addTranslations(array('label' => $this->dimension->getName()));
+
+ $view->config->columns_to_display = array('label', 'nb_visits', 'nb_hits');
+ $view->config->show_exclude_low_population = false;
+
+ $this->addBaseDisplayProperties($view);
+ }
+}
diff --git a/plugins/Actions/Reports/GetEntryPageTitles.php b/plugins/Actions/Reports/GetEntryPageTitles.php
new file mode 100644
index 0000000000..88778ebacf
--- /dev/null
+++ b/plugins/Actions/Reports/GetEntryPageTitles.php
@@ -0,0 +1,61 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Common;
+use Piwik\Plugins\Actions\Columns\EntryPageTitle;
+
+class GetEntryPageTitles extends Base
+{
+ protected function init()
+ {
+ parent::init();
+
+ $this->dimension = new EntryPageTitle();
+ $this->name = Piwik::translate('Actions_EntryPageTitles');
+ $this->documentation = Piwik::translate('Actions_ExitPageTitlesReportDocumentation', '<br />')
+ . ' ' . Piwik::translate('General_UsePlusMinusIconsDocumentation');
+ $this->metrics = array('entry_nb_visits', 'entry_bounce_count', 'bounce_rate');
+ $this->order = 6;
+ $this->actionToLoadSubTables = $this->action;
+
+ $this->widgetTitle = 'Actions_WidgetEntryPageTitles';
+ }
+
+ protected function getMetricsDocumentation()
+ {
+ $metrics = parent::getMetricsDocumentation();
+ $metrics['bounce_rate'] = Piwik::translate('General_ColumnBounceRateForPageDocumentation');
+
+ return $metrics;
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->config->addTranslations(array('label' => $this->dimension->getName()));
+
+ $view->config->columns_to_display = array('label', 'entry_nb_visits', 'entry_bounce_count', 'bounce_rate');
+ $view->config->title = $this->name;
+
+ $view->requestConfig->filter_sort_column = 'entry_nb_visits';
+
+ $this->addPageDisplayProperties($view);
+ $this->addBaseDisplayProperties($view);
+ }
+
+ public function getRelatedReports()
+ {
+ return array(
+ new GetPageTitles(),
+ new GetEntryPageUrls()
+ );
+ }
+}
diff --git a/plugins/Actions/Reports/GetEntryPageUrls.php b/plugins/Actions/Reports/GetEntryPageUrls.php
new file mode 100644
index 0000000000..659887b15d
--- /dev/null
+++ b/plugins/Actions/Reports/GetEntryPageUrls.php
@@ -0,0 +1,72 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Reports;
+
+use Piwik\Common;
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\API\Request;
+use Piwik\Plugins\Actions\Columns\EntryPageUrl;
+
+class GetEntryPageUrls extends Base
+{
+ protected function init()
+ {
+ parent::init();
+
+ $this->dimension = new EntryPageUrl();
+ $this->name = Piwik::translate('Actions_SubmenuPagesEntry');
+ $this->documentation = Piwik::translate('Actions_EntryPagesReportDocumentation', '<br />')
+ . '<br />' . Piwik::translate('General_UsePlusMinusIconsDocumentation');
+
+ $this->metrics = array('entry_nb_visits', 'entry_bounce_count', 'bounce_rate');
+ $this->order = 3;
+
+ $this->actionToLoadSubTables = $this->action;
+
+ $this->menuTitle = 'Actions_SubmenuPagesEntry';
+ $this->widgetTitle = 'Actions_WidgetPagesEntry';
+ }
+
+ protected function getMetricsDocumentation()
+ {
+ $metrics = parent::getMetricsDocumentation();
+ $metrics['bounce_rate'] = Piwik::translate('General_ColumnBounceRateForPageDocumentation');
+
+ return $metrics;
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ // link to the page, not just the report, but only if not a widget
+ $widget = Common::getRequestVar('widget', false);
+
+ $view->config->self_url = Request::getCurrentUrlWithoutGenericFilters(array(
+ 'module' => 'Actions',
+ 'action' => $widget === false ? 'indexEntryPageUrls' : 'getEntryPageUrls'
+ ));
+
+ $view->config->addTranslations(array('label' => $this->dimension->getName()));
+
+ $view->config->title = $this->name;
+ $view->config->columns_to_display = array('label', 'entry_nb_visits', 'entry_bounce_count', 'bounce_rate');
+ $view->requestConfig->filter_sort_column = 'entry_nb_visits';
+ $view->requestConfig->filter_sort_order = 'desc';
+
+ $this->addPageDisplayProperties($view);
+ $this->addBaseDisplayProperties($view);
+ }
+
+ public function getRelatedReports()
+ {
+ return array(
+ new GetEntryPageTitles()
+ );
+ }
+}
diff --git a/plugins/Actions/Reports/GetExitPageTitles.php b/plugins/Actions/Reports/GetExitPageTitles.php
new file mode 100644
index 0000000000..7f33b57df2
--- /dev/null
+++ b/plugins/Actions/Reports/GetExitPageTitles.php
@@ -0,0 +1,71 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\Actions\API;
+use Piwik\API\Request;
+use Piwik\Common;
+use Piwik\Plugins\Actions\Columns\ExitPageTitle;
+use Piwik\Plugins\Actions\Columns\PageTitle;
+
+class GetExitPageTitles extends Base
+{
+ protected function init()
+ {
+ parent::init();
+
+ $this->dimension = new ExitPageTitle();
+ $this->name = Piwik::translate('Actions_ExitPageTitles');
+ $this->documentation = Piwik::translate('Actions_EntryPageTitlesReportDocumentation', '<br />')
+ . ' ' . Piwik::translate('General_UsePlusMinusIconsDocumentation');
+
+ $this->metrics = array('exit_nb_visits', 'nb_visits', 'exit_rate');
+ $this->order = 7;
+
+ $this->actionToLoadSubTables = $this->action;
+
+ $this->widgetTitle = 'Actions_WidgetExitPageTitles';
+ }
+
+ public function getMetrics()
+ {
+ $metrics = parent::getMetrics();
+ $metrics['nb_visits'] = Piwik::translate('General_ColumnUniquePageviews');
+
+ return $metrics;
+ }
+
+ protected function getMetricsDocumentation()
+ {
+ $metrics = parent::getMetricsDocumentation();
+ $metrics['nb_visits'] = Piwik::translate('General_ColumnUniquePageviewsDocumentation');
+
+ return $metrics;
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->config->addTranslations(array('label' => $this->dimension->getName()));
+
+ $view->config->title = $this->name;
+ $view->config->columns_to_display = array('label', 'exit_nb_visits', 'nb_visits', 'exit_rate');
+
+ $this->addPageDisplayProperties($view);
+ $this->addBaseDisplayProperties($view);
+ }
+
+ public function getRelatedReports()
+ {
+ return array(
+ new GetExitPageUrls()
+ );
+ }
+}
diff --git a/plugins/Actions/Reports/GetExitPageUrls.php b/plugins/Actions/Reports/GetExitPageUrls.php
new file mode 100644
index 0000000000..c9b99f114c
--- /dev/null
+++ b/plugins/Actions/Reports/GetExitPageUrls.php
@@ -0,0 +1,84 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Reports;
+
+use Piwik\Common;
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\Actions\API;
+use Piwik\API\Request;
+use Piwik\Plugins\Actions\Columns\ExitPageUrl;
+use Piwik\Plugins\Actions\Columns\PageUrl;
+
+class GetExitPageUrls extends Base
+{
+ protected function init()
+ {
+ parent::init();
+
+ $this->dimension = new ExitPageUrl();
+ $this->name = Piwik::translate('Actions_SubmenuPagesExit');
+ $this->documentation = Piwik::translate('Actions_ExitPagesReportDocumentation', '<br />')
+ . '<br />' . Piwik::translate('General_UsePlusMinusIconsDocumentation');
+
+ $this->metrics = array('exit_nb_visits', 'nb_visits', 'exit_rate');
+ $this->actionToLoadSubTables = $this->action;
+
+ $this->order = 4;
+
+ $this->menuTitle = 'Actions_SubmenuPagesExit';
+ $this->widgetTitle = 'Actions_WidgetPagesExit';
+ }
+
+ public function getMetrics()
+ {
+ $metrics = parent::getMetrics();
+ $metrics['nb_visits'] = Piwik::translate('General_ColumnUniquePageviews');
+
+ return $metrics;
+ }
+
+ protected function getMetricsDocumentation()
+ {
+ $metrics = parent::getMetricsDocumentation();
+ $metrics['nb_visits'] = Piwik::translate('General_ColumnUniquePageviewsDocumentation');
+
+ return $metrics;
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ // link to the page, not just the report, but only if not a widget
+ $widget = Common::getRequestVar('widget', false);
+
+ $view->config->self_url = Request::getCurrentUrlWithoutGenericFilters(array(
+ 'module' => 'Actions',
+ 'action' => $widget === false ? 'indexExitPageUrls' : 'getExitPageUrls'
+ ));
+
+ $view->config->addTranslations(array('label' => $this->dimension->getName()));
+
+ $view->config->title = $this->name;
+
+ $view->config->columns_to_display = array('label', 'exit_nb_visits', 'nb_visits', 'exit_rate');
+ $view->requestConfig->filter_sort_column = 'exit_nb_visits';
+ $view->requestConfig->filter_sort_order = 'desc';
+
+ $this->addPageDisplayProperties($view);
+ $this->addBaseDisplayProperties($view);
+ }
+
+ public function getRelatedReports()
+ {
+ return array(
+ new GetExitPageTitles()
+ );
+ }
+
+}
diff --git a/plugins/Actions/Reports/GetOutlinks.php b/plugins/Actions/Reports/GetOutlinks.php
new file mode 100644
index 0000000000..e8e296e2db
--- /dev/null
+++ b/plugins/Actions/Reports/GetOutlinks.php
@@ -0,0 +1,65 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\Actions\API;
+use Piwik\API\Request;
+use Piwik\Common;
+use Piwik\Plugins\Actions\Columns\ClickedUrl;
+use Piwik\Plugins\Actions\Columns\PageTitle;
+
+class GetOutlinks extends Base
+{
+ protected function init()
+ {
+ parent::init();
+
+ $this->dimension = new ClickedUrl();
+ $this->name = Piwik::translate('General_Outlinks');
+ $this->documentation = Piwik::translate('Actions_OutlinksReportDocumentation') . ' '
+ . Piwik::translate('Actions_OutlinkDocumentation') . '<br />'
+ . Piwik::translate('General_UsePlusMinusIconsDocumentation');
+
+ $this->metrics = array_keys($this->getMetrics());
+ $this->order = 8;
+
+ $this->actionToLoadSubTables = $this->action;
+
+ $this->menuTitle = 'General_Outlinks';
+ $this->widgetTitle = 'General_Outlinks';
+ }
+
+ public function getMetrics()
+ {
+ return array(
+ 'nb_visits' => Piwik::translate('Actions_ColumnUniqueClicks'),
+ 'nb_hits' => Piwik::translate('Actions_ColumnClicks')
+ );
+ }
+
+ protected function getMetricsDocumentation()
+ {
+ return array(
+ 'nb_visits' => Piwik::translate('Actions_ColumnUniqueClicksDocumentation'),
+ 'nb_hits' => Piwik::translate('Actions_ColumnClicksDocumentation')
+ );
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->config->addTranslations(array('label' => $this->dimension->getName()));
+
+ $view->config->columns_to_display = array('label', 'nb_visits', 'nb_hits');
+ $view->config->show_exclude_low_population = false;
+
+ $this->addBaseDisplayProperties($view);
+ }
+}
diff --git a/plugins/Actions/Reports/GetPageTitles.php b/plugins/Actions/Reports/GetPageTitles.php
new file mode 100644
index 0000000000..7a64a2661e
--- /dev/null
+++ b/plugins/Actions/Reports/GetPageTitles.php
@@ -0,0 +1,82 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\Actions\API;
+use Piwik\API\Request;
+use Piwik\Common;
+use Piwik\Plugins\Actions\Columns\PageTitle;
+
+class GetPageTitles extends Base
+{
+ protected function init()
+ {
+ parent::init();
+
+ $this->dimension = new PageTitle();
+ $this->name = Piwik::translate('Actions_SubmenuPageTitles');
+ $this->documentation = Piwik::translate('Actions_PageTitlesReportDocumentation',
+ array('<br />', htmlentities('<title>')));
+
+ $this->order = 5;
+ $this->metrics = array('nb_hits', 'nb_visits', 'bounce_rate', 'avg_time_on_page', 'exit_rate', 'avg_time_generation');
+
+ $this->actionToLoadSubTables = $this->action;
+
+ $this->menuTitle = 'Actions_SubmenuPageTitles';
+ $this->widgetTitle = 'Actions_WidgetPageTitles';
+ }
+
+ public function getMetrics()
+ {
+ $metrics = parent::getMetrics();
+ $metrics['nb_visits'] = Piwik::translate('General_ColumnUniquePageviews');
+
+ return $metrics;
+ }
+
+ protected function getMetricsDocumentation()
+ {
+ $metrics = parent::getMetricsDocumentation();
+ $metrics['nb_visits'] = Piwik::translate('General_ColumnUniquePageviewsDocumentation');
+ $metrics['bounce_rate'] = Piwik::translate('General_ColumnPageBounceRateDocumentation');
+
+ return $metrics;
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ // link to the page, not just the report, but only if not a widget
+ $widget = Common::getRequestVar('widget', false);
+
+ $view->config->self_url = Request::getCurrentUrlWithoutGenericFilters(array(
+ 'module' => $this->module,
+ 'action' => $widget === false ? 'indexPageTitles' : 'getPageTitles'
+ ));
+
+ $view->config->title = $this->name;
+
+ $view->config->addTranslation('label', $this->dimension->getName());
+ $view->config->columns_to_display = array('label', 'nb_hits', 'nb_visits', 'bounce_rate',
+ 'avg_time_on_page', 'exit_rate', 'avg_time_generation');
+
+ $this->addPageDisplayProperties($view);
+ $this->addBaseDisplayProperties($view);
+ }
+
+ public function getRelatedReports()
+ {
+ return array(
+ new GetEntryPageTitles(),
+ new GetExitPageTitles()
+ );
+ }
+}
diff --git a/plugins/Actions/Reports/GetPageTitlesFollowingSiteSearch.php b/plugins/Actions/Reports/GetPageTitlesFollowingSiteSearch.php
new file mode 100644
index 0000000000..be069179c1
--- /dev/null
+++ b/plugins/Actions/Reports/GetPageTitlesFollowingSiteSearch.php
@@ -0,0 +1,71 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\Actions\Columns\DestinationPage;
+
+class GetPageTitlesFollowingSiteSearch extends SiteSearchBase
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new DestinationPage();
+ $this->name = Piwik::translate('Actions_WidgetPageTitlesFollowingSearch');
+ $this->documentation = Piwik::translate('Actions_SiteSearchFollowingPagesDoc') . '<br/>' . Piwik::translate('General_UsePlusMinusIconsDocumentation');
+ $this->metrics = array_keys($this->getMetrics());
+ $this->order = 19;
+ $this->widgetTitle = 'Actions_WidgetPageTitlesFollowingSearch';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $title = Piwik::translate('Actions_WidgetPageUrlsFollowingSearch');
+
+ $this->configureViewForUrlAndTitle($view, $title);
+ }
+
+ public function getMetrics()
+ {
+ return array(
+ 'nb_hits_following_search' => Piwik::translate('General_ColumnViewedAfterSearch'),
+ 'nb_hits' => Piwik::translate('General_ColumnTotalPageviews'),
+ );
+ }
+
+ protected function getMetricsDocumentation()
+ {
+ return array(
+ 'nb_hits_following_search' => Piwik::translate('General_ColumnViewedAfterSearchDocumentation'),
+ 'nb_hits' => Piwik::translate('General_ColumnPageviewsDocumentation'),
+ );
+ }
+
+ protected function configureViewForUrlAndTitle(ViewDataTable $view, $title)
+ {
+ $view->config->addTranslations(array('label' => $this->dimension->getName()));
+
+ $view->config->title = $title;
+ $view->config->columns_to_display = array('label', 'nb_hits_following_search', 'nb_hits');
+ $view->config->show_exclude_low_population = false;
+ $view->requestConfig->filter_sort_column = 'nb_hits_following_search';
+ $view->requestConfig->filter_sort_order = 'desc';
+
+ $this->addExcludeLowPopDisplayProperties($view);
+ $this->addBaseDisplayProperties($view);
+ }
+
+ public function getRelatedReports()
+ {
+ return array(
+ new GetPageUrlsFollowingSiteSearch()
+ );
+ }
+}
diff --git a/plugins/Actions/Reports/GetPageUrls.php b/plugins/Actions/Reports/GetPageUrls.php
new file mode 100644
index 0000000000..c8805fe408
--- /dev/null
+++ b/plugins/Actions/Reports/GetPageUrls.php
@@ -0,0 +1,63 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\Actions\Columns\PageUrl;
+
+class GetPageUrls extends Base
+{
+ protected function init()
+ {
+ parent::init();
+
+ $this->dimension = new PageUrl();
+ $this->name = Piwik::translate('Actions_PageUrls');
+ $this->title = Piwik::translate('General_Pages');
+ $this->documentation = Piwik::translate('Actions_PagesReportDocumentation', '<br />')
+ . '<br />' . Piwik::translate('General_UsePlusMinusIconsDocumentation');
+
+ $this->actionToLoadSubTables = $this->action;
+ $this->order = 2;
+ $this->metrics = array('nb_hits', 'nb_visits', 'bounce_rate', 'avg_time_on_page', 'exit_rate', 'avg_time_generation');
+
+ $this->segmentSql = 'log_visit.visit_entry_idaction_url';
+
+ $this->menuTitle = 'General_Pages';
+ $this->widgetTitle = 'General_Pages';
+ }
+
+ public function getMetrics()
+ {
+ $metrics = parent::getMetrics();
+ $metrics['nb_visits'] = Piwik::translate('General_ColumnUniquePageviews');
+
+ return $metrics;
+ }
+
+ protected function getMetricsDocumentation()
+ {
+ $metrics = parent::getMetricsDocumentation();
+ $metrics['nb_visits'] = Piwik::translate('General_ColumnUniquePageviewsDocumentation');
+ $metrics['bounce_rate'] = Piwik::translate('General_ColumnPageBounceRateDocumentation');
+
+ return $metrics;
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->config->addTranslation('label', $this->dimension->getName());
+ $view->config->columns_to_display = array('label', 'nb_hits', 'nb_visits', 'bounce_rate',
+ 'avg_time_on_page', 'exit_rate', 'avg_time_generation');
+
+ $this->addPageDisplayProperties($view);
+ $this->addBaseDisplayProperties($view);
+ }
+}
diff --git a/plugins/Actions/Reports/GetPageUrlsFollowingSiteSearch.php b/plugins/Actions/Reports/GetPageUrlsFollowingSiteSearch.php
new file mode 100644
index 0000000000..1891b92978
--- /dev/null
+++ b/plugins/Actions/Reports/GetPageUrlsFollowingSiteSearch.php
@@ -0,0 +1,40 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\Actions\Columns\DestinationPage;
+
+class GetPageUrlsFollowingSiteSearch extends GetPageTitlesFollowingSiteSearch
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new DestinationPage();
+ $this->name = Piwik::translate('Actions_WidgetPageUrlsFollowingSearch');
+ $this->documentation = Piwik::translate('Actions_SiteSearchFollowingPagesDoc') . '<br/>' . Piwik::translate('General_UsePlusMinusIconsDocumentation');
+ $this->order = 18;
+ $this->widgetTitle = 'Actions_WidgetPageUrlsFollowingSearch';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $title = Piwik::translate('Actions_WidgetPageTitlesFollowingSearch');
+
+ $this->configureViewForUrlAndTitle($view, $title);
+ }
+
+ public function getRelatedReports()
+ {
+ return array(
+ new GetPageTitlesFollowingSiteSearch()
+ );
+ }
+}
diff --git a/plugins/Actions/Reports/GetSiteSearchCategories.php b/plugins/Actions/Reports/GetSiteSearchCategories.php
new file mode 100644
index 0000000000..35e7421feb
--- /dev/null
+++ b/plugins/Actions/Reports/GetSiteSearchCategories.php
@@ -0,0 +1,65 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\Actions\Actions;
+use Piwik\Plugins\Actions\Columns\SearchCategory;
+use Piwik\Plugins\CoreVisualizations\Visualizations\HtmlTable;
+
+class GetSiteSearchCategories extends SiteSearchBase
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new SearchCategory();
+ $this->name = Piwik::translate('Actions_WidgetSearchCategories');
+ $this->documentation = Piwik::translate('Actions_SiteSearchCategories1') . '<br/>' . Piwik::translate('Actions_SiteSearchCategories2');
+ $this->metrics = array_keys($this->getMetrics());
+ $this->order = 17;
+ $this->widgetTitle = 'Actions_WidgetSearchCategories';
+ }
+
+ public function isEnabled()
+ {
+ return parent::isEnabled() && Actions::isCustomVariablesPluginsEnabled();
+ }
+
+ public function getMetrics()
+ {
+ return array(
+ 'nb_visits' => Piwik::translate('Actions_ColumnSearches'),
+ 'nb_pages_per_search' => Piwik::translate('Actions_ColumnPagesPerSearch'),
+ 'exit_rate' => Piwik::translate('Actions_ColumnSearchExits'),
+ );
+ }
+
+ protected function getMetricsDocumentation()
+ {
+ return array(
+ 'nb_visits' => Piwik::translate('Actions_ColumnSearchesDocumentation'),
+ 'nb_pages_per_search' => Piwik::translate('Actions_ColumnPagesPerSearchDocumentation'),
+ 'exit_rate' => Piwik::translate('Actions_ColumnSearchExitsDocumentation'),
+ );
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->config->addTranslations(array('label' => $this->dimension->getName()));
+
+ $view->config->columns_to_display = array('label', 'nb_visits', 'nb_pages_per_search');
+ $view->config->show_table_all_columns = false;
+ $view->config->show_bar_chart = false;
+
+ if ($view->isViewDataTableId(HtmlTable::ID)) {
+ $view->config->disable_row_evolution = false;
+ }
+ }
+}
diff --git a/plugins/Actions/Reports/GetSiteSearchKeywords.php b/plugins/Actions/Reports/GetSiteSearchKeywords.php
new file mode 100644
index 0000000000..d1941c726a
--- /dev/null
+++ b/plugins/Actions/Reports/GetSiteSearchKeywords.php
@@ -0,0 +1,54 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\Actions\Columns\Keyword;
+
+class GetSiteSearchKeywords extends SiteSearchBase
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new Keyword();
+ $this->name = Piwik::translate('Actions_WidgetSearchKeywords');
+ $this->documentation = Piwik::translate('Actions_SiteSearchKeywordsDocumentation') . '<br/><br/>' . Piwik::translate('Actions_SiteSearchIntro') . '<br/><br/>'
+ . '<a href="http://piwik.org/docs/site-search/" target="_blank">' . Piwik::translate('Actions_LearnMoreAboutSiteSearchLink') . '</a>';
+ $this->metrics = array_keys($this->getMetrics());
+ $this->order = 15;
+ $this->widgetTitle = 'Actions_WidgetSearchKeywords';
+ }
+
+ public function getMetrics()
+ {
+ return array(
+ 'nb_visits' => Piwik::translate('Actions_ColumnSearches'),
+ 'nb_pages_per_search' => Piwik::translate('Actions_ColumnPagesPerSearch'),
+ 'exit_rate' => Piwik::translate('Actions_ColumnSearchExits'),
+ );
+ }
+
+ protected function getMetricsDocumentation()
+ {
+ return array(
+ 'nb_visits' => Piwik::translate('Actions_ColumnSearchesDocumentation'),
+ 'nb_pages_per_search' => Piwik::translate('Actions_ColumnPagesPerSearchDocumentation'),
+ 'exit_rate' => Piwik::translate('Actions_ColumnSearchExitsDocumentation'),
+ );
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->config->addTranslation('label', $this->dimension->getName());
+ $view->config->columns_to_display = array('label', 'nb_visits', 'nb_pages_per_search', 'exit_rate');
+
+ $this->addSiteSearchDisplayProperties($view);
+ }
+}
diff --git a/plugins/Actions/Reports/GetSiteSearchNoResultKeywords.php b/plugins/Actions/Reports/GetSiteSearchNoResultKeywords.php
new file mode 100644
index 0000000000..ee5a996840
--- /dev/null
+++ b/plugins/Actions/Reports/GetSiteSearchNoResultKeywords.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\Actions\Columns\KeywordwithNoSearchResult;
+
+class GetSiteSearchNoResultKeywords extends SiteSearchBase
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new KeywordwithNoSearchResult();
+ $this->name = Piwik::translate('Actions_WidgetSearchNoResultKeywords');
+ $this->documentation = Piwik::translate('Actions_SiteSearchIntro') . '<br /><br />' . Piwik::translate('Actions_SiteSearchKeywordsNoResultDocumentation');
+ $this->metrics = array_keys($this->getMetrics());
+ $this->order = 16;
+ $this->widgetTitle = 'Actions_WidgetSearchNoResultKeywords';
+ }
+
+ public function getMetrics()
+ {
+ return array(
+ 'nb_visits' => Piwik::translate('Actions_ColumnSearches'),
+ 'exit_rate' => Piwik::translate('Actions_ColumnSearchExits'),
+ );
+ }
+
+ protected function getMetricsDocumentation()
+ {
+ return array(
+ 'nb_visits' => Piwik::translate('Actions_ColumnSearchesDocumentation'),
+ 'exit_rate' => Piwik::translate('Actions_ColumnSearchExitsDocumentation'),
+ );
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->config->addTranslation('label', $this->dimension->getName());
+ $view->config->columns_to_display = array('label', 'nb_visits', 'exit_rate');
+
+ $this->addSiteSearchDisplayProperties($view);
+ }
+}
diff --git a/plugins/Actions/Reports/SiteSearchBase.php b/plugins/Actions/Reports/SiteSearchBase.php
new file mode 100644
index 0000000000..dce52b84c6
--- /dev/null
+++ b/plugins/Actions/Reports/SiteSearchBase.php
@@ -0,0 +1,40 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\Actions\Actions;
+
+abstract class SiteSearchBase extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->category = 'Actions_SubmenuSitesearch';
+ }
+
+ public function isEnabled()
+ {
+ $actions = new Actions();
+ return $actions->isSiteSearchEnabled();
+ }
+
+ protected function addSiteSearchDisplayProperties(ViewDataTable $view)
+ {
+ $view->config->addTranslations(array(
+ 'nb_visits' => Piwik::translate('Actions_ColumnSearches'),
+ 'exit_rate' => str_replace("% ", "%&nbsp;", Piwik::translate('Actions_ColumnSearchExits')),
+ 'nb_pages_per_search' => Piwik::translate('Actions_ColumnPagesPerSearch')
+ ));
+
+ $view->config->show_bar_chart = false;
+ $view->config->show_table_all_columns = false;
+ }
+}
diff --git a/plugins/Actions/Segment.php b/plugins/Actions/Segment.php
new file mode 100644
index 0000000000..3dd3072d3d
--- /dev/null
+++ b/plugins/Actions/Segment.php
@@ -0,0 +1,22 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions;
+
+/**
+ * Actions segment base class
+ */
+class Segment extends \Piwik\Plugin\Segment
+{
+ protected function init()
+ {
+ $this->setCategory('General_Actions');
+ $this->setSqlFilter('\\Piwik\\Tracker\\TableLogAction::getIdActionFromSegment');
+ }
+}
+
diff --git a/plugins/Actions/Widgets.php b/plugins/Actions/Widgets.php
deleted file mode 100644
index eff55ceb1b..0000000000
--- a/plugins/Actions/Widgets.php
+++ /dev/null
@@ -1,51 +0,0 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- *
- */
-namespace Piwik\Plugins\Actions;
-
-use Piwik\WidgetsList;
-
-class Widgets extends \Piwik\Plugin\Widgets
-{
-
- public function configure(WidgetsList $widgetsList)
- {
- $category = 'General_Actions';
- $controller = 'Actions';
-
- $widgetsList->add($category, 'General_Pages', $controller, 'getPageUrls');
- $widgetsList->add($category, 'Actions_WidgetPageTitles', $controller, 'getPageTitles');
- $widgetsList->add($category, 'General_Outlinks', $controller, 'getOutlinks');
- $widgetsList->add($category, 'General_Downloads', $controller, 'getDownloads');
- $widgetsList->add($category, 'Actions_WidgetPagesEntry', $controller, 'getEntryPageUrls');
- $widgetsList->add($category, 'Actions_WidgetPagesExit', $controller, 'getExitPageUrls');
- $widgetsList->add($category, 'Actions_WidgetEntryPageTitles', $controller, 'getEntryPageTitles');
- $widgetsList->add($category, 'Actions_WidgetExitPageTitles', $controller, 'getExitPageTitles');
-
- $actions = new Actions();
- if ($actions->isSiteSearchEnabled()) {
- $this->addSearchWidgets($widgetsList, $controller);
- }
- }
-
- private function addSearchWidgets(WidgetsList $widgetsList, $controller)
- {
- $category = 'Actions_SubmenuSitesearch';
-
- $widgetsList->add($category, 'Actions_WidgetSearchKeywords', $controller, 'getSiteSearchKeywords');
-
- if (Actions::isCustomVariablesPluginsEnabled()) {
- $widgetsList->add($category, 'Actions_WidgetSearchCategories', $controller, 'getSiteSearchCategories');
- }
-
- $widgetsList->add($category, 'Actions_WidgetSearchNoResultKeywords', $controller, 'getSiteSearchNoResultKeywords');
- $widgetsList->add($category, 'Actions_WidgetPageUrlsFollowingSearch', $controller, 'getPageUrlsFollowingSiteSearch');
- $widgetsList->add($category, 'Actions_WidgetPageTitlesFollowingSearch', $controller, 'getPageTitlesFollowingSiteSearch');
- }
-
-}
diff --git a/plugins/CoreHome/Columns/IdSite.php b/plugins/CoreHome/Columns/IdSite.php
new file mode 100644
index 0000000000..369bfc31ce
--- /dev/null
+++ b/plugins/CoreHome/Columns/IdSite.php
@@ -0,0 +1,52 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\CoreHome\Columns;
+
+use Piwik\Plugin\VisitDimension;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\Request;
+use Piwik\Tracker;
+use Piwik\Tracker\Visitor;
+
+class IdSite extends VisitDimension
+{
+ protected $fieldName = 'idsite';
+ // we do not install or define column definition here as we need to create this column when installing as there is
+ // an index on it. Currently we do not define the index here... although we could overwrite the install() method
+ // and add column 'idsite' and add index. Problem is there is also an index
+ // INDEX(idsite, config_id, visit_last_action_time) and we maybe not be sure whether config_id already exists at
+ // installing point (we do not know whether visit_last_action_time or idsite column would be added first).
+
+ public function getName()
+ {
+ return '';
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ return $request->getIdSite();
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onRecordGoal(Request $request, Visitor $visitor, $action)
+ {
+ return $request->getIdSite();
+ }
+} \ No newline at end of file
diff --git a/plugins/CoreHome/Columns/VisitFirstActionTime.php b/plugins/CoreHome/Columns/VisitFirstActionTime.php
new file mode 100644
index 0000000000..15a8e70043
--- /dev/null
+++ b/plugins/CoreHome/Columns/VisitFirstActionTime.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\CoreHome\Columns;
+
+use Piwik\Plugin\VisitDimension;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\Request;
+use Piwik\Tracker;
+use Piwik\Tracker\Visitor;
+
+class VisitFirstActionTime extends VisitDimension
+{
+ protected $fieldName = 'visit_first_action_time';
+ protected $fieldType = 'DATETIME NOT NULL';
+
+ public function getName()
+ {
+ return '';
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ return Tracker::getDatetimeFromTimestamp($request->getCurrentTimestamp());
+ }
+} \ No newline at end of file
diff --git a/plugins/CoreHome/Columns/VisitGoalBuyer.php b/plugins/CoreHome/Columns/VisitGoalBuyer.php
new file mode 100644
index 0000000000..7dbdc28ebb
--- /dev/null
+++ b/plugins/CoreHome/Columns/VisitGoalBuyer.php
@@ -0,0 +1,136 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\CoreHome\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+use Piwik\Plugins\CoreHome\Segment;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\GoalManager;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+
+class VisitGoalBuyer extends VisitDimension
+{
+ // log_visit.visit_goal_buyer
+ const TYPE_BUYER_NONE = 0;
+ const TYPE_BUYER_ORDERED = 1;
+ const TYPE_BUYER_OPEN_CART = GoalManager::TYPE_BUYER_OPEN_CART;
+ const TYPE_BUYER_ORDERED_AND_OPEN_CART = GoalManager::TYPE_BUYER_ORDERED_AND_OPEN_CART;
+
+ static protected $visitEcommerceStatus = array(
+ self::TYPE_BUYER_NONE => 'none',
+ self::TYPE_BUYER_ORDERED => 'ordered',
+ self::TYPE_BUYER_OPEN_CART => 'abandonedCart',
+ self::TYPE_BUYER_ORDERED_AND_OPEN_CART => 'orderedThenAbandonedCart',
+ );
+
+ protected $fieldName = 'visit_goal_buyer';
+ protected $fieldType = 'TINYINT(1) NOT NULL';
+
+ protected function init()
+ {
+ $example = Piwik::translate('General_EcommerceVisitStatusEg', '"&segment=visitEcommerceStatus==ordered,visitEcommerceStatus==orderedThenAbandonedCart"');
+ $acceptedValues = implode(", ", self::$visitEcommerceStatus) . '. ' . $example;
+
+ $segment = new Segment();
+ $segment->setSegment('visitEcommerceStatus');
+ $segment->setName('General_EcommerceVisitStatusDesc');
+ $segment->setAcceptedValues($acceptedValues);
+ $segment->setSqlFilterValue(__NAMESPACE__ . '\VisitGoalBuyer::getVisitEcommerceStatus');
+
+ $this->addSegment($segment);
+ }
+
+ public function getName()
+ {
+ return '';
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ return $this->getBuyerType($request);
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return int
+ */
+ public function onExistingVisit(Request $request, Visitor $visitor, $action)
+ {
+ $goalBuyer = $visitor->getVisitorColumn($this->fieldName);
+
+ // Ecommerce buyer status
+ $visitEcommerceStatus = $this->getBuyerType($request, $goalBuyer);
+
+ if($visitEcommerceStatus != self::TYPE_BUYER_NONE
+ // only update if the value has changed (prevents overwriting the value in case a request has
+ // updated it in the meantime)
+ && $visitEcommerceStatus != $goalBuyer) {
+
+ return $visitEcommerceStatus;
+ }
+
+ return false;
+ }
+
+ static public function getVisitEcommerceStatus($status)
+ {
+ $id = array_search($status, self::$visitEcommerceStatus);
+
+ if ($id === false) {
+ throw new \Exception("Invalid 'visitEcommerceStatus' segment value $status");
+ }
+
+ return $id;
+ }
+
+ /**
+ * @ignore
+ */
+ static public function getVisitEcommerceStatusFromId($id)
+ {
+ if (!isset(self::$visitEcommerceStatus[$id])) {
+ throw new \Exception("Unexpected ECommerce status value ");
+ }
+
+ return self::$visitEcommerceStatus[$id];
+ }
+
+ private function getBuyerType(Request $request, $existingType = self::TYPE_BUYER_NONE)
+ {
+ $goalManager = new GoalManager($request);
+
+ if (!$goalManager->requestIsEcommerce) {
+ return $existingType;
+ }
+
+ if ($goalManager->isGoalAnOrder) {
+ return self::TYPE_BUYER_ORDERED;
+ }
+
+ // request is Add to Cart
+ if ($existingType == self::TYPE_BUYER_ORDERED
+ || $existingType == self::TYPE_BUYER_ORDERED_AND_OPEN_CART
+ ) {
+ return self::TYPE_BUYER_ORDERED_AND_OPEN_CART;
+ }
+
+ return self::TYPE_BUYER_OPEN_CART;
+ }
+
+} \ No newline at end of file
diff --git a/plugins/CoreHome/Columns/VisitGoalConverted.php b/plugins/CoreHome/Columns/VisitGoalConverted.php
new file mode 100644
index 0000000000..0e4fc72caa
--- /dev/null
+++ b/plugins/CoreHome/Columns/VisitGoalConverted.php
@@ -0,0 +1,57 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\CoreHome\Columns;
+
+use Piwik\Plugin\VisitDimension;
+use Piwik\Plugins\CoreHome\Segment;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+
+class VisitGoalConverted extends VisitDimension
+{
+ protected $fieldName = 'visit_goal_converted';
+ protected $fieldType = 'TINYINT(1) NOT NULL';
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setSegment('visitConverted');
+ $segment->setName('General_VisitConvertedGoal');
+ $segment->setAcceptedValues('0, 1');
+ $this->addSegment($segment);
+ }
+
+ public function getName()
+ {
+ return '';
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ return 0;
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onConvertedVisit(Request $request, Visitor $visitor, $action)
+ {
+ return 1;
+ }
+} \ No newline at end of file
diff --git a/plugins/CoreHome/Columns/VisitLastActionTime.php b/plugins/CoreHome/Columns/VisitLastActionTime.php
new file mode 100644
index 0000000000..21a2103370
--- /dev/null
+++ b/plugins/CoreHome/Columns/VisitLastActionTime.php
@@ -0,0 +1,52 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\CoreHome\Columns;
+
+use Piwik\Plugin\VisitDimension;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\Request;
+use Piwik\Tracker;
+use Piwik\Tracker\Visitor;
+
+class VisitLastActionTime extends VisitDimension
+{
+ protected $fieldName = 'visit_last_action_time';
+ // we do not install or define column definition here as we need to create this column when installing as there is
+ // an index on it. Currently we do not define the index here... although we could overwrite the install() method
+ // and add column 'visit_last_action_time' and add index. Problem is there is also an index
+ // INDEX(idsite, config_id, visit_last_action_time) and we maybe not be sure whether idsite already exists at
+ // installing point (we do not know whether idsite column will be added first).
+
+ public function getName()
+ {
+ return '';
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ return Tracker::getDatetimeFromTimestamp($request->getCurrentTimestamp());
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onExistingVisit(Request $request, Visitor $visitor, $action)
+ {
+ return $this->onNewVisit($request, $visitor, $action);
+ }
+} \ No newline at end of file
diff --git a/plugins/CoreHome/Columns/VisitTotalTime.php b/plugins/CoreHome/Columns/VisitTotalTime.php
new file mode 100644
index 0000000000..02e7a6c547
--- /dev/null
+++ b/plugins/CoreHome/Columns/VisitTotalTime.php
@@ -0,0 +1,120 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\CoreHome\Columns;
+
+use Piwik\Config;
+use Piwik\Plugin\VisitDimension;
+use Piwik\Plugins\CoreHome\Segment;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\GoalManager;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+
+class VisitTotalTime extends VisitDimension
+{
+ protected $fieldName = 'visit_total_time';
+ protected $fieldType = 'SMALLINT(5) UNSIGNED NOT NULL';
+
+ private $isExistingVisit = false;
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setSegment('visitDuration');
+ $segment->setName('General_ColumnVisitDuration');
+ $segment->setType(Segment::TYPE_METRIC);
+ $this->addSegment($segment);
+ }
+
+ public function getName()
+ {
+ return '';
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ $totalTime = Config::getInstance()->Tracker['default_time_one_page_visit'];
+ $totalTime = $this->cleanupVisitTotalTime($totalTime);
+
+ return $totalTime;
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onExistingVisit(Request $request, Visitor $visitor, $action)
+ {
+ $firstActionTime = $visitor->getVisitorColumn('visit_first_action_time');
+
+ $totalTime = 1 + $request->getCurrentTimestamp() - $firstActionTime;
+ $totalTime = $this->cleanupVisitTotalTime($totalTime);
+
+ $this->isExistingVisit = true;
+
+ return $totalTime;
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return int
+ */
+ public function onConvertedVisit(Request $request, Visitor $visitor, $action)
+ {
+ if (!$this->isExistingVisit) {
+ return false;
+ }
+
+ $goalManager = new GoalManager($request);
+
+ $totalTime = $visitor->getVisitorColumn('visit_total_time');
+
+ // If a pageview and goal conversion in the same second, with previously a goal conversion recorded
+ // the request would not "update" the row since all values are the same as previous
+ // therefore the request below throws exception, instead we make sure the UPDATE will affect the row
+ $totalTime = $totalTime + $goalManager->idGoal;
+ // +2 to offset idgoal=-1 and idgoal=0
+ $totalTime = $totalTime + 2;
+
+ return $this->cleanupVisitTotalTime($totalTime);
+ }
+
+ public function getRequiredVisitFields()
+ {
+ return array('visit_first_action_time');
+ }
+
+ private function cleanupVisitTotalTime($t)
+ {
+ $t = (int)$t;
+
+ if ($t < 0) {
+ $t = 0;
+ }
+
+ $smallintMysqlLimit = 65534;
+
+ if ($t > $smallintMysqlLimit) {
+ $t = $smallintMysqlLimit;
+ }
+
+ return $t;
+ }
+
+} \ No newline at end of file
diff --git a/plugins/CoreHome/Columns/VisitorDaysSinceFirst.php b/plugins/CoreHome/Columns/VisitorDaysSinceFirst.php
new file mode 100644
index 0000000000..7e2230432d
--- /dev/null
+++ b/plugins/CoreHome/Columns/VisitorDaysSinceFirst.php
@@ -0,0 +1,57 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\CoreHome\Columns;
+
+use Piwik\Plugin\VisitDimension;
+use Piwik\Plugins\CoreHome\Segment;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+
+class VisitorDaysSinceFirst extends VisitDimension
+{
+ protected $fieldName = 'visitor_days_since_first';
+ protected $fieldType = 'SMALLINT(5) UNSIGNED NOT NULL';
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setType(Segment::TYPE_METRIC);
+ $segment->setSegment('daysSinceFirstVisit');
+ $segment->setName('General_DaysSinceFirstVisit');
+ $this->addSegment($segment);
+ }
+
+ public function getName()
+ {
+ return '';
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ return $request->getDaysSinceFirstVisit();
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onRecordGoal(Request $request, Visitor $visitor, $action)
+ {
+ return $visitor->getVisitorColumn($this->fieldName);
+ }
+} \ No newline at end of file
diff --git a/plugins/CoreHome/Columns/VisitorDaysSinceOrder.php b/plugins/CoreHome/Columns/VisitorDaysSinceOrder.php
new file mode 100644
index 0000000000..8ccde5c0e0
--- /dev/null
+++ b/plugins/CoreHome/Columns/VisitorDaysSinceOrder.php
@@ -0,0 +1,64 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\CoreHome\Columns;
+
+use Piwik\Plugin\VisitDimension;
+use Piwik\Plugins\CoreHome\Segment;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+
+class VisitorDaysSinceOrder extends VisitDimension
+{
+ protected $fieldName = 'visitor_days_since_order';
+ protected $fieldType = 'SMALLINT(5) UNSIGNED NOT NULL';
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setSegment('daysSinceLastEcommerceOrder');
+ $segment->setName('General_DaysSinceLastEcommerceOrder');
+ $segment->setType(Segment::TYPE_METRIC);
+
+ $this->addSegment($segment);
+ }
+
+ public function getName()
+ {
+ return '';
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ $daysSinceLastOrder = $request->getDaysSinceLastOrder();
+
+ if ($daysSinceLastOrder === false) {
+ $daysSinceLastOrder = 0;
+ }
+
+ return $daysSinceLastOrder;
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onRecordGoal(Request $request, Visitor $visitor, $action)
+ {
+ return $visitor->getVisitorColumn($this->fieldName);
+ }
+} \ No newline at end of file
diff --git a/plugins/CoreHome/Columns/VisitorReturning.php b/plugins/CoreHome/Columns/VisitorReturning.php
new file mode 100644
index 0000000000..cf78ee44bf
--- /dev/null
+++ b/plugins/CoreHome/Columns/VisitorReturning.php
@@ -0,0 +1,84 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\CoreHome\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+use Piwik\Plugins\CoreHome\Segment;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+
+class VisitorReturning extends VisitDimension
+{
+ const IS_RETURNING_CUSTOMER = 2;
+ const IS_RETURNING = 1;
+ const IS_NEW = 0;
+
+ protected $fieldName = 'visitor_returning';
+ protected $fieldType = 'TINYINT(1) NOT NULL';
+ protected $conversionField = true;
+
+ protected function init()
+ {
+ $acceptedValues = 'new, returning, returningCustomer. ';
+ $acceptedValues .= Piwik::translate('General_VisitTypeExample', '"&segment=visitorType==returning,visitorType==returningCustomer"');
+
+ $segment = new Segment();
+ $segment->setSegment('visitorType');
+ $segment->setName('General_VisitType');
+ $segment->setAcceptedValues($acceptedValues);
+ $segment->setSqlFilterValue(function ($type) {
+ return $type == "new" ? 0 : ($type == "returning" ? 1 : 2);
+ });
+
+ $this->addSegment($segment);
+ }
+
+ public function getName()
+ {
+ return '';
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ $visitCount = $request->getVisitCount();
+ $daysSinceLastVisit = $request->getDaysSinceLastVisit();
+
+ $daysSinceLastOrder = $request->getDaysSinceLastOrder();
+ $isReturningCustomer = ($daysSinceLastOrder !== false);
+
+ if ($isReturningCustomer) {
+ return self::IS_RETURNING_CUSTOMER;
+ }
+
+ if ($visitCount > 1 || $visitor->isVisitorKnown() || $daysSinceLastVisit > 0) {
+ return self::IS_RETURNING;
+ }
+
+ return self::IS_NEW;
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onRecordGoal(Request $request, Visitor $visitor, $action)
+ {
+ return $visitor->getVisitorColumn($this->fieldName);
+ }
+} \ No newline at end of file
diff --git a/plugins/CoreHome/Columns/VisitsCount.php b/plugins/CoreHome/Columns/VisitsCount.php
new file mode 100644
index 0000000000..b1df599495
--- /dev/null
+++ b/plugins/CoreHome/Columns/VisitsCount.php
@@ -0,0 +1,57 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\CoreHome\Columns;
+
+use Piwik\Plugin\VisitDimension;
+use Piwik\Plugins\CoreHome\Segment;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+
+class VisitsCount extends VisitDimension
+{
+ protected $fieldName = 'visitor_count_visits';
+ protected $fieldType = 'SMALLINT(5) UNSIGNED NOT NULL';
+
+ public function getName()
+ {
+ return '';
+ }
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setType(Segment::TYPE_METRIC);
+ $segment->setSegment('visitCount');
+ $segment->setName('General_NumberOfVisits');
+ $this->addSegment($segment);
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ return $request->getVisitCount();
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onRecordGoal(Request $request, Visitor $visitor, $action)
+ {
+ return $visitor->getVisitorColumn($this->fieldName);
+ }
+} \ No newline at end of file
diff --git a/plugins/CoreHome/Controller.php b/plugins/CoreHome/Controller.php
index 302f1181a2..3c90049ca2 100644
--- a/plugins/CoreHome/Controller.php
+++ b/plugins/CoreHome/Controller.php
@@ -16,6 +16,7 @@ use Piwik\FrontController;
use Piwik\Menu\MenuMain;
use Piwik\Notification\Manager as NotificationManager;
use Piwik\Piwik;
+use Piwik\Plugin\Report;
use Piwik\Plugins\CoreHome\DataTableRowAction\MultiRowEvolution;
use Piwik\Plugins\CoreHome\DataTableRowAction\RowEvolution;
use Piwik\Plugins\CorePluginsAdmin\MarketplaceApiClient;
@@ -37,6 +38,42 @@ class Controller extends \Piwik\Plugin\Controller
return 'redirectToCoreHomeIndex';
}
+ public function renderMenuReport()
+ {
+ $reportModule = Common::getRequestVar('reportModule', null, 'string');
+ $reportAction = Common::getRequestVar('reportAction', null, 'string');
+
+ $report = Report::factory($reportModule, $reportAction);
+
+ if (empty($report)) {
+ throw new Exception('This report does not exist');
+ }
+
+ if (!$report->isEnabled()) {
+ throw new Exception('This report is not enabled. Maybe you do not have enough permission');
+ }
+
+ return View::singleReport($report->getName(), $this->renderWidget());
+ }
+
+ public function renderWidget()
+ {
+ $reportModule = Common::getRequestVar('reportModule', null, 'string');
+ $reportAction = Common::getRequestVar('reportAction', null, 'string');
+
+ $report = Report::factory($reportModule, $reportAction);
+
+ if (empty($report)) {
+ throw new Exception('This report does not exist');
+ }
+
+ if (!$report->isEnabled()) {
+ throw new Exception('This report is not enabled. Maybe you do not have enough permission');
+ }
+
+ return $report->render();
+ }
+
function redirectToCoreHomeIndex()
{
$defaultReport = API::getInstance()->getUserPreference(Piwik::getCurrentUserLogin(), API::PREFERENCE_DEFAULT_REPORT);
diff --git a/plugins/CoreHome/Segment.php b/plugins/CoreHome/Segment.php
new file mode 100644
index 0000000000..7b6f2fbf57
--- /dev/null
+++ b/plugins/CoreHome/Segment.php
@@ -0,0 +1,21 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\CoreHome;
+
+/**
+ * CoreHome segment base class
+ */
+class Segment extends \Piwik\Plugin\Segment
+{
+ protected function init()
+ {
+ $this->setCategory('General_Visit');
+ }
+}
+
diff --git a/plugins/CustomVariables/API.php b/plugins/CustomVariables/API.php
index 406306638d..1f03f873fe 100644
--- a/plugins/CustomVariables/API.php
+++ b/plugins/CustomVariables/API.php
@@ -13,7 +13,7 @@ use Piwik\DataTable;
use Piwik\Date;
use Piwik\Metrics;
use Piwik\Piwik;
-use Piwik\Tracker\ActionSiteSearch;
+use Piwik\Plugins\Actions\Actions\ActionSiteSearch;
/**
* The Custom Variables API lets you access reports for your <a href='http://piwik.org/docs/custom-variables/' target='_blank'>Custom Variables</a> names and values.
diff --git a/plugins/CustomVariables/Columns/CustomVariablename.php b/plugins/CustomVariables/Columns/CustomVariablename.php
new file mode 100644
index 0000000000..bf7474af9a
--- /dev/null
+++ b/plugins/CustomVariables/Columns/CustomVariablename.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\CustomVariables\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+
+class CustomVariableName extends VisitDimension
+{
+ public function getName()
+ {
+ return Piwik::translate('CustomVariables_ColumnCustomVariableName');
+ }
+} \ No newline at end of file
diff --git a/plugins/CustomVariables/Columns/CustomVariablevalue.php b/plugins/CustomVariables/Columns/CustomVariablevalue.php
new file mode 100644
index 0000000000..7b7f2ef315
--- /dev/null
+++ b/plugins/CustomVariables/Columns/CustomVariablevalue.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\CustomVariables\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+
+class CustomVariableValue extends VisitDimension
+{
+ public function getName()
+ {
+ return Piwik::translate('CustomVariables_ColumnCustomVariableValue');
+ }
+} \ No newline at end of file
diff --git a/plugins/CustomVariables/CustomVariables.php b/plugins/CustomVariables/CustomVariables.php
index 5f1c790f1c..35ab6eaf97 100644
--- a/plugins/CustomVariables/CustomVariables.php
+++ b/plugins/CustomVariables/CustomVariables.php
@@ -10,12 +10,9 @@ namespace Piwik\Plugins\CustomVariables;
use Piwik\ArchiveProcessor;
use Piwik\Piwik;
-use Piwik\Plugin\ViewDataTable;
use Piwik\Tracker\Cache;
use Piwik\Tracker;
-/**
- */
class CustomVariables extends \Piwik\Plugin
{
public function getInformation()
@@ -30,13 +27,10 @@ class CustomVariables extends \Piwik\Plugin
*/
public function getListHooksRegistered()
{
- $hooks = array(
+ return array(
'Goals.getReportsWithGoalMetrics' => 'getReportsWithGoalMetrics',
- 'API.getReportMetadata' => 'getReportMetadata',
- 'API.getSegmentDimensionMetadata' => 'getSegmentsMetadata',
- 'ViewDataTable.configure' => 'configureViewDataTable'
+ 'API.getSegmentDimensionMetadata' => 'getSegmentsMetadata'
);
- return $hooks;
}
public function install()
@@ -83,33 +77,6 @@ class CustomVariables extends \Piwik\Plugin
return $cache[$cacheKey];
}
- /**
- * Returns metadata for available reports
- */
- public function getReportMetadata(&$reports)
- {
- $documentation = Piwik::translate('CustomVariables_CustomVariablesReportDocumentation',
- array('<br />', '<a href="http://piwik.org/docs/custom-variables/" target="_blank">', '</a>'));
-
- $reports[] = array('category' => Piwik::translate('General_Visitors'),
- 'name' => Piwik::translate('CustomVariables_CustomVariables'),
- 'module' => 'CustomVariables',
- 'action' => 'getCustomVariables',
- 'actionToLoadSubTables' => 'getCustomVariablesValuesFromNameId',
- 'dimension' => Piwik::translate('CustomVariables_ColumnCustomVariableName'),
- 'documentation' => $documentation,
- 'order' => 10);
-
- $reports[] = array('category' => Piwik::translate('General_Visitors'),
- 'name' => Piwik::translate('CustomVariables_CustomVariables'),
- 'module' => 'CustomVariables',
- 'action' => 'getCustomVariablesValuesFromNameId',
- 'dimension' => Piwik::translate('CustomVariables_ColumnCustomVariableValue'),
- 'documentation' => $documentation,
- 'isSubtableReport' => true,
- 'order' => 15);
- }
-
public function getSegmentsMetadata(&$segments)
{
$maxCustomVariables = self::getMaxCustomVariables();
@@ -162,36 +129,4 @@ class CustomVariables extends \Piwik\Plugin
);
}
- public function configureViewDataTable(ViewDataTable $view)
- {
- switch ($view->requestConfig->apiMethodToRequestDataTable) {
- case 'CustomVariables.getCustomVariables':
- $this->configureViewForGetCustomVariables($view);
- break;
- case 'CustomVariables.getCustomVariablesValuesFromNameId':
- $this->configureViewForGetCustomVariablesValuesFromNameId($view);
- break;
- }
- }
-
- private function configureViewForGetCustomVariables(ViewDataTable $view)
- {
- $view->config->columns_to_display = array('label', 'nb_actions', 'nb_visits');
- $view->config->show_goals = true;
- $view->config->subtable_controller_action = 'getCustomVariablesValuesFromNameId';
- $view->config->addTranslation('label', Piwik::translate('CustomVariables_ColumnCustomVariableName'));
- $view->requestConfig->filter_sort_column = 'nb_actions';
- $view->requestConfig->filter_sort_order = 'desc';
- }
-
- private function configureViewForGetCustomVariablesValuesFromNameId(ViewDataTable $view)
- {
- $view->config->columns_to_display = array('label', 'nb_actions', 'nb_visits');
- $view->config->show_goals = true;
- $view->config->show_search = false;
- $view->config->show_exclude_low_population = false;
- $view->config->addTranslation('label', Piwik::translate('CustomVariables_ColumnCustomVariableValue'));
- $view->requestConfig->filter_sort_column = 'nb_actions';
- $view->requestConfig->filter_sort_order = 'desc';
- }
}
diff --git a/plugins/CustomVariables/Reports/Base.php b/plugins/CustomVariables/Reports/Base.php
new file mode 100644
index 0000000000..b3307d87fc
--- /dev/null
+++ b/plugins/CustomVariables/Reports/Base.php
@@ -0,0 +1,18 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\CustomVariables\Reports;
+
+abstract class Base extends \Piwik\Plugin\Report
+{
+ protected function init()
+ {
+ $this->category = 'General_Visitors';
+ }
+
+}
diff --git a/plugins/CustomVariables/Reports/GetCustomVariables.php b/plugins/CustomVariables/Reports/GetCustomVariables.php
new file mode 100644
index 0000000000..deac87c0a4
--- /dev/null
+++ b/plugins/CustomVariables/Reports/GetCustomVariables.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
+ *
+ */
+namespace Piwik\Plugins\CustomVariables\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\CustomVariables\Columns\CustomVariableName;
+
+class GetCustomVariables extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new CustomVariableName();
+ $this->name = Piwik::translate('CustomVariables_CustomVariables');
+ $this->documentation = Piwik::translate('CustomVariables_CustomVariablesReportDocumentation',
+ array('<br />', '<a href="http://piwik.org/docs/custom-variables/" target="_blank">', '</a>'));
+ $this->actionToLoadSubTables = 'getCustomVariablesValuesFromNameId';
+ $this->order = 10;
+ $this->widgetTitle = 'CustomVariables_CustomVariables';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->config->columns_to_display = array('label', 'nb_actions', 'nb_visits');
+ $view->config->show_goals = true;
+ $view->config->subtable_controller_action = 'getCustomVariablesValuesFromNameId';
+ $view->config->addTranslation('label', Piwik::translate('CustomVariables_ColumnCustomVariableName'));
+ $view->requestConfig->filter_sort_column = 'nb_actions';
+ $view->requestConfig->filter_sort_order = 'desc';
+ }
+
+}
diff --git a/plugins/CustomVariables/Reports/GetCustomVariablesValuesFromNameId.php b/plugins/CustomVariables/Reports/GetCustomVariablesValuesFromNameId.php
new file mode 100644
index 0000000000..cee1bf1f88
--- /dev/null
+++ b/plugins/CustomVariables/Reports/GetCustomVariablesValuesFromNameId.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
+ *
+ */
+namespace Piwik\Plugins\CustomVariables\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\CustomVariables\Columns\CustomVariableValue;
+
+class GetCustomVariablesValuesFromNameId extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new CustomVariableValue();
+ $this->name = Piwik::translate('CustomVariables_CustomVariables');
+ $this->documentation = Piwik::translate('CustomVariables_CustomVariablesReportDocumentation',
+ array('<br />', '<a href="http://piwik.org/docs/custom-variables/" target="_blank">', '</a>'));
+ $this->isSubtableReport = true;
+ $this->order = 15;
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->config->columns_to_display = array('label', 'nb_actions', 'nb_visits');
+ $view->config->show_goals = true;
+ $view->config->show_search = false;
+ $view->config->show_exclude_low_population = false;
+ $view->config->addTranslation('label', Piwik::translate('CustomVariables_ColumnCustomVariableValue'));
+ $view->requestConfig->filter_sort_column = 'nb_actions';
+ $view->requestConfig->filter_sort_order = 'desc';
+ }
+
+}
diff --git a/plugins/CustomVariables/Widgets.php b/plugins/CustomVariables/Widgets.php
deleted file mode 100644
index 183219b2d6..0000000000
--- a/plugins/CustomVariables/Widgets.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- *
- */
-namespace Piwik\Plugins\CustomVariables;
-
-use Piwik\WidgetsList;
-
-class Widgets extends \Piwik\Plugin\Widgets
-{
- public function configure(WidgetsList $widgetsList)
- {
- WidgetsList::add('General_Visitors', 'CustomVariables_CustomVariables', 'CustomVariables', 'getCustomVariables');
- }
-
-}
diff --git a/plugins/DevicesDetection/Columns/Base.php b/plugins/DevicesDetection/Columns/Base.php
new file mode 100644
index 0000000000..ffe9d45bdb
--- /dev/null
+++ b/plugins/DevicesDetection/Columns/Base.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\DevicesDetection\Columns;
+
+use \DeviceDetector;
+use Piwik\CacheFile;
+use Piwik\Plugin\VisitDimension;
+
+abstract class Base extends VisitDimension
+{
+ private static $uaParser = array();
+
+ /**
+ * @param string $userAgent
+ * @return DeviceDetector
+ */
+ public function getUAParser($userAgent)
+ {
+ $key = md5($userAgent);
+
+ if (!array_key_exists($key, self::$uaParser)) {
+
+ $UAParser = new \DeviceDetector($userAgent);
+ $UAParser->setCache(new CacheFile('tracker', 86400));
+ $UAParser->parse();
+
+ self::$uaParser[$key] = $UAParser;
+ }
+
+ return self::$uaParser[$key];
+ }
+}
diff --git a/plugins/DevicesDetection/Columns/BrowserName.php b/plugins/DevicesDetection/Columns/BrowserName.php
new file mode 100644
index 0000000000..f9d6cc552e
--- /dev/null
+++ b/plugins/DevicesDetection/Columns/BrowserName.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\DevicesDetection\Columns;
+
+use Piwik\Piwik;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+use Piwik\Tracker\Action;
+
+class BrowserName extends Base
+{
+ protected $fieldName = 'config_browser_name';
+
+ public function getName()
+ {
+ return Piwik::translate('UserSettings_BrowserFamilies');
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ $userAgent = $request->getUserAgent();
+ $parser = $this->getUAParser($userAgent);
+
+ return $parser->getBrowser("short_name");
+ }
+}
diff --git a/plugins/DevicesDetection/Columns/BrowserVersion.php b/plugins/DevicesDetection/Columns/BrowserVersion.php
new file mode 100644
index 0000000000..ecceac3772
--- /dev/null
+++ b/plugins/DevicesDetection/Columns/BrowserVersion.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\DevicesDetection\Columns;
+
+use Piwik\Piwik;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+use Piwik\Tracker\Action;
+
+class BrowserVersion extends Base
+{
+ protected $fieldName = 'config_browser_version';
+
+ public function getName()
+ {
+ return Piwik::translate('DevicesDetection_BrowserVersions');
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ $userAgent = $request->getUserAgent();
+ $parser = $this->getUAParser($userAgent);
+
+ return $parser->getBrowser("version");
+ }
+}
diff --git a/plugins/DevicesDetection/Columns/DeviceBrand.php b/plugins/DevicesDetection/Columns/DeviceBrand.php
new file mode 100644
index 0000000000..dddaa68185
--- /dev/null
+++ b/plugins/DevicesDetection/Columns/DeviceBrand.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
+ *
+ */
+namespace Piwik\Plugins\DevicesDetection\Columns;
+
+use Piwik\Piwik;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+use Piwik\Tracker\Action;
+
+class DeviceBrand extends Base
+{
+ protected $fieldName = 'config_device_brand';
+ protected $fieldType = 'VARCHAR( 100 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL';
+
+ public function getName()
+ {
+ return Piwik::translate('DevicesDetection_DeviceBrand');
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ $userAgent = $request->getUserAgent();
+ $parser = $this->getUAParser($userAgent);
+
+ return $parser->getBrand();
+ }
+}
diff --git a/plugins/DevicesDetection/Columns/DeviceModel.php b/plugins/DevicesDetection/Columns/DeviceModel.php
new file mode 100644
index 0000000000..078ddb3b1a
--- /dev/null
+++ b/plugins/DevicesDetection/Columns/DeviceModel.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
+ *
+ */
+namespace Piwik\Plugins\DevicesDetection\Columns;
+
+use Piwik\Piwik;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+use Piwik\Tracker\Action;
+
+class DeviceModel extends Base
+{
+ protected $fieldName = 'config_device_model';
+ protected $fieldType = 'VARCHAR( 100 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL';
+
+ public function getName()
+ {
+ return Piwik::translate('DevicesDetection_DeviceModel');
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ $userAgent = $request->getUserAgent();
+ $parser = $this->getUAParser($userAgent);
+
+ return $parser->getModel();
+ }
+}
diff --git a/plugins/DevicesDetection/Columns/DeviceType.php b/plugins/DevicesDetection/Columns/DeviceType.php
new file mode 100644
index 0000000000..00c242c381
--- /dev/null
+++ b/plugins/DevicesDetection/Columns/DeviceType.php
@@ -0,0 +1,62 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\DevicesDetection\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\Segment;
+use Piwik\Tracker\Request;
+use DeviceDetector;
+use Exception;
+use Piwik\Tracker\Visitor;
+use Piwik\Tracker\Action;
+
+class DeviceType extends Base
+{
+ protected $fieldName = 'config_device_type';
+ protected $fieldType = 'TINYINT( 100 ) NULL DEFAULT NULL';
+
+ protected function init()
+ {
+ $deviceTypeList = implode(", ", DeviceDetector::$deviceTypes);
+
+ $segment = new Segment();
+ $segment->setCategory('General_Visit');
+ $segment->setSegment('deviceType');
+ $segment->setName('DevicesDetection_DeviceType');
+ $segment->setAcceptedValues($deviceTypeList);
+ $segment->setSqlFilter(function ($type) use ($deviceTypeList) {
+ $index = array_search(strtolower(trim(urldecode($type))), DeviceDetector::$deviceTypes);
+ if ($index === false) {
+ throw new Exception("deviceType segment must be one of: $deviceTypeList");
+ }
+ return $index;
+ });
+
+ $this->addSegment($segment);
+ }
+
+ public function getName()
+ {
+ return Piwik::translate('DevicesDetection_DeviceType');
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ $userAgent = $request->getUserAgent();
+ $parser = $this->getUAParser($userAgent);
+
+ return $parser->getDevice();
+ }
+}
diff --git a/plugins/DevicesDetection/Columns/Os.php b/plugins/DevicesDetection/Columns/Os.php
new file mode 100644
index 0000000000..4c2f3bcc65
--- /dev/null
+++ b/plugins/DevicesDetection/Columns/Os.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\DevicesDetection\Columns;
+
+use Piwik\Piwik;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+use Piwik\Tracker\Action;
+
+class Os extends Base
+{
+ protected $fieldName = 'config_os';
+
+ public function getName()
+ {
+ return Piwik::translate('DevicesDetection_OperatingSystemFamilies');
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ $userAgent = $request->getUserAgent();
+ $parser = $this->getUAParser($userAgent);
+
+ return $parser->getOs("short_name");
+ }
+}
diff --git a/plugins/DevicesDetection/Columns/OsVersion.php b/plugins/DevicesDetection/Columns/OsVersion.php
new file mode 100644
index 0000000000..c92c89ff42
--- /dev/null
+++ b/plugins/DevicesDetection/Columns/OsVersion.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
+ *
+ */
+namespace Piwik\Plugins\DevicesDetection\Columns;
+
+use Piwik\Piwik;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+use Piwik\Tracker\Action;
+
+class OsVersion extends Base
+{
+ protected $fieldName = 'config_os_version';
+ protected $fieldType = 'VARCHAR( 100 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL';
+
+ public function getName()
+ {
+ return Piwik::translate('DevicesDetection_OperatingSystemVersions');
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ $userAgent = $request->getUserAgent();
+ $parser = $this->getUAParser($userAgent);
+
+ return $parser->getOs("version");
+ }
+}
diff --git a/plugins/DevicesDetection/DevicesDetection.php b/plugins/DevicesDetection/DevicesDetection.php
index 9cd6f6d877..e730e96aaa 100644
--- a/plugins/DevicesDetection/DevicesDetection.php
+++ b/plugins/DevicesDetection/DevicesDetection.php
@@ -1,6 +1,6 @@
<?php
/**
- * Piwik - free/libre analytics platform
+ * Piwik - Open source web analytics
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
@@ -36,311 +36,4 @@ class DevicesDetection extends \Piwik\Plugin
);
}
- /** The set of related reports displayed under the 'Operating Systems' header. */
- private $osRelatedReports = null;
- private $browserRelatedReports = null;
-
- public function __construct()
- {
- parent::__construct();
- $this->osRelatedReports = array(
- 'DevicesDetection.getOsFamilies' => Piwik::translate('DevicesDetection_OperatingSystemFamilies'),
- 'DevicesDetection.getOsVersions' => Piwik::translate('DevicesDetection_OperatingSystemVersions')
- );
- $this->browserRelatedReports = array(
- 'DevicesDetection.getBrowserFamilies' => Piwik::translate('UserSettings_BrowserFamilies'),
- 'DevicesDetection.getBrowserVersions' => Piwik::translate('DevicesDetection_BrowserVersions')
- );
- }
-
- protected function getRawMetadataDeviceType()
- {
- $deviceTypeList = implode(", ", DeviceDetector::$deviceTypes);
-
- $deviceTypeLabelToCode = function ($type) use ($deviceTypeList) {
- $index = array_search(strtolower(trim(urldecode($type))), DeviceDetector::$deviceTypes);
- if ($index === false) {
- throw new Exception("deviceType segment must be one of: $deviceTypeList");
- }
- return $index;
- };
-
- return array(
- 'DevicesDetection_DevicesDetection',
- 'DevicesDetection_DeviceType',
- 'DevicesDetection',
- 'getType',
- 'DevicesDetection_DeviceType',
-
- // Segment
- 'deviceType',
- 'log_visit.config_device_type',
- $deviceTypeList,
- $deviceTypeLabelToCode
- );
- }
-
- /**
- * @see Piwik\Plugin::getListHooksRegistered
- */
- public function getListHooksRegistered()
- {
- return array(
- 'Tracker.newVisitorInformation' => 'parseMobileVisitData',
- 'API.getReportMetadata' => 'getReportMetadata',
- 'API.getSegmentDimensionMetadata' => 'getSegmentsMetadata',
- 'ViewDataTable.configure' => 'configureViewDataTable',
- );
- }
-
- /**
- * Defines API reports.
- * Also used to define Widgets, and Segment(s)
- *
- * @return array Category, Report Name, API Module, API action, Translated column name, & optional segment info
- */
- public function getRawMetadataReports()
- {
-
- $report = array(
- // device type report (tablet, desktop, mobile...)
- $this->getRawMetadataDeviceType(),
-
- // device brands report
- array(
- 'DevicesDetection_DevicesDetection',
- 'DevicesDetection_DeviceBrand',
- 'DevicesDetection',
- 'getBrand',
- 'DevicesDetection_DeviceBrand',
- ),
- // device model report
- array(
- 'DevicesDetection_DevicesDetection',
- 'DevicesDetection_DeviceModel',
- 'DevicesDetection',
- 'getModel',
- 'DevicesDetection_DeviceModel',
- ),
- // device OS family report
- array(
- 'DevicesDetection_DevicesDetection',
- 'DevicesDetection_OperatingSystemFamilies',
- 'DevicesDetection',
- 'getOsFamilies',
- 'DevicesDetection_OperatingSystemFamilies',
- ),
- // device OS version report
- array(
- 'DevicesDetection_DevicesDetection',
- 'DevicesDetection_OperatingSystemVersions',
- 'DevicesDetection',
- 'getOsVersions',
- 'DevicesDetection_OperatingSystemVersions',
- ),
- // Browser family report
- array(
- 'DevicesDetection_DevicesDetection',
- 'UserSettings_BrowserFamilies',
- 'DevicesDetection',
- 'getBrowserFamilies',
- 'UserSettings_BrowserFamilies',
- ),
- // Browser versions report
- array(
- 'DevicesDetection_DevicesDetection',
- 'DevicesDetection_BrowserVersions',
- 'DevicesDetection',
- 'getBrowserVersions',
- 'DevicesDetection_BrowserVersions',
- ),
- );
- return $report;
- }
-
- /**
- * Get segments meta data
- */
- public function getSegmentsMetadata(&$segments)
- {
- // Note: only one field segmented so far: deviceType
- foreach ($this->getRawMetadataReports() as $report) {
- @list($category, $name, $apiModule, $apiAction, $columnName, $segment, $sqlSegment, $acceptedValues, $sqlFilter) = $report;
-
- if (empty($segment)) continue;
-
- $segments[] = array(
- 'type' => 'dimension',
- 'category' => Piwik::translate('General_Visit'),
- 'name' => $columnName,
- 'segment' => $segment,
- 'acceptedValues' => $acceptedValues,
- 'sqlSegment' => $sqlSegment,
- 'sqlFilter' => isset($sqlFilter) ? $sqlFilter : false
- );
- }
- }
-
- public function getReportMetadata(&$reports)
- {
- $i = 0;
- foreach ($this->getRawMetadataReports() as $report) {
- list($category, $name, $apiModule, $apiAction, $columnName) = $report;
- if ($category == false)
- continue;
-
- $report = array(
- 'category' => Piwik::translate($category),
- 'name' => Piwik::translate($name),
- 'module' => $apiModule,
- 'action' => $apiAction,
- 'dimension' => Piwik::translate($columnName),
- 'order' => $i++
- );
-
- $translation = $name . 'Documentation';
- $translated = Piwik::translate($translation, '<br />');
- if ($translated != $translation) {
- $report['documentation'] = $translated;
- }
-
- $reports[] = $report;
- }
- }
-
- public function install()
- {
- try {
- $q1 = "ALTER TABLE `" . Common::prefixTable("log_visit") . "`
- ADD `config_os_version` VARCHAR( 100 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `config_os` ,
- ADD `config_device_type` TINYINT( 100 ) NULL DEFAULT NULL AFTER `config_browser_version` ,
- ADD `config_device_brand` VARCHAR( 100 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `config_device_type` ,
- ADD `config_device_model` VARCHAR( 100 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `config_device_brand`";
- Db::exec($q1);
-
- } catch (Exception $e) {
- if (!Db::get()->isErrNo($e, '1060')) {
- throw $e;
- }
- }
- }
-
- public function parseMobileVisitData(&$visitorInfo, \Piwik\Tracker\Request $request)
- {
- $userAgent = $request->getUserAgent();
-
- $UAParser = new DeviceDetector($userAgent);
- $UAParser->setCache(new CacheFile('tracker', 86400));
- $UAParser->parse();
- $deviceInfo['config_browser_name'] = $UAParser->getBrowser("short_name");
- $deviceInfo['config_browser_version'] = $UAParser->getBrowser("version");
- $deviceInfo['config_os'] = $UAParser->getOs("short_name");
- $deviceInfo['config_os_version'] = $UAParser->getOs("version");
- $deviceInfo['config_device_type'] = $UAParser->getDevice();
- $deviceInfo['config_device_model'] = $UAParser->getModel();
- $deviceInfo['config_device_brand'] = $UAParser->getBrand();
-
- $visitorInfo = array_merge($visitorInfo, $deviceInfo);
- Common::printDebug("Device Detection:");
- Common::printDebug($deviceInfo);
- }
-
- public function configureViewDataTable(ViewDataTable $view)
- {
- switch ($view->requestConfig->apiMethodToRequestDataTable) {
- case 'DevicesDetection.getType':
- $this->configureViewForGetType($view);
- break;
- case 'DevicesDetection.getBrand':
- $this->configureViewForGetBrand($view);
- break;
- case 'DevicesDetection.getModel':
- $this->configureViewForGetModel($view);
- break;
- case 'DevicesDetection.getOsFamilies':
- $this->configureViewForGetOsFamilies($view);
- break;
- case 'DevicesDetection.getOsVersions':
- $this->configureViewForGetOsVersions($view);
- break;
- case 'DevicesDetection.getBrowserFamilies':
- $this->configureViewForGetBrowserFamilies($view);
- break;
- case 'DevicesDetection.getBrowserVersions':
- $this->configureViewForGetBrowserVersions($view);
- break;
- }
- }
-
- private function configureViewForGetType(ViewDataTable $view)
- {
- $view->config->show_search = false;
- $view->config->show_exclude_low_population = false;
- $view->config->addTranslation('label', Piwik::translate("DevicesDetection_dataTableLabelTypes"));
- }
-
- private function configureViewForGetBrand(ViewDataTable $view)
- {
- $view->config->show_search = false;
- $view->config->show_exclude_low_population = false;
- $view->config->addTranslation('label', Piwik::translate("DevicesDetection_dataTableLabelBrands"));
- }
-
- private function configureViewForGetModel(ViewDataTable $view)
- {
- $view->config->show_search = false;
- $view->config->show_exclude_low_population = false;
- $view->config->addTranslation('label', Piwik::translate("DevicesDetection_dataTableLabelModels"));
- }
-
- private function configureViewForGetOsFamilies(ViewDataTable $view)
- {
- $view->config->title = Piwik::translate('DevicesDetection_OperatingSystemFamilies');
- $view->config->show_search = false;
- $view->config->show_exclude_low_population = false;
- $view->config->addTranslation('label', Piwik::translate("UserSettings_OperatingSystemFamily"));
- $view->config->addRelatedReports($this->getOsRelatedReports());
- }
-
- private function configureViewForGetOsVersions(ViewDataTable $view)
- {
- $view->config->title = Piwik::translate('DevicesDetection_OperatingSystemVersions');
- $view->config->show_search = false;
- $view->config->show_exclude_low_population = false;
- $view->config->addTranslation('label', Piwik::translate("DevicesDetection_dataTableLabelSystemVersion"));
- $view->config->addRelatedReports($this->getOsRelatedReports());
- }
-
- private function configureViewForGetBrowserFamilies(ViewDataTable $view)
- {
- $view->config->title = Piwik::translate('UserSettings_BrowserFamilies');
- $view->config->show_search = false;
- $view->config->show_exclude_low_population = false;
- $view->config->addTranslation('label', Piwik::translate("DevicesDetection_dataTableLabelBrowserFamily"));
- $view->config->addRelatedReports($this->getBrowserRelatedReports());
- }
-
- private function configureViewForGetBrowserVersions(ViewDataTable $view)
- {
- $view->config->show_search = false;
- $view->config->show_exclude_low_population = false;
- $view->config->addTranslation('label', Piwik::translate("UserSettings_ColumnBrowserVersion"));
- $view->config->addRelatedReports($this->getBrowserRelatedReports());
- }
-
- private function getOsRelatedReports()
- {
- return array(
- 'DevicesDetection.getOsFamilies' => Piwik::translate('DevicesDetection_OperatingSystemFamilies'),
- 'DevicesDetection.getOsVersions' => Piwik::translate('DevicesDetection_OperatingSystemVersions')
- );
- }
-
- private function getBrowserRelatedReports()
- {
- return array(
- 'DevicesDetection.getBrowserFamilies' => Piwik::translate('UserSettings_BrowserFamilies'),
- 'DevicesDetection.getBrowserVersions' => Piwik::translate('DevicesDetection_BrowserVersions')
- );
- }
}
diff --git a/plugins/DevicesDetection/Reports/Base.php b/plugins/DevicesDetection/Reports/Base.php
new file mode 100644
index 0000000000..75222221b9
--- /dev/null
+++ b/plugins/DevicesDetection/Reports/Base.php
@@ -0,0 +1,19 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\DevicesDetection\Reports;
+
+use Piwik\Piwik;
+
+abstract class Base extends \Piwik\Plugin\Report
+{
+ protected function init()
+ {
+ $this->category = 'DevicesDetection_DevicesDetection';
+ }
+}
diff --git a/plugins/DevicesDetection/Reports/GetBrand.php b/plugins/DevicesDetection/Reports/GetBrand.php
new file mode 100644
index 0000000000..c932dcf19c
--- /dev/null
+++ b/plugins/DevicesDetection/Reports/GetBrand.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\DevicesDetection\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\DevicesDetection\Columns\Devicebrand;
+
+class GetBrand extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new Devicebrand();
+ $this->name = Piwik::translate('DevicesDetection_DeviceBrand');
+ $this->documentation = ''; // TODO
+ $this->order = 1;
+ $this->widgetTitle = 'DevicesDetection_DeviceBrand';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->config->show_search = false;
+ $view->config->show_exclude_low_population = false;
+ $view->config->addTranslation('label', Piwik::translate("DevicesDetection_dataTableLabelBrands"));
+ }
+
+}
diff --git a/plugins/DevicesDetection/Reports/GetBrowserFamilies.php b/plugins/DevicesDetection/Reports/GetBrowserFamilies.php
new file mode 100644
index 0000000000..b997f58511
--- /dev/null
+++ b/plugins/DevicesDetection/Reports/GetBrowserFamilies.php
@@ -0,0 +1,41 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\DevicesDetection\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\DevicesDetection\Columns\BrowserName;
+
+class GetBrowserFamilies extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new BrowserName();
+ $this->name = Piwik::translate('UserSettings_BrowserFamilies');
+ $this->documentation = ''; // TODO
+ $this->order = 5;
+ $this->widgetTitle = 'UserSettings_BrowserFamilies';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->config->title = $this->name;
+ $view->config->show_search = false;
+ $view->config->show_exclude_low_population = false;
+ $view->config->addTranslation('label', Piwik::translate("DevicesDetection_dataTableLabelBrowserFamily"));
+ }
+
+ public function getRelatedReports()
+ {
+ return array(
+ new GetBrowserVersions()
+ );
+ }
+}
diff --git a/plugins/DevicesDetection/Reports/GetBrowserVersions.php b/plugins/DevicesDetection/Reports/GetBrowserVersions.php
new file mode 100644
index 0000000000..12089da707
--- /dev/null
+++ b/plugins/DevicesDetection/Reports/GetBrowserVersions.php
@@ -0,0 +1,40 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\DevicesDetection\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\DevicesDetection\Columns\Browserversion;
+
+class GetBrowserVersions extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new Browserversion();
+ $this->name = Piwik::translate('DevicesDetection_BrowserVersions');
+ $this->documentation = ''; // TODO
+ $this->order = 6;
+ $this->widgetTitle = 'DevicesDetection_BrowserVersions';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->config->show_search = false;
+ $view->config->show_exclude_low_population = false;
+ $view->config->addTranslation('label', Piwik::translate("UserSettings_ColumnBrowserVersion"));
+ }
+
+ public function getRelatedReports()
+ {
+ return array(
+ new GetBrowserFamilies()
+ );
+ }
+}
diff --git a/plugins/DevicesDetection/Reports/GetModel.php b/plugins/DevicesDetection/Reports/GetModel.php
new file mode 100644
index 0000000000..1537dcff47
--- /dev/null
+++ b/plugins/DevicesDetection/Reports/GetModel.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\DevicesDetection\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\DevicesDetection\Columns\Devicemodel;
+
+class GetModel extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new Devicemodel();
+ $this->name = Piwik::translate('DevicesDetection_DeviceModel');
+ $this->documentation = ''; // TODO
+ $this->order = 2;
+ $this->widgetTitle = 'DevicesDetection_DeviceModel';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->config->show_search = false;
+ $view->config->show_exclude_low_population = false;
+ $view->config->addTranslation('label', Piwik::translate("DevicesDetection_dataTableLabelModels"));
+ }
+
+}
diff --git a/plugins/DevicesDetection/Reports/GetOsFamilies.php b/plugins/DevicesDetection/Reports/GetOsFamilies.php
new file mode 100644
index 0000000000..e78b666b2a
--- /dev/null
+++ b/plugins/DevicesDetection/Reports/GetOsFamilies.php
@@ -0,0 +1,42 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\DevicesDetection\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\DevicesDetection\Columns\Os;
+
+class GetOsFamilies extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new Os();
+ $this->name = Piwik::translate('DevicesDetection_OperatingSystemFamilies');
+ $this->documentation = ''; // TODO
+ $this->order = 3;
+ $this->widgetTitle = 'DevicesDetection_OperatingSystemFamilies';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->config->title = $this->name;
+ $view->config->show_search = false;
+ $view->config->show_exclude_low_population = false;
+ $view->config->addTranslation('label', Piwik::translate("UserSettings_OperatingSystemFamily"));
+ }
+
+ public function getRelatedReports()
+ {
+ return array(
+ new GetOsVersions()
+ );
+ }
+
+}
diff --git a/plugins/DevicesDetection/Reports/GetOsVersions.php b/plugins/DevicesDetection/Reports/GetOsVersions.php
new file mode 100644
index 0000000000..6dd5cc0ef1
--- /dev/null
+++ b/plugins/DevicesDetection/Reports/GetOsVersions.php
@@ -0,0 +1,41 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\DevicesDetection\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\DevicesDetection\Columns\OsVersion;
+
+class GetOsVersions extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new OsVersion();
+ $this->name = Piwik::translate('DevicesDetection_OperatingSystemVersions');
+ $this->documentation = ''; // TODO
+ $this->order = 4;
+ $this->widgetTitle = 'DevicesDetection_OperatingSystemVersions';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->config->title = $this->name;
+ $view->config->show_search = false;
+ $view->config->show_exclude_low_population = false;
+ $view->config->addTranslation('label', Piwik::translate("DevicesDetection_dataTableLabelSystemVersion"));
+ }
+
+ public function getRelatedReports()
+ {
+ return array(
+ new GetOsFamilies()
+ );
+ }
+}
diff --git a/plugins/DevicesDetection/Reports/GetType.php b/plugins/DevicesDetection/Reports/GetType.php
new file mode 100644
index 0000000000..db4b2d06e9
--- /dev/null
+++ b/plugins/DevicesDetection/Reports/GetType.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\DevicesDetection\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\DevicesDetection\Columns\Devicetype;
+
+class GetType extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new Devicetype();
+ $this->name = Piwik::translate('DevicesDetection_DeviceType');
+ $this->documentation = ''; // TODO
+ $this->order = 0;
+ $this->widgetTitle = 'DevicesDetection_DeviceType';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->config->show_search = false;
+ $view->config->show_exclude_low_population = false;
+ $view->config->addTranslation('label', Piwik::translate("DevicesDetection_dataTableLabelTypes"));
+ }
+
+}
diff --git a/plugins/DevicesDetection/Widgets.php b/plugins/DevicesDetection/Widgets.php
deleted file mode 100644
index 0df651064d..0000000000
--- a/plugins/DevicesDetection/Widgets.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- *
- */
-namespace Piwik\Plugins\DevicesDetection;
-
-use Piwik\WidgetsList;
-
-class Widgets extends \Piwik\Plugin\Widgets
-{
- public function configure(WidgetsList $widgetsList)
- {
- $detection = new DevicesDetection();
-
- foreach ($detection->getRawMetadataReports() as $report) {
- list($category, $name, $controllerName, $controllerAction) = $report;
- if ($category == false)
- continue;
- $widgetsList->add($category, $name, $controllerName, $controllerAction);
- }
- }
-
-}
diff --git a/core/Tracker/ActionEvent.php b/plugins/Events/Actions/ActionEvent.php
index 73441a5a0d..51bbd476cd 100644
--- a/core/Tracker/ActionEvent.php
+++ b/plugins/Events/Actions/ActionEvent.php
@@ -7,9 +7,11 @@
*
*/
-namespace Piwik\Tracker;
+namespace Piwik\Plugins\Events\Actions;
use Piwik\Common;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\Request;
use Piwik\Tracker;
/**
@@ -18,37 +20,34 @@ use Piwik\Tracker;
*/
class ActionEvent extends Action
{
- function __construct($eventCategory, $eventAction, $url, Request $request)
+ public function __construct(Request $request)
{
parent::__construct(Action::TYPE_EVENT, $request);
+
+ $url = $request->getParam('url');
+
$this->setActionUrl($url);
- $this->eventCategory = trim($eventCategory);
- $this->eventAction = trim($eventAction);
- $this->eventName = trim($request->getParam('e_n'));
$this->eventValue = trim($request->getParam('e_v'));
}
- function getCustomFloatValue()
+ public function shouldHandle()
+ {
+ $eventCategory = $this->request->getParam('e_c');
+ $eventAction = $this->request->getParam('e_a');
+
+ return (strlen($eventCategory) > 0 && strlen($eventAction) > 0);
+ }
+
+ public function getCustomFloatValue()
{
return $this->eventValue;
}
protected function getActionsToLookup()
{
- $actions = array(
+ return array(
'idaction_url' => $this->getUrlAndType()
);
-
- if(strlen($this->eventName) > 0) {
- $actions['idaction_name'] = array($this->eventName, Action::TYPE_EVENT_NAME);
- }
- if(strlen($this->eventCategory) > 0) {
- $actions['idaction_event_category'] = array($this->eventCategory, Action::TYPE_EVENT_CATEGORY);
- }
- if(strlen($this->eventAction) > 0) {
- $actions['idaction_event_action'] = array($this->eventAction, Action::TYPE_EVENT_ACTION);
- }
- return $actions;
}
// Do not track this Event URL as Entry/Exit Page URL (leave the existing entry/exit)
@@ -66,13 +65,9 @@ class ActionEvent extends Action
public function writeDebugInfo()
{
$write = parent::writeDebugInfo();
- if($write) {
- Common::printDebug("Event Category = " . $this->eventCategory . ",
- Event Action = " . $this->eventAction . ",
- Event Name = " . $this->eventName . ",
- Event Value = " . $this->getCustomFloatValue());
+ if ($write) {
+ Common::printDebug("Event Value = " . $this->getCustomFloatValue());
}
return $write;
}
-
}
diff --git a/plugins/Events/Columns/EventAction.php b/plugins/Events/Columns/EventAction.php
new file mode 100644
index 0000000000..f65b4a6e3b
--- /dev/null
+++ b/plugins/Events/Columns/EventAction.php
@@ -0,0 +1,56 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Events\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ActionDimension;
+use Piwik\Plugins\Events\Segment;
+use Piwik\Plugins\Events\Actions\ActionEvent;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\Request;
+
+class EventAction extends ActionDimension
+{
+ protected $fieldName = 'idaction_event_action';
+ protected $fieldType = 'INTEGER(10) UNSIGNED DEFAULT NULL';
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setSegment('eventAction');
+ $segment->setName('Events_EventAction');
+ $this->addSegment($segment);
+ }
+
+ public function getName()
+ {
+ return Piwik::translate('Events_EventAction');
+ }
+
+ public function getActionId()
+ {
+ return Action::TYPE_EVENT_ACTION;
+ }
+
+ public function onLookupAction(Request $request, Action $action)
+ {
+ if (!($action instanceof ActionEvent)) {
+ return false;
+ }
+
+ $eventAction = $request->getParam('e_a');
+ $eventAction = trim($eventAction);
+
+ if (strlen($eventAction) > 0) {
+ return $eventAction;
+ }
+
+ return false;
+ }
+} \ No newline at end of file
diff --git a/plugins/Events/Columns/EventCategory.php b/plugins/Events/Columns/EventCategory.php
new file mode 100644
index 0000000000..13e76f83a2
--- /dev/null
+++ b/plugins/Events/Columns/EventCategory.php
@@ -0,0 +1,56 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Events\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ActionDimension;
+use Piwik\Plugins\Events\Segment;
+use Piwik\Plugins\Events\Actions\ActionEvent;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\Request;
+
+class EventCategory extends ActionDimension
+{
+ protected $fieldName = 'idaction_event_category';
+ protected $fieldType = 'INTEGER(10) UNSIGNED DEFAULT NULL';
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setSegment('eventCategory');
+ $segment->setName('Events_EventCategory');
+ $this->addSegment($segment);
+ }
+
+ public function getName()
+ {
+ return Piwik::translate('Events_EventCategory');
+ }
+
+ public function getActionId()
+ {
+ return Action::TYPE_EVENT_CATEGORY;
+ }
+
+ public function onLookupAction(Request $request, Action $action)
+ {
+ if (!($action instanceof ActionEvent)) {
+ return false;
+ }
+
+ $eventCategory = $request->getParam('e_c');
+ $eventCategory = trim($eventCategory);
+
+ if (strlen($eventCategory) > 0) {
+ return $eventCategory;
+ }
+
+ return false;
+ }
+} \ No newline at end of file
diff --git a/plugins/Events/Columns/EventName.php b/plugins/Events/Columns/EventName.php
new file mode 100644
index 0000000000..c2f084d3cd
--- /dev/null
+++ b/plugins/Events/Columns/EventName.php
@@ -0,0 +1,55 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Events\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ActionDimension;
+use Piwik\Plugins\Events\Segment;
+use Piwik\Plugins\Events\Actions\ActionEvent;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\Request;
+
+class EventName extends ActionDimension
+{
+ protected $fieldName = 'idaction_name';
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setSegment('eventName');
+ $segment->setName('Events_EventName');
+ $this->addSegment($segment);
+ }
+
+ public function getName()
+ {
+ return Piwik::translate('Events_EventName');
+ }
+
+ public function getActionId()
+ {
+ return Action::TYPE_EVENT_NAME;
+ }
+
+ public function onLookupAction(Request $request, Action $action)
+ {
+ if (!($action instanceof ActionEvent)) {
+ return false;
+ }
+
+ $eventName = $request->getParam('e_n');
+ $eventName = trim($eventName);
+
+ if (strlen($eventName) > 0) {
+ return $eventName;
+ }
+
+ return false;
+ }
+} \ No newline at end of file
diff --git a/plugins/Events/Columns/TotalEvents.php b/plugins/Events/Columns/TotalEvents.php
new file mode 100644
index 0000000000..d94717ea41
--- /dev/null
+++ b/plugins/Events/Columns/TotalEvents.php
@@ -0,0 +1,77 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Events\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+use Piwik\Plugin\Segment;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+
+class TotalEvents extends VisitDimension
+{
+ protected $fieldName = 'visit_total_events';
+ protected $fieldType = 'SMALLINT(5) UNSIGNED NOT NULL';
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setSegment('events');
+ $segment->setName('Events_TotalEvents');
+ $segment->setAcceptedValues('To select all visits who triggered an Event, use: &segment=events>0');
+ $segment->setCategory('General_Visit');
+ $segment->setType(Segment::TYPE_METRIC);
+ $this->addSegment($segment);
+ }
+
+ public function getName()
+ {
+ return Piwik::translate('Events_EventName');
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ if ($this->isEventAction($action)) {
+ return 1;
+ }
+
+ return 0;
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return int
+ */
+ public function onExistingVisit(Request $request, Visitor $visitor, $action)
+ {
+ if ($this->isEventAction($action)) {
+ return 'visit_total_events + 1';
+ }
+
+ return false;
+ }
+
+ /**
+ * @param Action|null $action
+ * @return bool
+ */
+ private function isEventAction($action)
+ {
+ return ($action && $action->getActionType() == Action::TYPE_EVENT);
+ }
+} \ No newline at end of file
diff --git a/plugins/Events/Events.php b/plugins/Events/Events.php
index bdc7522e54..4992ca3452 100644
--- a/plugins/Events/Events.php
+++ b/plugins/Events/Events.php
@@ -10,10 +10,7 @@ namespace Piwik\Plugins\Events;
use Piwik\Common;
use Piwik\Piwik;
-use Piwik\Plugin\ViewDataTable;
-/**
- */
class Events extends \Piwik\Plugin
{
/**
@@ -22,11 +19,8 @@ class Events extends \Piwik\Plugin
public function getListHooksRegistered()
{
return array(
- 'API.getSegmentDimensionMetadata' => 'getSegmentsMetadata',
- 'Metrics.getDefaultMetricTranslations' => 'addMetricTranslations',
- 'API.getReportMetadata' => 'getReportMetadata',
- 'ViewDataTable.configure' => 'configureViewDataTable',
-
+ 'Metrics.getDefaultMetricTranslations' => 'addMetricTranslations',
+ 'Metrics.getDefaultMetricDocumentationTranslations' => 'addMetricDocumentationTranslations'
);
}
@@ -35,6 +29,11 @@ class Events extends \Piwik\Plugin
$translations = array_merge($translations, $this->getMetricTranslations());
}
+ public function addMetricDocumentationTranslations(&$translations)
+ {
+ $translations = array_merge($translations, $this->getMetricDocumentation());
+ }
+
public function getMetricDocumentation()
{
$documentation = array(
@@ -87,26 +86,6 @@ class Events extends \Piwik\Plugin
public function getSegmentsMetadata(&$segments)
{
- $sqlFilter = '\\Piwik\\Tracker\\TableLogAction::getIdActionFromSegment';
-
- foreach($this->metadataDimensions as $dimension => $metadata) {
- $segments[] = array(
- 'type' => 'dimension',
- 'category' => 'Events_Events',
- 'name' => $metadata[0],
- 'segment' => $dimension,
- 'sqlSegment' => $metadata[1],
- 'sqlFilter' => $sqlFilter,
- );
- }
- $segments[] = array(
- 'type' => 'metric',
- 'category' => Piwik::translate('General_Visit'),
- 'name' => 'Events_TotalEvents',
- 'segment' => 'events',
- 'sqlSegment' => 'log_visit.visit_total_events',
- 'acceptedValues' => 'To select all visits who triggered an Event, use: &segment=events>0',
- );
// $segments[] = array(
// 'type' => 'metric',
// 'category' => 'Events_Events',
@@ -128,33 +107,6 @@ class Events extends \Piwik\Plugin
// );
// }
- public function getReportMetadata(&$reports)
- {
- $metrics = $this->getMetricTranslations();
- $documentation = $this->getMetricDocumentation();
- $labelTranslations = $this->getLabelTranslations();
-
- $order = 0;
- foreach($labelTranslations as $action => $translations) {
- $secondaryDimension = $this->getSecondaryDimensionFromRequest();
- $actionToLoadSubtables = API::getInstance()->getActionToLoadSubtables($action, $secondaryDimension);
- $reports[] = array(
- 'category' => Piwik::translate('Events_Events'),
- 'name' => Piwik::translate($translations[0]),
- 'module' => 'Events',
- 'action' => $action,
- 'dimension' => Piwik::translate($translations[1]),
- 'metrics' => $metrics,
- 'metricsDocumentation' => $documentation,
- 'processedMetrics' => false,
- 'actionToLoadSubTables' => $actionToLoadSubtables,
- 'order' => $order++
- );
-
- }
- }
-
-
/**
* Given getCategory, returns "Event Categories"
*
@@ -190,97 +142,10 @@ class Events extends \Piwik\Plugin
throw new \Exception("Translation not found for report $apiMethod");
}
- public function configureViewDataTable(ViewDataTable $view)
- {
- if($view->requestConfig->getApiModuleToRequest() != 'Events') {
- return;
- }
-
- // eg. 'Events.getCategory'
- $apiMethod = $view->requestConfig->getApiMethodToRequest();
-
- $secondaryDimension = $this->getSecondaryDimensionFromRequest();
- $view->config->subtable_controller_action = API::getInstance()->getActionToLoadSubtables($apiMethod, $secondaryDimension);
- $view->config->columns_to_display = array('label', 'nb_events', 'sum_event_value');
- $view->config->show_flatten_table = true;
- $view->config->show_table_all_columns = false;
- $view->requestConfig->filter_sort_column = 'nb_events';
-
- $labelTranslation = $this->getColumnTranslation($apiMethod);
- $view->config->addTranslation('label', $labelTranslation);
- $view->config->addTranslations($this->getMetricTranslations());
- $this->addRelatedReports($view, $secondaryDimension);
- $this->addTooltipEventValue($view);
- }
-
- protected function addRelatedReports($view, $secondaryDimension)
- {
- if(empty($secondaryDimension)) {
- // eg. Row Evolution
- return;
- }
- $view->config->show_related_reports = true;
-
- $apiMethod = $view->requestConfig->getApiMethodToRequest();
- $secondaryDimensions = API::getInstance()->getSecondaryDimensions($apiMethod);
-
- if(empty($secondaryDimensions)) {
- return;
- }
-
- $secondaryDimensionTranslation = $this->getDimensionLabel($secondaryDimension);
- $view->config->related_reports_title =
- Piwik::translate('Events_SecondaryDimension', $secondaryDimensionTranslation)
- . "<br/>"
- . Piwik::translate('Events_SwitchToSecondaryDimension', '');
-
- foreach($secondaryDimensions as $dimension) {
- if($dimension == $secondaryDimension) {
- // don't show as related report the currently selected dimension
- continue;
- }
-
- $dimensionTranslation = $this->getDimensionLabel($dimension);
- $view->config->addRelatedReport(
- $view->requestConfig->apiMethodToRequestDataTable,
- $dimensionTranslation,
- array('secondaryDimension' => $dimension)
- );
- }
-
- }
-
- protected function addTooltipEventValue($view)
- {
- // Creates the tooltip message for Event Value column
- $tooltipCallback = function ($hits, $min, $max, $avg) {
- if (!$hits) {
- return false;
- }
- $msgEventMinMax = Piwik::translate("Events_EventValueTooltip", array($hits, "<br />", $min, $max));
- $msgEventAvg = Piwik::translate("Events_AvgEventValue", $avg);
- return $msgEventMinMax . "<br/>" . $msgEventAvg;
- };
-
- // Add tooltip metadata column to the DataTable
- $view->config->filters[] = array('ColumnCallbackAddMetadata',
- array(
- array(
- 'nb_events',
- 'min_event_value',
- 'max_event_value',
- 'avg_event_value'
- ),
- 'sum_event_value_tooltip',
- $tooltipCallback
- )
- );
- }
-
/**
* @return mixed
*/
- protected function getSecondaryDimensionFromRequest()
+ public function getSecondaryDimensionFromRequest()
{
return Common::getRequestVar('secondaryDimension', false, 'string');
}
diff --git a/plugins/Events/Reports/Base.php b/plugins/Events/Reports/Base.php
new file mode 100644
index 0000000000..f119db5326
--- /dev/null
+++ b/plugins/Events/Reports/Base.php
@@ -0,0 +1,117 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Events\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\Events\API;
+use Piwik\Plugins\Events\Events;
+
+abstract class Base extends \Piwik\Plugin\Report
+{
+ protected function init()
+ {
+ $this->category = 'Events_Events';
+ $this->processedMetrics = false;
+
+ $this->widgetParams = array(
+ 'secondaryDimension' => API::getInstance()->getDefaultSecondaryDimension($this->action)
+ );
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ if ($view->requestConfig->getApiModuleToRequest() != 'Events') {
+ return;
+ }
+
+ // eg. 'Events.getCategory'
+ $apiMethod = $view->requestConfig->getApiMethodToRequest();
+
+ $events = new Events();
+ $secondaryDimension = $events->getSecondaryDimensionFromRequest();
+ $view->config->subtable_controller_action = API::getInstance()->getActionToLoadSubtables($apiMethod, $secondaryDimension);
+ $view->config->columns_to_display = array('label', 'nb_events', 'sum_event_value');
+ $view->config->show_flatten_table = true;
+ $view->config->show_table_all_columns = false;
+ $view->requestConfig->filter_sort_column = 'nb_events';
+
+ $labelTranslation = $events->getColumnTranslation($apiMethod);
+ $view->config->addTranslation('label', $labelTranslation);
+ $view->config->addTranslations($events->getMetricTranslations());
+ $this->addRelatedReports($view, $secondaryDimension);
+ $this->addTooltipEventValue($view);
+ }
+
+ private function addRelatedReports($view, $secondaryDimension)
+ {
+ if(empty($secondaryDimension)) {
+ // eg. Row Evolution
+ return;
+ }
+
+ $events = new Events();
+ $view->config->show_related_reports = true;
+
+ $apiMethod = $view->requestConfig->getApiMethodToRequest();
+ $secondaryDimensions = API::getInstance()->getSecondaryDimensions($apiMethod);
+
+ if(empty($secondaryDimensions)) {
+ return;
+ }
+
+ $secondaryDimensionTranslation = $events->getDimensionLabel($secondaryDimension);
+ $view->config->related_reports_title =
+ Piwik::translate('Events_SecondaryDimension', $secondaryDimensionTranslation)
+ . "<br/>"
+ . Piwik::translate('Events_SwitchToSecondaryDimension', '');
+
+ foreach($secondaryDimensions as $dimension) {
+ if($dimension == $secondaryDimension) {
+ // don't show as related report the currently selected dimension
+ continue;
+ }
+
+ $dimensionTranslation = $events->getDimensionLabel($dimension);
+ $view->config->addRelatedReport(
+ $view->requestConfig->apiMethodToRequestDataTable,
+ $dimensionTranslation,
+ array('secondaryDimension' => $dimension)
+ );
+ }
+
+ }
+
+ private function addTooltipEventValue($view)
+ {
+ // Creates the tooltip message for Event Value column
+ $tooltipCallback = function ($hits, $min, $max, $avg) {
+ if (!$hits) {
+ return false;
+ }
+ $msgEventMinMax = Piwik::translate("Events_EventValueTooltip", array($hits, "<br />", $min, $max));
+ $msgEventAvg = Piwik::translate("Events_AvgEventValue", $avg);
+ return $msgEventMinMax . "<br/>" . $msgEventAvg;
+ };
+
+ // Add tooltip metadata column to the DataTable
+ $view->config->filters[] = array('ColumnCallbackAddMetadata',
+ array(
+ array(
+ 'nb_events',
+ 'min_event_value',
+ 'max_event_value',
+ 'avg_event_value'
+ ),
+ 'sum_event_value_tooltip',
+ $tooltipCallback
+ )
+ );
+ }
+}
diff --git a/plugins/Events/Reports/GetAction.php b/plugins/Events/Reports/GetAction.php
new file mode 100644
index 0000000000..25274b61e8
--- /dev/null
+++ b/plugins/Events/Reports/GetAction.php
@@ -0,0 +1,28 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Events\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\Events\Columns\EventAction;
+
+class GetAction extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new EventAction();
+ $this->name = Piwik::translate('Events_EventActions');
+ $this->documentation = ''; // TODO
+ $this->metrics = array('nb_events', 'sum_event_value', 'min_event_value', 'max_event_value', 'avg_event_value', 'nb_events_with_value');
+ $this->actionToLoadSubTables = 'getNameFromActionId';
+ $this->order = 1;
+ $this->widgetTitle = 'Events_EventActions';
+ }
+}
diff --git a/plugins/Events/Reports/GetCategory.php b/plugins/Events/Reports/GetCategory.php
new file mode 100644
index 0000000000..ef98250af9
--- /dev/null
+++ b/plugins/Events/Reports/GetCategory.php
@@ -0,0 +1,28 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Events\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\Events\Columns\EventCategory;
+
+class GetCategory extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new EventCategory();
+ $this->name = Piwik::translate('Events_EventCategories');
+ $this->documentation = ''; // TODO
+ $this->metrics = array('nb_events', 'sum_event_value', 'min_event_value', 'max_event_value', 'avg_event_value', 'nb_events_with_value');
+ $this->actionToLoadSubTables = 'getActionFromCategoryId';
+ $this->order = 0;
+ $this->widgetTitle = 'Events_EventCategories';
+ }
+}
diff --git a/plugins/Events/Reports/GetName.php b/plugins/Events/Reports/GetName.php
new file mode 100644
index 0000000000..445ba50ffa
--- /dev/null
+++ b/plugins/Events/Reports/GetName.php
@@ -0,0 +1,28 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Events\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\Events\Columns\EventName;
+
+class GetName extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new EventName();
+ $this->name = Piwik::translate('Events_EventNames');
+ $this->documentation = ''; // TODO
+ $this->metrics = array('nb_events', 'sum_event_value', 'min_event_value', 'max_event_value', 'avg_event_value', 'nb_events_with_value');
+ $this->actionToLoadSubTables = 'getActionFromNameId';
+ $this->order = 2;
+ $this->widgetTitle = 'Events_EventNames';
+ }
+}
diff --git a/plugins/Events/Segment.php b/plugins/Events/Segment.php
new file mode 100644
index 0000000000..9c2d738bee
--- /dev/null
+++ b/plugins/Events/Segment.php
@@ -0,0 +1,22 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Events;
+
+/**
+ * Events segment base class.
+ *
+ */
+class Segment extends \Piwik\Plugin\Segment
+{
+ protected function init()
+ {
+ $this->setCategory('Events_Events');
+ $this->setSqlFilter('\Piwik\Tracker\TableLogAction::getIdActionFromSegment');
+ }
+}
diff --git a/plugins/Events/Widgets.php b/plugins/Events/Widgets.php
deleted file mode 100644
index d08c285d66..0000000000
--- a/plugins/Events/Widgets.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- *
- */
-namespace Piwik\Plugins\Events;
-
-use Piwik\WidgetsList;
-
-class Widgets extends \Piwik\Plugin\Widgets
-{
- public function configure(WidgetsList $widgetsList)
- {
- foreach(Events::getLabelTranslations() as $apiMethod => $labels) {
- $params = array(
- 'secondaryDimension' => API::getInstance()->getDefaultSecondaryDimension($apiMethod)
- );
- $widgetsList->add('Events_Events', $labels[0], 'Events', $apiMethod, $params);
- }
- }
-
-}
diff --git a/plugins/Goals/Goals.php b/plugins/Goals/Goals.php
index fea8fb0b18..86907b67b0 100644
--- a/plugins/Goals/Goals.php
+++ b/plugins/Goals/Goals.php
@@ -12,6 +12,7 @@ use Piwik\ArchiveProcessor;
use Piwik\Common;
use Piwik\Db;
use Piwik\Piwik;
+use Piwik\Plugin\Report;
use Piwik\Plugin\ViewDataTable;
use Piwik\Site;
use Piwik\Tracker\GoalManager;
@@ -111,11 +112,25 @@ class Goals extends \Piwik\Plugin
'Goals.getReportsWithGoalMetrics' => 'getActualReportsWithGoalMetrics',
'ViewDataTable.configure' => 'configureViewDataTable',
'Translate.getClientSideTranslationKeys' => 'getClientSideTranslationKeys',
- 'ViewDataTable.addViewDataTable' => 'getAvailableDataTableVisualizations'
+ 'ViewDataTable.addViewDataTable' => 'getAvailableDataTableVisualizations',
+ 'Metrics.getDefaultMetricTranslations' => 'addMetricTranslations'
);
return $hooks;
}
+
+ public function addMetricTranslations(&$translations)
+ {
+ $metrics = array(
+ 'orders' => 'General_EcommerceOrders',
+ 'ecommerce_revenue' => 'General_ProductRevenue'
+ );
+
+ $metrics = array_map(array('\\Piwik\\Piwik', 'translate'), $metrics);
+
+ $translations = array_merge($translations, $metrics);
+ }
+
public function getAvailableDataTableVisualizations(&$visualizations)
{
$visualizations[] = 'Piwik\\Plugins\\Goals\\Visualizations\\Goals';
@@ -373,6 +388,17 @@ class Goals extends \Piwik\Plugin
{
$reportsWithGoals = array();
+ foreach (Report::getAllReports() as $report) {
+ if ($report->hasGoalMetrics()) {
+ $reportsWithGoals[] = array(
+ 'category' => $report->getCategory(),
+ 'name' => $report->getName(),
+ 'module' => $report->getModule(),
+ 'action' => $report->getAction(),
+ );
+ }
+ }
+
/**
* Triggered when gathering all reports that contain Goal metrics. The list of reports
* will be displayed on the left column of the bottom of every _Goals_ page.
@@ -400,6 +426,7 @@ class Goals extends \Piwik\Plugin
* - **name**: The report's translated name.
* - **module**: The plugin the report is in, eg, `'UserCountry'`.
* - **action**: The API method of the report, eg, `'getCountry'`.
+ * @ignore
*/
Piwik::postEvent('Goals.getReportsWithGoalMetrics', array(&$reportsWithGoals));
diff --git a/plugins/Live/Visitor.php b/plugins/Live/Visitor.php
index 140739e506..3af5818d76 100644
--- a/plugins/Live/Visitor.php
+++ b/plugins/Live/Visitor.php
@@ -15,10 +15,11 @@ use Piwik\Date;
use Piwik\Db;
use Piwik\IP;
use Piwik\Piwik;
-use Piwik\Plugins\API\API as APIMetadata;
+use Piwik\Plugins\CoreHome\Columns\VisitGoalBuyer;
use Piwik\Plugins\CustomVariables\CustomVariables;
use Piwik\Plugins\Referrers\API as APIReferrers;
use Piwik\Plugins\UserCountry\LocationProvider\GeoIp;
+use Piwik\Plugins\Actions\Actions\ActionSiteSearch;
use Piwik\Tracker;
use Piwik\Tracker\Action;
use Piwik\Tracker\GoalManager;
@@ -589,7 +590,7 @@ class Visitor
function getVisitEcommerceStatus()
{
- return APIMetadata::getVisitEcommerceStatusFromId($this->details['visit_goal_buyer']);
+ return VisitGoalBuyer::getVisitEcommerceStatusFromId($this->details['visit_goal_buyer']);
}
function getVisitorGoalConvertedIcon()
@@ -970,8 +971,8 @@ class Visitor
private static function getCustomVariablePrettyKey($key)
{
$rename = array(
- Tracker\ActionSiteSearch::CVAR_KEY_SEARCH_CATEGORY => Piwik::translate('Actions_ColumnSearchCategory'),
- Tracker\ActionSiteSearch::CVAR_KEY_SEARCH_COUNT => Piwik::translate('Actions_ColumnSearchResultsCount'),
+ ActionSiteSearch::CVAR_KEY_SEARCH_CATEGORY => Piwik::translate('Actions_ColumnSearchCategory'),
+ ActionSiteSearch::CVAR_KEY_SEARCH_COUNT => Piwik::translate('Actions_ColumnSearchResultsCount'),
);
if (isset($rename[$key])) {
return $rename[$key];
diff --git a/plugins/MultiSites/Columns/Website.php b/plugins/MultiSites/Columns/Website.php
new file mode 100644
index 0000000000..2dd6aa9b59
--- /dev/null
+++ b/plugins/MultiSites/Columns/Website.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\MultiSites\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+
+class Website extends VisitDimension
+{
+ public function getName()
+ {
+ return Piwik::translate('General_Website');
+ }
+} \ No newline at end of file
diff --git a/plugins/MultiSites/MultiSites.php b/plugins/MultiSites/MultiSites.php
index c286b9b3dd..e0b78fd027 100644
--- a/plugins/MultiSites/MultiSites.php
+++ b/plugins/MultiSites/MultiSites.php
@@ -10,10 +10,6 @@ namespace Piwik\Plugins\MultiSites;
use Piwik\Piwik;
-
-/**
- *
- */
class MultiSites extends \Piwik\Plugin
{
public function getInformation()
@@ -31,9 +27,25 @@ class MultiSites extends \Piwik\Plugin
return array(
'AssetManager.getStylesheetFiles' => 'getStylesheetFiles',
'AssetManager.getJavaScriptFiles' => 'getJsFiles',
- 'API.getReportMetadata' => 'getReportMetadata',
'Translate.getClientSideTranslationKeys' => 'getClientSideTranslationKeys',
+ 'Metrics.getDefaultMetricTranslations' => 'addMetricTranslations'
+ );
+ }
+
+ public function addMetricTranslations(&$translations)
+ {
+ $appendix = " " . Piwik::translate('MultiSites_Evolution');
+ $metrics = array(
+ 'visits_evolution' => Piwik::translate('General_ColumnNbVisits') . $appendix,
+ 'actions_evolution' => Piwik::translate('General_ColumnNbActions') . $appendix,
+ 'pageviews_evolution' => Piwik::translate('General_ColumnPageviews') . $appendix,
+ 'revenue_evolution' => Piwik::translate('General_ColumnRevenue') . $appendix,
+ 'nb_conversions_evolution' => Piwik::translate('Goals_ColumnConversions') . $appendix,
+ 'orders_evolution' => Piwik::translate('General_EcommerceOrders') . $appendix,
+ 'ecommerce_revenue_evolution' => Piwik::translate('General_ProductRevenue') . $appendix,
);
+
+ $translations = array_merge($translations, $metrics);
}
public function getClientSideTranslationKeys(&$translations)
@@ -58,41 +70,6 @@ class MultiSites extends \Piwik\Plugin
$translations[] = 'MultiSites_Pagination';
}
- public function getReportMetadata(&$reports)
- {
- $metadataMetrics = array();
- foreach (API::getApiMetrics($enhanced = true) as $metricName => $metricSettings) {
- $metadataMetrics[$metricName] =
- Piwik::translate($metricSettings[API::METRIC_TRANSLATION_KEY]);
- $metadataMetrics[$metricSettings[API::METRIC_EVOLUTION_COL_NAME_KEY]] =
- Piwik::translate($metricSettings[API::METRIC_TRANSLATION_KEY]) . " " . Piwik::translate('MultiSites_Evolution');
- }
-
- $reports[] = array(
- 'category' => Piwik::translate('General_MultiSitesSummary'),
- 'name' => Piwik::translate('General_AllWebsitesDashboard'),
- 'module' => 'MultiSites',
- 'action' => 'getAll',
- 'dimension' => Piwik::translate('General_Website'), // re-using translation
- 'metrics' => $metadataMetrics,
- 'processedMetrics' => false,
- 'constantRowsCount' => false,
- 'order' => 4
- );
-
- $reports[] = array(
- 'category' => Piwik::translate('General_MultiSitesSummary'),
- 'name' => Piwik::translate('General_SingleWebsitesDashboard'),
- 'module' => 'MultiSites',
- 'action' => 'getOne',
- 'dimension' => Piwik::translate('General_Website'), // re-using translation
- 'metrics' => $metadataMetrics,
- 'processedMetrics' => false,
- 'constantRowsCount' => false,
- 'order' => 5
- );
- }
-
public function getJsFiles(&$jsFiles)
{
$jsFiles[] = "plugins/MultiSites/angularjs/dashboard/dashboard-model.js";
diff --git a/plugins/MultiSites/Reports/Base.php b/plugins/MultiSites/Reports/Base.php
new file mode 100644
index 0000000000..38a2a0d82a
--- /dev/null
+++ b/plugins/MultiSites/Reports/Base.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\MultiSites\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugins\MultiSites\API;
+
+abstract class Base extends \Piwik\Plugin\Report
+{
+ protected function init()
+ {
+ $this->category = 'General_MultiSitesSummary';
+
+ $metadataMetrics = array();
+ foreach (API::getApiMetrics($enhanced = true) as $metricName => $metricSettings) {
+ $metadataMetrics[$metricName] =
+ Piwik::translate($metricSettings[API::METRIC_TRANSLATION_KEY]);
+ $metadataMetrics[$metricSettings[API::METRIC_EVOLUTION_COL_NAME_KEY]] =
+ Piwik::translate($metricSettings[API::METRIC_TRANSLATION_KEY]) . " " . Piwik::translate('MultiSites_Evolution');
+ }
+
+ $this->metrics = array_keys($metadataMetrics);
+ }
+
+}
diff --git a/plugins/MultiSites/Reports/GetAll.php b/plugins/MultiSites/Reports/GetAll.php
new file mode 100644
index 0000000000..cf10b0f159
--- /dev/null
+++ b/plugins/MultiSites/Reports/GetAll.php
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\MultiSites\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugins\MultiSites\Columns\Website;
+
+class GetAll extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new Website();
+ $this->name = Piwik::translate('General_AllWebsitesDashboard');
+ $this->documentation = ''; // TODO
+ $this->processedMetrics = false;
+ $this->constantRowsCount = false;
+ $this->order = 4;
+ }
+}
diff --git a/plugins/MultiSites/Reports/GetOne.php b/plugins/MultiSites/Reports/GetOne.php
new file mode 100644
index 0000000000..715e3007c9
--- /dev/null
+++ b/plugins/MultiSites/Reports/GetOne.php
@@ -0,0 +1,27 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\MultiSites\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugins\MultiSites\Columns\Website;
+
+class GetOne extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new Website();
+ $this->name = Piwik::translate('General_SingleWebsitesDashboard');
+ $this->documentation = ''; // TODO
+ $this->constantRowsCount = false;
+ $this->processedMetrics = false;
+ $this->order = 5;
+ }
+
+}
diff --git a/plugins/Provider/Columns/Provider.php b/plugins/Provider/Columns/Provider.php
new file mode 100644
index 0000000000..93792b1d46
--- /dev/null
+++ b/plugins/Provider/Columns/Provider.php
@@ -0,0 +1,94 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Provider\Columns;
+
+use Piwik\Common;
+use Piwik\IP;
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+use Piwik\Plugin\Segment;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+use Piwik\Plugins\PrivacyManager\Config as PrivacyManagerConfig;
+use Piwik\Plugins\Provider\Provider as ProviderPlugin;
+
+class Provider extends VisitDimension
+{
+ protected $fieldName = 'location_provider';
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setSegment('provider');
+ $segment->setCategory('Visit Location');
+ $segment->setName('Provider_ColumnProvider');
+ $segment->setAcceptedValues('comcast.net, proxad.net, etc.');
+ $this->addSegment($segment);
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ // if provider info has already been set, abort
+ $locationValue = $visitor->getVisitorColumn('location_provider');
+ if (!empty($locationValue)) {
+ return false;
+ }
+
+ $ip = $visitor->getVisitorColumn('location_ip');
+
+ $privacyConfig = new PrivacyManagerConfig();
+ if (!$privacyConfig->useAnonymizedIpForVisitEnrichment) {
+ $ip = $request->getIp();
+ }
+
+ $ip = IP::N2P($ip);
+
+ // In case the IP was anonymized, we should not continue since the DNS reverse lookup will fail and this will slow down tracking
+ if (substr($ip, -2, 2) == '.0') {
+ Common::printDebug("IP Was anonymized so we skip the Provider DNS reverse lookup...");
+ return false;
+ }
+
+ $hostname = $this->getHost($ip);
+ $hostnameExtension = ProviderPlugin::getCleanHostname($hostname);
+
+ // add the provider value in the table log_visit
+ $locationProvider = substr($hostnameExtension, 0, 100);
+
+ return $locationProvider;
+ }
+
+ public function getRequiredVisitFields()
+ {
+ return array('location_ip');
+ }
+
+ /**
+ * Returns the hostname given the IP address string
+ *
+ * @param string $ip IP Address
+ * @return string hostname (or human-readable IP address)
+ */
+ private function getHost($ip)
+ {
+ return trim(strtolower(@IP::getHostByAddr($ip)));
+ }
+
+ public function getName()
+ {
+ return Piwik::translate('Provider_ColumnProvider');
+ }
+} \ No newline at end of file
diff --git a/plugins/Provider/Provider.php b/plugins/Provider/Provider.php
index 710e2a4930..d98d0571b0 100644
--- a/plugins/Provider/Provider.php
+++ b/plugins/Provider/Provider.php
@@ -13,55 +13,10 @@ use Piwik\ArchiveProcessor;
use Piwik\Common;
use Piwik\Db;
use Piwik\FrontController;
-use Piwik\IP;
use Piwik\Piwik;
-use Piwik\Plugin\ViewDataTable;
-use Piwik\Plugins\PrivacyManager\Config as PrivacyManagerConfig;
-/**
- *
- */
class Provider extends \Piwik\Plugin
{
- /**
- * @see Piwik\Plugin::getListHooksRegistered
- */
- public function getListHooksRegistered()
- {
- $hooks = array(
- 'Tracker.newVisitorInformation' => 'enrichVisitWithProviderInfo',
- 'API.getReportMetadata' => 'getReportMetadata',
- 'API.getSegmentDimensionMetadata' => 'getSegmentsMetadata',
- 'ViewDataTable.configure' => 'configureViewDataTable',
- );
- return $hooks;
- }
-
- public function getReportMetadata(&$reports)
- {
- $reports[] = array(
- 'category' => Piwik::translate('General_Visitors'),
- 'name' => Piwik::translate('Provider_ColumnProvider'),
- 'module' => 'Provider',
- 'action' => 'getProvider',
- 'dimension' => Piwik::translate('Provider_ColumnProvider'),
- 'documentation' => Piwik::translate('Provider_ProviderReportDocumentation', '<br />'),
- 'order' => 50
- );
- }
-
- public function getSegmentsMetadata(&$segments)
- {
- $segments[] = array(
- 'type' => 'dimension',
- 'category' => 'Visit Location',
- 'name' => Piwik::translate('Provider_ColumnProvider'),
- 'segment' => 'provider',
- 'acceptedValues' => 'comcast.net, proxad.net, etc.',
- 'sqlSegment' => 'log_visit.location_provider'
- );
- }
-
public function install()
{
// add column hostname / hostname ext in the visit table
@@ -89,40 +44,12 @@ class Provider extends \Piwik\Plugin
Piwik::addAction('Template.footerUserCountry', array('Piwik\Plugins\Provider\Provider', 'footerUserCountry'));
}
- /**
- * Logs the provider in the log_visit table
- */
- public function enrichVisitWithProviderInfo(&$visitorInfo, \Piwik\Tracker\Request $request)
+ static public function footerUserCountry(&$out)
{
- // if provider info has already been set, abort
- if (!empty($visitorInfo['location_provider'])) {
- return;
- }
-
- $privacyConfig = new PrivacyManagerConfig();
- $ip = IP::N2P($privacyConfig->useAnonymizedIpForVisitEnrichment ? $visitorInfo['location_ip'] : $request->getIp());
-
- // In case the IP was anonymized, we should not continue since the DNS reverse lookup will fail and this will slow down tracking
- if (substr($ip, -2, 2) == '.0') {
- Common::printDebug("IP Was anonymized so we skip the Provider DNS reverse lookup...");
- return;
- }
-
- $hostname = $this->getHost($ip);
- $hostnameExtension = $this->getCleanHostname($hostname);
-
- // add the provider value in the table log_visit
- $visitorInfo['location_provider'] = $hostnameExtension;
- $visitorInfo['location_provider'] = substr($visitorInfo['location_provider'], 0, 100);
-
- // improve the country using the provider extension if valid
- $hostnameDomain = substr($hostnameExtension, 1 + strrpos($hostnameExtension, '.'));
- if ($hostnameDomain == 'uk') {
- $hostnameDomain = 'gb';
- }
- if (array_key_exists($hostnameDomain, Common::getCountriesList())) {
- $visitorInfo['location_country'] = $hostnameDomain;
- }
+ $out = '<div>
+ <h2>' . Piwik::translate('Provider_WidgetProviders') . '</h2>';
+ $out .= FrontController::getInstance()->fetchDispatch('Provider', 'getProvider');
+ $out .= '</div>';
}
/**
@@ -133,7 +60,7 @@ class Provider extends \Piwik\Plugin
*
* @return string
*/
- private function getCleanHostname($hostname)
+ public static function getCleanHostname($hostname)
{
$extToExclude = array(
'com', 'net', 'org', 'co'
@@ -149,19 +76,19 @@ class Provider extends \Piwik\Plugin
/**
* Triggered when prettifying a hostname string.
- *
- * This event can be used to customize the way a hostname is displayed in the
+ *
+ * This event can be used to customize the way a hostname is displayed in the
* Providers report.
*
* **Example**
- *
+ *
* public function getCleanHostname(&$cleanHostname, $hostname)
* {
* if ('fvae.VARG.ceaga.site.co.jp' == $hostname) {
* $cleanHostname = 'site.co.jp';
* }
* }
- *
+ *
* @param string &$cleanHostname The hostname string to display. Set by the event
* handler.
* @param string $hostname The full hostname.
@@ -183,37 +110,4 @@ class Provider extends \Piwik\Plugin
}
}
- /**
- * Returns the hostname given the IP address string
- *
- * @param string $ip IP Address
- * @return string hostname (or human-readable IP address)
- */
- private function getHost($ip)
- {
- return trim(strtolower(@IP::getHostByAddr($ip)));
- }
-
- static public function footerUserCountry(&$out)
- {
- $out = '<div>
- <h2>' . Piwik::translate('Provider_WidgetProviders') . '</h2>';
- $out .= FrontController::getInstance()->fetchDispatch('Provider', 'getProvider');
- $out .= '</div>';
- }
-
- public function configureViewDataTable(ViewDataTable $view)
- {
- switch ($view->requestConfig->apiMethodToRequestDataTable) {
- case 'Provider.getProvider':
- $this->configureViewForGetProvider($view);
- break;
- }
- }
-
- private function configureViewForGetProvider(ViewDataTable $view)
- {
- $view->requestConfig->filter_limit = 5;
- $view->config->addTranslation('label', Piwik::translate('Provider_ColumnProvider'));
- }
}
diff --git a/plugins/Provider/Reports/GetProvider.php b/plugins/Provider/Reports/GetProvider.php
new file mode 100644
index 0000000000..7317663b60
--- /dev/null
+++ b/plugins/Provider/Reports/GetProvider.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Provider\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\Provider\Columns\Provider;
+
+class GetProvider extends \Piwik\Plugin\Report
+{
+ protected function init()
+ {
+ $this->category = 'General_Visitors';
+ $this->dimension = new Provider();
+ $this->name = Piwik::translate('Provider_ColumnProvider');
+ $this->documentation = Piwik::translate('Provider_ProviderReportDocumentation', '<br />');
+ $this->order = 50;
+ $this->widgetTitle = 'Provider_WidgetProviders';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->requestConfig->filter_limit = 5;
+ $view->config->addTranslation('label', $this->dimension->getName());
+ }
+
+}
diff --git a/plugins/Provider/Widgets.php b/plugins/Provider/Widgets.php
deleted file mode 100644
index 911ab10411..0000000000
--- a/plugins/Provider/Widgets.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- *
- */
-namespace Piwik\Plugins\Provider;
-
-use Piwik\WidgetsList;
-
-class Widgets extends \Piwik\Plugin\Widgets
-{
- public function configure(WidgetsList $widgetsList)
- {
- $widgetsList->add('General_Visitors', 'Provider_WidgetProviders', 'Provider', 'getProvider');
- }
-
-}
diff --git a/core/Tracker/Referrer.php b/plugins/Referrers/Columns/Base.php
index 3df2cf46a3..c50f72c1a2 100644
--- a/core/Tracker/Referrer.php
+++ b/plugins/Referrers/Columns/Base.php
@@ -6,16 +6,22 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
-namespace Piwik\Tracker;
+namespace Piwik\Plugins\Referrers\Columns;
use Piwik\Common;
use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+use Piwik\Tracker\PageUrl;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visit;
+use Piwik\Tracker\Visitor;
+use Piwik\Tracker\Action;
use Piwik\UrlHelper;
-/**
- */
-class Referrer
+
+abstract class Base extends VisitDimension
{
+
// @see detect*() referrer methods
protected $typeReferrerAnalyzed;
protected $nameReferrerAnalyzed;
@@ -122,15 +128,15 @@ class Referrer
/**
* Triggered when detecting the search engine of a referrer URL.
- *
+ *
* Plugins can use this event to provide custom search engine detection
* logic.
- *
+ *
* @param array &$searchEngineInformation An array with the following information:
- *
+ *
* - **name**: The search engine name.
* - **keywords**: The search keywords used.
- *
+ *
* This parameter is initialized to the results
* of Piwik's default search engine detection
* logic.
@@ -298,4 +304,92 @@ class Referrer
return true;
}
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function getValueForRecordGoal(Request $request, Visitor $visitor)
+ {
+ $referrerTimestamp = $request->getParam('_refts');
+ $referrerUrl = $request->getParam('_ref');
+ $referrerCampaignName = trim(urldecode($request->getParam('_rcn')));
+ $referrerCampaignKeyword = trim(urldecode($request->getParam('_rck')));
+
+ // Attributing the correct Referrer to this conversion.
+ // Priority order is as follows:
+ // 0) In some cases, the campaign is not passed from the JS so we look it up from the current visit
+ // 1) Campaign name/kwd parsed in the JS
+ // 2) Referrer URL stored in the _ref cookie
+ // 3) If no info from the cookie, attribute to the current visit referrer
+
+ // 3) Default values: current referrer
+ $type = $visitor->getVisitorColumn('referer_type');
+ $name = $visitor->getVisitorColumn('referer_name');
+ $keyword = $visitor->getVisitorColumn('referer_keyword');
+ $time = $visitor->getVisitorColumn('visit_first_action_time');
+
+ // 0) In some (unknown!?) cases the campaign is not found in the attribution cookie, but the URL ref was found.
+ // In this case we look up if the current visit is credited to a campaign and will credit this campaign rather than the URL ref (since campaigns have higher priority)
+ if (empty($referrerCampaignName)
+ && $type == Common::REFERRER_TYPE_CAMPAIGN
+ && !empty($name)
+ ) {
+ // Use default values per above
+ } // 1) Campaigns from 1st party cookie
+ elseif (!empty($referrerCampaignName)) {
+ $type = Common::REFERRER_TYPE_CAMPAIGN;
+ $name = $referrerCampaignName;
+ $keyword = $referrerCampaignKeyword;
+ $time = $referrerTimestamp;
+ } // 2) Referrer URL parsing
+ elseif (!empty($referrerUrl)) {
+
+ $idSite = $request->getIdSite();
+ $referrer = $this->getReferrerInformation($referrerUrl, $currentUrl = '', $idSite);
+
+ // if the parsed referrer is interesting enough, ie. website or search engine
+ if (in_array($referrer['referer_type'], array(Common::REFERRER_TYPE_SEARCH_ENGINE, Common::REFERRER_TYPE_WEBSITE))) {
+ $type = $referrer['referer_type'];
+ $name = $referrer['referer_name'];
+ $keyword = $referrer['referer_keyword'];
+ $time = $referrerTimestamp;
+ }
+ }
+
+ $this->setCampaignValuesToLowercase($type, $name, $keyword);
+
+ $fields = array(
+ 'referer_type' => $type,
+ 'referer_name' => $name,
+ 'referer_keyword' => $keyword,
+ // this field is currently unused
+ 'referer_visit_server_date' => date("Y-m-d", $time),
+ );
+
+ if (array_key_exists($this->fieldName, $fields)) {
+ return $fields[$this->fieldName];
+ }
+
+ return false;
+ }
+
+ /**
+ * @param $type
+ * @param $name
+ * @param $keyword
+ */
+ protected function setCampaignValuesToLowercase($type, &$name, &$keyword)
+ {
+ if ($type === Common::REFERRER_TYPE_CAMPAIGN) {
+ if (!empty($name)) {
+ $name = Common::mb_strtolower($name);
+ }
+ if (!empty($keyword)) {
+ $keyword = Common::mb_strtolower($keyword);
+ }
+ }
+ }
+
}
diff --git a/plugins/Referrers/Columns/Campaign.php b/plugins/Referrers/Columns/Campaign.php
new file mode 100644
index 0000000000..1ed4f00333
--- /dev/null
+++ b/plugins/Referrers/Columns/Campaign.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Referrers\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+
+class Campaign extends VisitDimension
+{
+ public function getName()
+ {
+ return Piwik::translate('Referrers_ColumnCampaign');
+ }
+}
diff --git a/plugins/Referrers/Columns/Keyword.php b/plugins/Referrers/Columns/Keyword.php
new file mode 100644
index 0000000000..573aa8b44d
--- /dev/null
+++ b/plugins/Referrers/Columns/Keyword.php
@@ -0,0 +1,66 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Referrers\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugins\Referrers\Segment;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+use Piwik\Tracker\Action;
+
+class Keyword extends Base
+{
+ protected $fieldName = 'referer_keyword';
+ protected $fieldType = 'VARCHAR(255) NULL';
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setSegment('referrerKeyword');
+ $segment->setName('General_ColumnKeyword');
+ $segment->setAcceptedValues('Encoded%20Keyword, keyword');
+ $this->addSegment($segment);
+ }
+
+ public function getName()
+ {
+ return Piwik::translate('General_ColumnKeyword');
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ $referrerUrl = $request->getParam('urlref');
+ $currentUrl = $request->getParam('url');
+
+ $information = $this->getReferrerInformation($referrerUrl, $currentUrl, $request->getIdSite());
+
+ if (!empty($information['referer_keyword'])) {
+ return substr($information['referer_keyword'], 0, 255);
+ }
+
+ return $information['referer_keyword'];
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onRecordGoal(Request $request, Visitor $visitor, $action)
+ {
+ return $this->getValueForRecordGoal($request, $visitor);
+ }
+}
diff --git a/plugins/Referrers/Columns/Referrer.php b/plugins/Referrers/Columns/Referrer.php
new file mode 100644
index 0000000000..67991e8aef
--- /dev/null
+++ b/plugins/Referrers/Columns/Referrer.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Referrers\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+
+class Referrer extends VisitDimension
+{
+ public function getName()
+ {
+ return Piwik::translate('Referrers_Referrer');
+ }
+} \ No newline at end of file
diff --git a/plugins/Referrers/Columns/ReferrerName.php b/plugins/Referrers/Columns/ReferrerName.php
new file mode 100644
index 0000000000..854fb9a682
--- /dev/null
+++ b/plugins/Referrers/Columns/ReferrerName.php
@@ -0,0 +1,66 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Referrers\Columns;
+
+use Piwik\Plugins\Referrers\Segment;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+use Piwik\Tracker\Action;
+
+class ReferrerName extends Base
+{
+ protected $fieldName = 'referer_name';
+ protected $fieldType = 'VARCHAR(70) NULL';
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setSegment('referrerName');
+ $segment->setName('Referrers_ReferrerName');
+ $segment->setAcceptedValues('twitter.com, www.facebook.com, Bing, Google, Yahoo, CampaignName');
+ $this->addSegment($segment);
+ }
+
+ public function getName()
+ {
+ return '';
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ $referrerUrl = $request->getParam('urlref');
+ $currentUrl = $request->getParam('url');
+
+ $information = $this->getReferrerInformation($referrerUrl, $currentUrl, $request->getIdSite());
+
+ if (!empty($information['referer_name'])) {
+
+ return substr($information['referer_name'], 0, 70);
+ }
+
+ return $information['referer_name'];
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onRecordGoal(Request $request, Visitor $visitor, $action)
+ {
+ return $this->getValueForRecordGoal($request, $visitor);
+ }
+}
diff --git a/plugins/Referrers/Columns/ReferrerType.php b/plugins/Referrers/Columns/ReferrerType.php
new file mode 100644
index 0000000000..03976c101e
--- /dev/null
+++ b/plugins/Referrers/Columns/ReferrerType.php
@@ -0,0 +1,63 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Referrers\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugins\Referrers\Segment;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+use Piwik\Tracker\Action;
+
+class ReferrerType extends Base
+{
+ protected $fieldName = 'referer_type';
+ protected $fieldType = 'TINYINT(1) UNSIGNED NULL';
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setSegment('referrerType');
+ $segment->setName('Referrers_Type');
+ $segment->setSqlFilterValue('Piwik\Plugins\Referrers\getReferrerTypeFromShortName');
+ $segment->setAcceptedValues('direct, search, website, campaign');
+ $this->addSegment($segment);
+ }
+
+ public function getName()
+ {
+ return Piwik::translate('Referrers_Type');
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ $referrerUrl = $request->getParam('urlref');
+ $currentUrl = $request->getParam('url');
+
+ $information = $this->getReferrerInformation($referrerUrl, $currentUrl, $request->getIdSite());
+
+ return $information['referer_type'];
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onRecordGoal(Request $request, Visitor $visitor, $action)
+ {
+ return $this->getValueForRecordGoal($request, $visitor);
+ }
+}
diff --git a/plugins/Referrers/Columns/ReferrerUrl.php b/plugins/Referrers/Columns/ReferrerUrl.php
new file mode 100644
index 0000000000..b2e50ecfe3
--- /dev/null
+++ b/plugins/Referrers/Columns/ReferrerUrl.php
@@ -0,0 +1,50 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Referrers\Columns;
+
+use Piwik\Plugins\Referrers\Segment;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+use Piwik\Tracker\Action;
+
+class ReferrerUrl extends Base
+{
+ protected $fieldName = 'referer_url';
+ protected $fieldType = 'TEXT NOT NULL';
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setSegment('referrerUrl');
+ $segment->setName('Live_Referrer_URL');
+ $segment->setAcceptedValues('http%3A%2F%2Fwww.example.org%2Freferer-page.htm');
+ $this->addSegment($segment);
+ }
+
+ public function getName()
+ {
+ return '';
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ $referrerUrl = $request->getParam('urlref');
+ $currentUrl = $request->getParam('url');
+
+ $information = $this->getReferrerInformation($referrerUrl, $currentUrl, $request->getIdSite());
+
+ return $information['referer_url'];
+ }
+}
diff --git a/plugins/Referrers/Columns/ReferrerVisitServerDate.php b/plugins/Referrers/Columns/ReferrerVisitServerDate.php
new file mode 100644
index 0000000000..5eb4e758e9
--- /dev/null
+++ b/plugins/Referrers/Columns/ReferrerVisitServerDate.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Referrers\Columns;
+
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+use Piwik\Tracker\Action;
+
+class ReferrerVisitServerDate extends Base
+{
+ protected $fieldName = 'referer_visit_server_date';
+ protected $fieldType = 'date default NULL';
+
+ public function getName()
+ {
+ return '';
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onRecordGoal(Request $request, Visitor $visitor, $action)
+ {
+ return $this->getValueForRecordGoal($request, $visitor);
+ }
+}
diff --git a/plugins/Referrers/Columns/SearchEngine.php b/plugins/Referrers/Columns/SearchEngine.php
new file mode 100644
index 0000000000..942e3db539
--- /dev/null
+++ b/plugins/Referrers/Columns/SearchEngine.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Referrers\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+
+class SearchEngine extends VisitDimension
+{
+ public function getName()
+ {
+ return Piwik::translate('Referrers_ColumnSearchEngine');
+ }
+} \ No newline at end of file
diff --git a/plugins/Referrers/Columns/Socialnetwork.php b/plugins/Referrers/Columns/Socialnetwork.php
new file mode 100644
index 0000000000..e5c0f22b3d
--- /dev/null
+++ b/plugins/Referrers/Columns/Socialnetwork.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Referrers\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+
+class SocialNetwork extends VisitDimension
+{
+ public function getName()
+ {
+ return Piwik::translate('Referrers_ColumnSocial');
+ }
+} \ No newline at end of file
diff --git a/plugins/Referrers/Columns/Website.php b/plugins/Referrers/Columns/Website.php
new file mode 100644
index 0000000000..ae60a91729
--- /dev/null
+++ b/plugins/Referrers/Columns/Website.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Referrers\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+
+class Website extends VisitDimension
+{
+ public function getName()
+ {
+ return Piwik::translate('General_Website');
+ }
+} \ No newline at end of file
diff --git a/plugins/Referrers/Columns/WebsitePage.php b/plugins/Referrers/Columns/WebsitePage.php
new file mode 100644
index 0000000000..4f651dc1c4
--- /dev/null
+++ b/plugins/Referrers/Columns/WebsitePage.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Referrers\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+
+class WebsitePage extends VisitDimension
+{
+ public function getName()
+ {
+ return Piwik::translate('Referrers_ColumnWebsitePage');
+ }
+} \ No newline at end of file
diff --git a/plugins/Referrers/Referrers.php b/plugins/Referrers/Referrers.php
index e2fb25f2c5..3097cfceb2 100644
--- a/plugins/Referrers/Referrers.php
+++ b/plugins/Referrers/Referrers.php
@@ -1,6 +1,6 @@
<?php
/**
- * Piwik - free/libre analytics platform
+ * Piwik - Open source web analytics
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
@@ -11,11 +11,7 @@ namespace Piwik\Plugins\Referrers;
use Piwik\ArchiveProcessor;
use Piwik\Common;
use Piwik\Piwik;
-use Piwik\Plugin\ViewDataTable;
use Piwik\Plugins\CoreVisualizations\Visualizations\HtmlTable;
-use Piwik\Plugins\CoreVisualizations\Visualizations\HtmlTable\AllColumns;
-use Piwik\Plugins\CoreVisualizations\Visualizations\JqplotGraph\Pie;
-use Piwik\SettingsPiwik;
/**
* @see plugins/Referrers/functions.php
@@ -31,15 +27,9 @@ class Referrers extends \Piwik\Plugin
*/
public function getListHooksRegistered()
{
- $hooks = array(
- 'Goals.getReportsWithGoalMetrics' => 'getReportsWithGoalMetrics',
- 'API.getReportMetadata' => 'getReportMetadata',
- 'API.getSegmentDimensionMetadata' => 'getSegmentsMetadata',
- 'ViewDataTable.configure' => 'configureViewDataTable',
- 'ViewDataTable.getDefaultType' => 'getDefaultTypeViewDataTable',
+ return array(
'Insights.addReportToOverview' => 'addReportToInsightsOverview'
);
- return $hooks;
}
public function addReportToInsightsOverview(&$reports)
@@ -50,423 +40,6 @@ class Referrers extends \Piwik\Plugin
$reports['Referrers_getSearchEngines'] = array();
}
- public function getReportMetadata(&$reports)
- {
- $reports = array_merge($reports, array(
- array(
- 'category' => Piwik::translate('Referrers_Referrers'),
- 'name' => Piwik::translate('Referrers_Type'),
- 'module' => 'Referrers',
- 'action' => 'getReferrerType',
- 'dimension' => Piwik::translate('Referrers_Type'),
- 'constantRowsCount' => true,
- 'documentation' => Piwik::translate('Referrers_TypeReportDocumentation') . '<br />'
- . '<b>' . Piwik::translate('Referrers_DirectEntry') . ':</b> ' . Piwik::translate('Referrers_DirectEntryDocumentation') . '<br />'
- . '<b>' . Piwik::translate('Referrers_SearchEngines') . ':</b> ' . Piwik::translate('Referrers_SearchEnginesDocumentation',
- array('<br />', '&quot;' . Piwik::translate('Referrers_SubmenuSearchEngines') . '&quot;')) . '<br />'
- . '<b>' . Piwik::translate('Referrers_Websites') . ':</b> ' . Piwik::translate('Referrers_WebsitesDocumentation',
- array('<br />', '&quot;' . Piwik::translate('Referrers_SubmenuWebsites') . '&quot;')) . '<br />'
- . '<b>' . Piwik::translate('Referrers_Campaigns') . ':</b> ' . Piwik::translate('Referrers_CampaignsDocumentation',
- array('<br />', '&quot;' . Piwik::translate('Referrers_Campaigns') . '&quot;')),
- 'order' => 1,
- ),
- array(
- 'category' => Piwik::translate('Referrers_Referrers'),
- 'name' => Piwik::translate('Referrers_WidgetGetAll'),
- 'module' => 'Referrers',
- 'action' => 'getAll',
- 'dimension' => Piwik::translate('Referrers_Referrer'),
- 'documentation' => Piwik::translate('Referrers_AllReferrersReportDocumentation', '<br />'),
- 'order' => 2,
- ),
- array(
- 'category' => Piwik::translate('Referrers_Referrers'),
- 'name' => Piwik::translate('Referrers_Keywords'),
- 'module' => 'Referrers',
- 'action' => 'getKeywords',
- 'actionToLoadSubTables' => 'getSearchEnginesFromKeywordId',
- 'dimension' => Piwik::translate('General_ColumnKeyword'),
- 'documentation' => Piwik::translate('Referrers_KeywordsReportDocumentation', '<br />'),
- 'order' => 3,
- ),
- array( // subtable report
- 'category' => Piwik::translate('Referrers_Referrers'),
- 'name' => Piwik::translate('Referrers_Keywords'),
- 'module' => 'Referrers',
- 'action' => 'getSearchEnginesFromKeywordId',
- 'dimension' => Piwik::translate('Referrers_ColumnSearchEngine'),
- 'documentation' => Piwik::translate('Referrers_KeywordsReportDocumentation', '<br />'),
- 'isSubtableReport' => true,
- 'order' => 4
- ),
-
- array(
- 'category' => Piwik::translate('Referrers_Referrers'),
- 'name' => Piwik::translate('Referrers_Websites'),
- 'module' => 'Referrers',
- 'action' => 'getWebsites',
- 'dimension' => Piwik::translate('Referrers_ColumnWebsite'),
- 'documentation' => Piwik::translate('Referrers_WebsitesReportDocumentation', '<br />'),
- 'actionToLoadSubTables' => 'getUrlsFromWebsiteId',
- 'order' => 5
- ),
- array( // subtable report
- 'category' => Piwik::translate('Referrers_Referrers'),
- 'name' => Piwik::translate('Referrers_Websites'),
- 'module' => 'Referrers',
- 'action' => 'getUrlsFromWebsiteId',
- 'dimension' => Piwik::translate('Referrers_ColumnWebsitePage'),
- 'documentation' => Piwik::translate('Referrers_WebsitesReportDocumentation', '<br />'),
- 'isSubtableReport' => true,
- 'order' => 6,
- ),
-
- array(
- 'category' => Piwik::translate('Referrers_Referrers'),
- 'name' => Piwik::translate('Referrers_SearchEngines'),
- 'module' => 'Referrers',
- 'action' => 'getSearchEngines',
- 'dimension' => Piwik::translate('Referrers_ColumnSearchEngine'),
- 'documentation' => Piwik::translate('Referrers_SearchEnginesReportDocumentation', '<br />'),
- 'actionToLoadSubTables' => 'getKeywordsFromSearchEngineId',
- 'order' => 7,
- ),
- array( // subtable report
- 'category' => Piwik::translate('Referrers_Referrers'),
- 'name' => Piwik::translate('Referrers_SearchEngines'),
- 'module' => 'Referrers',
- 'action' => 'getKeywordsFromSearchEngineId',
- 'dimension' => Piwik::translate('General_ColumnKeyword'),
- 'documentation' => Piwik::translate('Referrers_SearchEnginesReportDocumentation', '<br />'),
- 'isSubtableReport' => true,
- 'order' => 8,
- ),
-
- array(
- 'category' => Piwik::translate('Referrers_Referrers'),
- 'name' => Piwik::translate('Referrers_Campaigns'),
- 'module' => 'Referrers',
- 'action' => 'getCampaigns',
- 'dimension' => Piwik::translate('Referrers_ColumnCampaign'),
- 'documentation' => Piwik::translate('Referrers_CampaignsReportDocumentation',
- array('<br />', '<a href="http://piwik.org/docs/tracking-campaigns/" target="_blank">', '</a>')),
- 'actionToLoadSubTables' => 'getKeywordsFromCampaignId',
- 'order' => 9,
- ),
- array( // subtable report
- 'category' => Piwik::translate('Referrers_Referrers'),
- 'name' => Piwik::translate('Referrers_Campaigns'),
- 'module' => 'Referrers',
- 'action' => 'getKeywordsFromCampaignId',
- 'dimension' => Piwik::translate('General_ColumnKeyword'),
- 'documentation' => Piwik::translate('Referrers_CampaignsReportDocumentation',
- array('<br />', '<a href="http://piwik.org/docs/tracking-campaigns/" target="_blank">', '</a>')),
- 'isSubtableReport' => true,
- 'order' => 10,
- ),
- array(
- 'category' => Piwik::translate('Referrers_Referrers'),
- 'name' => Piwik::translate('Referrers_Socials'),
- 'module' => 'Referrers',
- 'action' => 'getSocials',
- 'actionToLoadSubTables' => 'getUrlsForSocial',
- 'dimension' => Piwik::translate('Referrers_ColumnSocial'),
- 'documentation' => Piwik::translate('Referrers_WebsitesReportDocumentation', '<br />'),
- 'order' => 11,
- ),
- array(
- 'category' => Piwik::translate('Referrers_Referrers'),
- 'name' => Piwik::translate('Referrers_Socials'),
- 'module' => 'Referrers',
- 'action' => 'getUrlsForSocial',
- 'isSubtableReport' => true,
- 'dimension' => Piwik::translate('Referrers_ColumnWebsitePage'),
- 'documentation' => Piwik::translate('Referrers_WebsitesReportDocumentation', '<br />'),
- 'order' => 12,
- ),
- ));
- }
-
- public function getSegmentsMetadata(&$segments)
- {
- $segments[] = array(
- 'type' => 'dimension',
- 'category' => 'Referrers_Referrers',
- 'name' => 'Referrers_Type',
- 'segment' => 'referrerType',
- 'acceptedValues' => 'direct, search, website, campaign',
- 'sqlSegment' => 'log_visit.referer_type',
- 'sqlFilterValue' => __NAMESPACE__ . '\getReferrerTypeFromShortName',
- );
- $segments[] = array(
- 'type' => 'dimension',
- 'category' => 'Referrers_Referrers',
- 'name' => 'General_ColumnKeyword',
- 'segment' => 'referrerKeyword',
- 'acceptedValues' => 'Encoded%20Keyword, keyword',
- 'sqlSegment' => 'log_visit.referer_keyword',
- );
- $segments[] = array(
- 'type' => 'dimension',
- 'category' => 'Referrers_Referrers',
- 'name' => 'Referrers_ReferrerName',
- 'segment' => 'referrerName',
- 'acceptedValues' => 'twitter.com, www.facebook.com, Bing, Google, Yahoo, CampaignName',
- 'sqlSegment' => 'log_visit.referer_name',
- );
- $segments[] = array(
- 'type' => 'dimension',
- 'category' => 'Referrers_Referrers',
- 'name' => 'Live_Referrer_URL',
- 'acceptedValues' => 'http%3A%2F%2Fwww.example.org%2Freferer-page.htm',
- 'segment' => 'referrerUrl',
- 'sqlSegment' => 'log_visit.referer_url',
- );
- }
-
- /**
- * Adds Goal dimensions, so that the dimensions are displayed in the UI Goal Overview page
- */
- public function getReportsWithGoalMetrics(&$dimensions)
- {
- $dimensions = array_merge($dimensions, array(
- array('category' => Piwik::translate('Referrers_Referrers'),
- 'name' => Piwik::translate('Referrers_Type'),
- 'module' => 'Referrers',
- 'action' => 'getReferrerType',
- ),
- array('category' => Piwik::translate('Referrers_Referrers'),
- 'name' => Piwik::translate('Referrers_Keywords'),
- 'module' => 'Referrers',
- 'action' => 'getKeywords',
- ),
- array('category' => Piwik::translate('Referrers_Referrers'),
- 'name' => Piwik::translate('Referrers_SearchEngines'),
- 'module' => 'Referrers',
- 'action' => 'getSearchEngines',
- ),
- array('category' => Piwik::translate('Referrers_Referrers'),
- 'name' => Piwik::translate('Referrers_Websites'),
- 'module' => 'Referrers',
- 'action' => 'getWebsites',
- ),
- array('category' => Piwik::translate('Referrers_Referrers'),
- 'name' => Piwik::translate('Referrers_Campaigns'),
- 'module' => 'Referrers',
- 'action' => 'getCampaigns',
- ),
- ));
- }
-
- public function getDefaultTypeViewDataTable(&$defaultViewTypes)
- {
- $defaultViewTypes['Referrers.getReferrerType'] = AllColumns::ID;
- $defaultViewTypes['Referrers.getSocials'] = Pie::ID;
- }
-
- public function configureViewDataTable(ViewDataTable $view)
- {
- switch ($view->requestConfig->apiMethodToRequestDataTable) {
- case 'Referrers.getReferrerType':
- $this->configureViewForGetReferrerType($view);
- break;
- case 'Referrers.getAll':
- $this->configureViewForGetAll($view);
- break;
- case 'Referrers.getKeywords':
- $this->configureViewForGetKeywords($view);
- break;
- case 'Referrers.getSearchEnginesFromKeywordId':
- $this->configureViewForGetSearchEnginesFromKeywordId($view);
- break;
- case 'Referrers.getSearchEngines':
- $this->configureViewForGetSearchEngines($view);
- break;
- case 'Referrers.getKeywordsFromSearchEngineId':
- $this->configureViewForGetKeywordsFromSearchEngineId($view);
- break;
- case 'Referrers.getWebsites':
- $this->configureViewForGetWebsites($view);
- break;
- case 'Referrers.getSocials':
- $this->configureViewForGetSocials($view);
- break;
- case 'Referrers.getUrlsForSocial':
- $this->configureViewForGetUrlsForSocial($view);
- break;
- case 'Referrers.getCampaigns':
- $this->configureViewForGetCampaigns($view);
- break;
- case 'Referrers.getKeywordsFromCampaignId':
- $this->configureViewForGetKeywordsFromCampaignId($view);
- break;
- case 'Referrers.getUrlsFromWebsiteId':
- $this->configureViewForGetUrlsFromWebsiteId($view);
- break;
- }
- }
-
- private function configureViewForGetReferrerType(ViewDataTable $view)
- {
- $idSubtable = Common::getRequestVar('idSubtable', false);
- $labelColumnTitle = Piwik::translate('Referrers_Type');
-
- switch ($idSubtable) {
- case Common::REFERRER_TYPE_SEARCH_ENGINE:
- $labelColumnTitle = Piwik::translate('Referrers_ColumnSearchEngine');
- break;
- case Common::REFERRER_TYPE_WEBSITE:
- $labelColumnTitle = Piwik::translate('Referrers_ColumnWebsite');
- break;
- case Common::REFERRER_TYPE_CAMPAIGN:
- $labelColumnTitle = Piwik::translate('Referrers_ColumnCampaign');
- break;
- default:
- break;
- }
-
- $view->config->show_search = false;
- $view->config->show_goals = true;
- $view->config->show_offset_information = false;
- $view->config->show_pagination_control = false;
- $view->config->show_limit_control = false;
- $view->config->show_exclude_low_population = false;
- $view->config->addTranslation('label', $labelColumnTitle);
-
- $view->requestConfig->filter_limit = 10;
-
- if ($view->isViewDataTableId(HtmlTable::ID)) {
- $view->config->disable_subtable_when_show_goals = true;
- }
- }
-
- private function configureViewForGetAll(ViewDataTable $view)
- {
- $setGetAllHtmlPrefix = array($this, 'setGetAllHtmlPrefix');
-
- $view->config->show_exclude_low_population = false;
- $view->config->show_goals = true;
- $view->config->addTranslation('label', Piwik::translate('Referrers_Referrer'));
-
- $view->requestConfig->filter_limit = 20;
-
- if ($view->isViewDataTableId(HtmlTable::ID)) {
- $view->config->disable_row_actions = true;
- }
-
- $view->config->filters[] = array('MetadataCallbackAddMetadata', array('referer_type', 'html_label_prefix', $setGetAllHtmlPrefix));
- }
-
- private function configureViewForGetKeywords(ViewDataTable $view)
- {
- $view->config->subtable_controller_action = 'getSearchEnginesFromKeywordId';
- $view->config->show_exclude_low_population = false;
- $view->config->addTranslation('label', Piwik::translate('General_ColumnKeyword'));
- $view->config->show_goals = true;
-
- $view->requestConfig->filter_limit = 25;
-
- if ($view->isViewDataTableId(HtmlTable::ID)) {
- $view->config->disable_subtable_when_show_goals = true;
- }
- }
-
- private function configureViewForGetSearchEnginesFromKeywordId(ViewDataTable $view)
- {
- $view->config->show_search = false;
- $view->config->show_exclude_low_population = false;
- $view->config->addTranslation('label', Piwik::translate('Referrers_ColumnSearchEngine'));
- }
-
- private function configureViewForGetSearchEngines(ViewDataTable $view)
- {
- $view->config->subtable_controller_action = 'getKeywordsFromSearchEngineId';
- $view->config->show_exclude_low_population = false;
- $view->config->show_search = false;
- $view->config->show_goals = true;
- $view->config->addTranslation('label', Piwik::translate('Referrers_ColumnSearchEngine'));
-
- $view->requestConfig->filter_limit = 25;
-
- if ($view->isViewDataTableId(HtmlTable::ID)) {
- $view->config->disable_subtable_when_show_goals = true;
- }
- }
-
- private function configureViewForGetKeywordsFromSearchEngineId(ViewDataTable $view)
- {
- $view->config->show_search = false;
- $view->config->show_exclude_low_population = false;
- $view->config->addTranslation('label', Piwik::translate('General_ColumnKeyword'));
- }
-
- private function configureViewForGetWebsites(ViewDataTable $view)
- {
- $view->config->subtable_controller_action = 'getUrlsFromWebsiteId';
- $view->config->show_exclude_low_population = false;
- $view->config->show_goals = true;
- $view->config->addTranslation('label', Piwik::translate('Referrers_ColumnWebsite'));
-
- $view->requestConfig->filter_limit = 25;
-
- if ($view->isViewDataTableId(HtmlTable::ID)) {
- $view->config->disable_subtable_when_show_goals = true;
- }
- }
-
- private function configureViewForGetSocials(ViewDataTable $view)
- {
- $view->config->subtable_controller_action = 'getUrlsForSocial';
- $view->config->show_exclude_low_population = false;
- $view->config->show_goals = true;
- $view->config->addTranslation('label', Piwik::translate('Referrers_ColumnSocial'));
-
- $view->requestConfig->filter_limit = 10;
-
- if ($view->isViewDataTableId(HtmlTable::ID)) {
- $view->config->disable_subtable_when_show_goals = true;
- }
-
- $widget = Common::getRequestVar('widget', false);
- if (empty($widget)) {
- $view->config->show_footer_message = Piwik::translate('Referrers_SocialFooterMessage');
- }
- }
-
- private function configureViewForGetUrlsForSocial(ViewDataTable $view)
- {
- $view->config->show_goals = true;
- $view->config->show_exclude_low_population = false;
- $view->config->addTranslation('label', Piwik::translate('Referrers_ColumnWebsitePage'));
-
- $view->requestConfig->filter_limit = 10;
- }
-
- private function configureViewForGetCampaigns(ViewDataTable $view)
- {
- $view->config->show_goals = true;
- $view->config->subtable_controller_action = 'getKeywordsFromCampaignId';
- $view->config->show_exclude_low_population = false;
- $view->config->addTranslation('label', Piwik::translate('Referrers_ColumnCampaign'));
-
- $view->requestConfig->filter_limit = 25;
- }
-
- private function configureViewForGetKeywordsFromCampaignId(ViewDataTable $view)
- {
- $view->config->show_search = false;
- $view->config->show_exclude_low_population = false;
- $view->config->addTranslation('label', Piwik::translate('General_ColumnKeyword'));
- }
-
- private function configureViewForGetUrlsFromWebsiteId(ViewDataTable $view)
- {
- $view->config->show_search = false;
- $view->config->show_exclude_low_population = false;
- $view->config->tooltip_metadata_name = 'url';
- $view->config->addTranslation('label', Piwik::translate('Referrers_ColumnWebsitePage'));
- }
-
/**
* DataTable filter callback that returns the HTML prefix for a label in the
* 'getAll' report based on the row's referrer type.
diff --git a/plugins/Referrers/Reports/Base.php b/plugins/Referrers/Reports/Base.php
new file mode 100644
index 0000000000..dca93f48f6
--- /dev/null
+++ b/plugins/Referrers/Reports/Base.php
@@ -0,0 +1,18 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Referrers\Reports;
+
+abstract class Base extends \Piwik\Plugin\Report
+{
+ protected function init()
+ {
+ $this->category = 'Referrers_Referrers';
+ }
+
+}
diff --git a/plugins/Referrers/Reports/GetAll.php b/plugins/Referrers/Reports/GetAll.php
new file mode 100644
index 0000000000..97b8129af1
--- /dev/null
+++ b/plugins/Referrers/Reports/GetAll.php
@@ -0,0 +1,47 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Referrers\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\CoreVisualizations\Visualizations\HtmlTable;
+use Piwik\Plugins\Referrers\Columns\Referrer;
+use Piwik\Plugins\Referrers\Referrers;
+
+class GetAll extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new Referrer();
+ $this->name = Piwik::translate('Referrers_WidgetGetAll');
+ $this->documentation = Piwik::translate('Referrers_AllReferrersReportDocumentation', '<br />');
+ $this->order = 2;
+ $this->widgetTitle = 'Referrers_WidgetGetAll';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $referrers = new Referrers();
+ $setGetAllHtmlPrefix = array($referrers, 'setGetAllHtmlPrefix');
+
+ $view->config->show_exclude_low_population = false;
+ $view->config->show_goals = true;
+ $view->config->addTranslation('label', $this->dimension->getName());
+
+ $view->requestConfig->filter_limit = 20;
+
+ if ($view->isViewDataTableId(HtmlTable::ID)) {
+ $view->config->disable_row_actions = true;
+ }
+
+ $view->config->filters[] = array('MetadataCallbackAddMetadata', array('referer_type', 'html_label_prefix', $setGetAllHtmlPrefix));
+ }
+
+}
diff --git a/plugins/Referrers/Reports/GetCampaigns.php b/plugins/Referrers/Reports/GetCampaigns.php
new file mode 100644
index 0000000000..53282f6c38
--- /dev/null
+++ b/plugins/Referrers/Reports/GetCampaigns.php
@@ -0,0 +1,40 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Referrers\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\Referrers\Columns\Campaign;
+
+class GetCampaigns extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new Campaign();
+ $this->name = Piwik::translate('Referrers_Campaigns');
+ $this->documentation = Piwik::translate('Referrers_CampaignsReportDocumentation',
+ array('<br />', '<a href="http://piwik.org/docs/tracking-campaigns/" target="_blank">', '</a>'));
+ $this->actionToLoadSubTables = 'getKeywordsFromCampaignId';
+ $this->hasGoalMetrics = true;
+ $this->order = 9;
+ $this->widgetTitle = 'Referrers_Campaigns';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->config->show_goals = true;
+ $view->config->subtable_controller_action = 'getKeywordsFromCampaignId';
+ $view->config->show_exclude_low_population = false;
+ $view->config->addTranslation('label', $this->dimension->getName());
+
+ $view->requestConfig->filter_limit = 25;
+ }
+
+}
diff --git a/plugins/Referrers/Reports/GetKeywords.php b/plugins/Referrers/Reports/GetKeywords.php
new file mode 100644
index 0000000000..b6949f9f01
--- /dev/null
+++ b/plugins/Referrers/Reports/GetKeywords.php
@@ -0,0 +1,44 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Referrers\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\CoreVisualizations\Visualizations\HtmlTable;
+use Piwik\Plugins\Referrers\Columns\Keyword;
+
+class GetKeywords extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new Keyword();
+ $this->name = Piwik::translate('Referrers_Keywords');
+ $this->documentation = Piwik::translate('Referrers_KeywordsReportDocumentation', '<br />');
+ $this->actionToLoadSubTables = 'getSearchEnginesFromKeywordId';
+ $this->hasGoalMetrics = true;
+ $this->order = 3;
+ $this->widgetTitle = 'Referrers_WidgetKeywords';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->config->subtable_controller_action = 'getSearchEnginesFromKeywordId';
+ $view->config->show_exclude_low_population = false;
+ $view->config->addTranslation('label', Piwik::translate('General_ColumnKeyword'));
+ $view->config->show_goals = true;
+
+ $view->requestConfig->filter_limit = 25;
+
+ if ($view->isViewDataTableId(HtmlTable::ID)) {
+ $view->config->disable_subtable_when_show_goals = true;
+ }
+ }
+
+}
diff --git a/plugins/Referrers/Reports/GetKeywordsFromCampaignId.php b/plugins/Referrers/Reports/GetKeywordsFromCampaignId.php
new file mode 100644
index 0000000000..bb9a82ed24
--- /dev/null
+++ b/plugins/Referrers/Reports/GetKeywordsFromCampaignId.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Referrers\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\Referrers\Columns\Keyword;
+
+class GetKeywordsFromCampaignId extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new Keyword();
+ $this->name = Piwik::translate('Referrers_Campaigns');
+ $this->documentation = Piwik::translate('Referrers_CampaignsReportDocumentation',
+ array('<br />', '<a href="http://piwik.org/docs/tracking-campaigns/" target="_blank">', '</a>'));
+ $this->isSubtableReport = true;
+ $this->order = 10;
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->config->show_search = false;
+ $view->config->show_exclude_low_population = false;
+ $view->config->addTranslation('label', $this->dimension->getName());
+ }
+
+}
diff --git a/plugins/Referrers/Reports/GetKeywordsFromSearchEngineId.php b/plugins/Referrers/Reports/GetKeywordsFromSearchEngineId.php
new file mode 100644
index 0000000000..e81202063e
--- /dev/null
+++ b/plugins/Referrers/Reports/GetKeywordsFromSearchEngineId.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Referrers\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\Referrers\Columns\Keyword;
+
+class GetKeywordsFromSearchEngineId extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new Keyword();
+ $this->name = Piwik::translate('Referrers_SearchEngines');
+ $this->documentation = Piwik::translate('Referrers_SearchEnginesReportDocumentation', '<br />');
+ $this->isSubtableReport = true;
+ $this->order = 8;
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->config->show_search = false;
+ $view->config->show_exclude_low_population = false;
+ $view->config->addTranslation('label', $this->dimension->getName());
+ }
+
+}
diff --git a/plugins/Referrers/Reports/GetReferrerType.php b/plugins/Referrers/Reports/GetReferrerType.php
new file mode 100644
index 0000000000..b53734b038
--- /dev/null
+++ b/plugins/Referrers/Reports/GetReferrerType.php
@@ -0,0 +1,77 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Referrers\Reports;
+
+use Piwik\Common;
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\CoreVisualizations\Visualizations\HtmlTable;
+use Piwik\Plugins\Referrers\Columns\ReferrerType;
+
+class GetReferrerType extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new ReferrerType();
+ $this->name = Piwik::translate('Referrers_Type');
+ $this->documentation = Piwik::translate('Referrers_TypeReportDocumentation') . '<br />'
+ . '<b>' . Piwik::translate('Referrers_DirectEntry') . ':</b> ' . Piwik::translate('Referrers_DirectEntryDocumentation') . '<br />'
+ . '<b>' . Piwik::translate('Referrers_SearchEngines') . ':</b> ' . Piwik::translate('Referrers_SearchEnginesDocumentation',
+ array('<br />', '&quot;' . Piwik::translate('Referrers_SubmenuSearchEngines') . '&quot;')) . '<br />'
+ . '<b>' . Piwik::translate('Referrers_Websites') . ':</b> ' . Piwik::translate('Referrers_WebsitesDocumentation',
+ array('<br />', '&quot;' . Piwik::translate('Referrers_SubmenuWebsites') . '&quot;')) . '<br />'
+ . '<b>' . Piwik::translate('Referrers_Campaigns') . ':</b> ' . Piwik::translate('Referrers_CampaignsDocumentation',
+ array('<br />', '&quot;' . Piwik::translate('Referrers_Campaigns') . '&quot;'));
+ $this->constantRowsCount = true;
+ $this->hasGoalMetrics = true;
+ $this->order = 1;
+ $this->widgetTitle = 'General_Overview';
+ }
+
+ public function getDefaultTypeViewDataTable()
+ {
+ return HtmlTable\AllColumns::ID;
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $idSubtable = Common::getRequestVar('idSubtable', false);
+ $labelColumnTitle = $this->name;
+
+ switch ($idSubtable) {
+ case Common::REFERRER_TYPE_SEARCH_ENGINE:
+ $labelColumnTitle = Piwik::translate('Referrers_ColumnSearchEngine');
+ break;
+ case Common::REFERRER_TYPE_WEBSITE:
+ $labelColumnTitle = Piwik::translate('Referrers_ColumnWebsite');
+ break;
+ case Common::REFERRER_TYPE_CAMPAIGN:
+ $labelColumnTitle = Piwik::translate('Referrers_ColumnCampaign');
+ break;
+ default:
+ break;
+ }
+
+ $view->config->show_search = false;
+ $view->config->show_goals = true;
+ $view->config->show_offset_information = false;
+ $view->config->show_pagination_control = false;
+ $view->config->show_limit_control = false;
+ $view->config->show_exclude_low_population = false;
+ $view->config->addTranslation('label', $labelColumnTitle);
+
+ $view->requestConfig->filter_limit = 10;
+
+ if ($view->isViewDataTableId(HtmlTable::ID)) {
+ $view->config->disable_subtable_when_show_goals = true;
+ }
+ }
+
+}
diff --git a/plugins/Referrers/Reports/GetSearchEngines.php b/plugins/Referrers/Reports/GetSearchEngines.php
new file mode 100644
index 0000000000..a85e0d1977
--- /dev/null
+++ b/plugins/Referrers/Reports/GetSearchEngines.php
@@ -0,0 +1,45 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Referrers\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\CoreVisualizations\Visualizations\HtmlTable;
+use Piwik\Plugins\Referrers\Columns\SearchEngine;
+
+class GetSearchEngines extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new SearchEngine();
+ $this->name = Piwik::translate('Referrers_SearchEngines');
+ $this->documentation = Piwik::translate('Referrers_SearchEnginesReportDocumentation', '<br />');
+ $this->actionToLoadSubTables = 'getKeywordsFromSearchEngineId';
+ $this->hasGoalMetrics = true;
+ $this->order = 7;
+ $this->widgetTitle = 'Referrers_SearchEngines';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->config->subtable_controller_action = 'getKeywordsFromSearchEngineId';
+ $view->config->show_exclude_low_population = false;
+ $view->config->show_search = false;
+ $view->config->show_goals = true;
+ $view->config->addTranslation('label', $this->dimension->getName());
+
+ $view->requestConfig->filter_limit = 25;
+
+ if ($view->isViewDataTableId(HtmlTable::ID)) {
+ $view->config->disable_subtable_when_show_goals = true;
+ }
+ }
+
+}
diff --git a/plugins/Referrers/Reports/GetSearchEnginesFromKeywordId.php b/plugins/Referrers/Reports/GetSearchEnginesFromKeywordId.php
new file mode 100644
index 0000000000..162c215c1a
--- /dev/null
+++ b/plugins/Referrers/Reports/GetSearchEnginesFromKeywordId.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Referrers\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\Referrers\Columns\SearchEngine;
+
+class GetSearchEnginesFromKeywordId extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new SearchEngine();
+ $this->name = Piwik::translate('Referrers_Keywords');
+ $this->documentation = Piwik::translate('Referrers_KeywordsReportDocumentation', '<br />');
+ $this->isSubtableReport = true;
+ $this->order = 4;
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->config->show_search = false;
+ $view->config->show_exclude_low_population = false;
+ $view->config->addTranslation('label', $this->dimension->getName());
+ }
+
+}
diff --git a/plugins/Referrers/Reports/GetSocials.php b/plugins/Referrers/Reports/GetSocials.php
new file mode 100644
index 0000000000..e59ae44690
--- /dev/null
+++ b/plugins/Referrers/Reports/GetSocials.php
@@ -0,0 +1,55 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Referrers\Reports;
+
+use Piwik\Common;
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\CoreVisualizations\Visualizations\HtmlTable;
+use Piwik\Plugins\CoreVisualizations\Visualizations\JqplotGraph\Pie;
+use Piwik\Plugins\Referrers\Columns\SocialNetwork;
+
+class GetSocials extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new SocialNetwork();
+ $this->name = Piwik::translate('Referrers_Socials');
+ $this->documentation = Piwik::translate('Referrers_WebsitesReportDocumentation', '<br />');
+ $this->actionToLoadSubTables = 'getUrlsForSocial';
+ $this->order = 11;
+ $this->widgetTitle = 'Referrers_WidgetSocials';
+ }
+
+ public function getDefaultTypeViewDataTable()
+ {
+ return Pie::ID;
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->config->subtable_controller_action = 'getUrlsForSocial';
+ $view->config->show_exclude_low_population = false;
+ $view->config->show_goals = true;
+ $view->config->addTranslation('label', $this->dimension->getName());
+
+ $view->requestConfig->filter_limit = 10;
+
+ if ($view->isViewDataTableId(HtmlTable::ID)) {
+ $view->config->disable_subtable_when_show_goals = true;
+ }
+
+ $widget = Common::getRequestVar('widget', false);
+ if (empty($widget)) {
+ $view->config->show_footer_message = Piwik::translate('Referrers_SocialFooterMessage');
+ }
+ }
+
+}
diff --git a/plugins/Referrers/Reports/GetUrlsForSocial.php b/plugins/Referrers/Reports/GetUrlsForSocial.php
new file mode 100644
index 0000000000..51fd006485
--- /dev/null
+++ b/plugins/Referrers/Reports/GetUrlsForSocial.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Referrers\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\Referrers\Columns\WebsitePage;
+
+class GetUrlsForSocial extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new WebsitePage();
+ $this->name = Piwik::translate('Referrers_Socials');
+ $this->documentation = Piwik::translate('Referrers_WebsitesReportDocumentation', '<br />');
+ $this->isSubtableReport = true;
+ $this->order = 12;
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->config->show_goals = true;
+ $view->config->show_exclude_low_population = false;
+ $view->config->addTranslation('label', $this->dimension->getName());
+
+ $view->requestConfig->filter_limit = 10;
+ }
+
+}
diff --git a/plugins/Referrers/Reports/GetUrlsFromWebsiteId.php b/plugins/Referrers/Reports/GetUrlsFromWebsiteId.php
new file mode 100644
index 0000000000..a706ad5ee1
--- /dev/null
+++ b/plugins/Referrers/Reports/GetUrlsFromWebsiteId.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Referrers\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\Referrers\Columns\WebsitePage;
+
+class GetUrlsFromWebsiteId extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new WebsitePage();
+ $this->name = Piwik::translate('CorePluginsAdmin_Websites');
+ $this->documentation = Piwik::translate('Referrers_WebsitesReportDocumentation', '<br />');
+ $this->isSubtableReport = true;
+ $this->order = 6;
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->config->show_search = false;
+ $view->config->show_exclude_low_population = false;
+ $view->config->tooltip_metadata_name = 'url';
+ $view->config->addTranslation('label', $this->dimension->getName());
+ }
+
+}
diff --git a/plugins/Referrers/Reports/GetWebsites.php b/plugins/Referrers/Reports/GetWebsites.php
new file mode 100644
index 0000000000..0c0a5212c6
--- /dev/null
+++ b/plugins/Referrers/Reports/GetWebsites.php
@@ -0,0 +1,44 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Referrers\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\CoreVisualizations\Visualizations\HtmlTable;
+use Piwik\Plugins\Referrers\Columns\Website;
+
+class GetWebsites extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new Website();
+ $this->name = Piwik::translate('CorePluginsAdmin_Websites');
+ $this->documentation = Piwik::translate('Referrers_WebsitesReportDocumentation', '<br />');
+ $this->actionToLoadSubTables = 'getUrlsFromWebsiteId';
+ $this->hasGoalMetrics = true;
+ $this->order = 5;
+ $this->widgetTitle = 'Referrers_WidgetExternalWebsites';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->config->subtable_controller_action = 'getUrlsFromWebsiteId';
+ $view->config->show_exclude_low_population = false;
+ $view->config->show_goals = true;
+ $view->config->addTranslation('label', $this->dimension->getName());
+
+ $view->requestConfig->filter_limit = 25;
+
+ if ($view->isViewDataTableId(HtmlTable::ID)) {
+ $view->config->disable_subtable_when_show_goals = true;
+ }
+ }
+
+}
diff --git a/plugins/Referrers/Segment.php b/plugins/Referrers/Segment.php
new file mode 100644
index 0000000000..d2255eef34
--- /dev/null
+++ b/plugins/Referrers/Segment.php
@@ -0,0 +1,21 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Referrers;
+
+/**
+ * Referrers segment base class.
+ *
+ */
+class Segment extends \Piwik\Plugin\Segment
+{
+ protected function init()
+ {
+ $this->setCategory('Referrers_Referrers');
+ }
+}
diff --git a/plugins/Referrers/Widgets.php b/plugins/Referrers/Widgets.php
index 9fa85772cb..f1e78ac783 100644
--- a/plugins/Referrers/Widgets.php
+++ b/plugins/Referrers/Widgets.php
@@ -15,19 +15,8 @@ class Widgets extends \Piwik\Plugin\Widgets
{
public function configure(WidgetsList $widgetsList)
{
- $category = 'Referrers_Referrers';
- $controller = 'Referrers';
-
- $widgetsList->add($category, 'Referrers_WidgetKeywords', $controller, 'getKeywords');
- $widgetsList->add($category, 'Referrers_WidgetExternalWebsites', $controller, 'getWebsites');
- $widgetsList->add($category, 'Referrers_WidgetSocials', $controller, 'getSocials');
- $widgetsList->add($category, 'Referrers_SearchEngines', $controller, 'getSearchEngines');
- $widgetsList->add($category, 'Referrers_Campaigns', $controller, 'getCampaigns');
- $widgetsList->add($category, 'General_Overview', $controller, 'getReferrerType');
- $widgetsList->add($category, 'Referrers_WidgetGetAll', $controller, 'getAll');
-
if (SettingsPiwik::isSegmentationEnabled()) {
- $widgetsList->add('SEO', 'Referrers_WidgetTopKeywordsForPages', $controller, 'getKeywordsForPage');
+ $widgetsList->add('SEO', 'Referrers_WidgetTopKeywordsForPages', 'Referrers', 'getKeywordsForPage');
}
}
diff --git a/plugins/UserCountry/Columns/Base.php b/plugins/UserCountry/Columns/Base.php
new file mode 100644
index 0000000000..dfe51fe4e7
--- /dev/null
+++ b/plugins/UserCountry/Columns/Base.php
@@ -0,0 +1,159 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserCountry\Columns;
+
+use Piwik\Common;
+use Piwik\Plugin\VisitDimension;
+use Piwik\Plugins\UserCountry\LocationProvider\GeoIp;
+use Piwik\Plugins\UserCountry\LocationProvider;
+use Piwik\Plugins\PrivacyManager\Config as PrivacyManagerConfig;
+use Piwik\Plugins\UserCountry\LocationProvider\DefaultProvider;
+use Piwik\IP;
+use Piwik\Tracker\Visitor;
+use Piwik\Tracker\Visit;
+use Piwik\Tracker\Request;
+
+abstract class Base extends VisitDimension
+{
+ private $cachedLocations = array();
+
+ protected function getUrlOverrideValueIfAllowed($urlParamToOverride, Request $request)
+ {
+ if (!$request->isAuthenticated()) {
+ return false;
+ }
+
+ $value = Common::getRequestVar($urlParamToOverride, false, 'string', $request->getParams());
+ if (!empty($value)) {
+ return $value;
+ }
+
+ return false;
+ }
+
+ public function getRequiredVisitFields()
+ {
+ return array('location_ip', 'location_browser_lang');
+ }
+
+ protected function getLocationDetail($userInfo, $locationKey)
+ {
+ $location = $this->getCachedLocation($userInfo);
+
+ if (!empty($location[$locationKey])) {
+ return $location[$locationKey];
+ }
+
+ return false;
+ }
+
+ protected function getUserInfo(Request $request, Visitor $visitor)
+ {
+ $ipAddress = $this->getIpAddress($visitor->getVisitorColumn('location_ip'), $request);
+ $language = $visitor->getVisitorColumn('location_browser_lang');
+ $userInfo = array('lang' => $language, 'ip' => $ipAddress);
+
+ return $userInfo;
+ }
+
+ protected function getCachedLocation($userInfo)
+ {
+ require_once PIWIK_INCLUDE_PATH . "/plugins/UserCountry/LocationProvider.php";
+
+ $key = md5(implode(',', $userInfo));
+
+ if (array_key_exists($key, $this->cachedLocations)) {
+ return $this->cachedLocations[$key];
+ }
+
+ $provider = $this->getProvider();
+ $location = $this->getLocation($provider, $userInfo);
+
+ if (empty($location)) {
+ $providerId = $provider->getId();
+ Common::printDebug("GEO: couldn't find a location with Geo Module '$providerId'");
+
+ if (!$this->isDefaultProvider($provider)) {
+ Common::printDebug("Using default provider as fallback...");
+ $provider = $this->getDefaultProvider();
+ $location = $this->getLocation($provider, $userInfo);
+ }
+ }
+
+ if (empty($location['country_code'])) { // sanity check
+ $location['country_code'] = Visit::UNKNOWN_CODE;
+ }
+
+ $this->cachedLocations[$key] = $location;
+
+ return $location;
+ }
+
+ private function getIpAddress($anonymizedIp, \Piwik\Tracker\Request $request)
+ {
+ $privacyConfig = new PrivacyManagerConfig();
+
+ $ip = $request->getIp();
+
+ if ($privacyConfig->useAnonymizedIpForVisitEnrichment) {
+ $ip = $anonymizedIp;
+ }
+
+ $ipAddress = IP::N2P($ip);
+
+ return $ipAddress;
+ }
+
+ /**
+ * @param \Piwik\Plugins\UserCountry\LocationProvider $provider
+ * @param array $userInfo
+ * @return array|null
+ */
+ private function getLocation($provider, $userInfo)
+ {
+ $location = $provider->getLocation($userInfo);
+ $providerId = $provider->getId();
+ $ipAddress = $userInfo['ip'];
+
+ if ($location === false) {
+ return false;
+ }
+
+ Common::printDebug("GEO: Found IP $ipAddress location (provider '" . $providerId . "'): " . var_export($location, true));
+
+ return $location;
+ }
+
+ private function getDefaultProvider()
+ {
+ $id = DefaultProvider::ID;
+ $provider = LocationProvider::getProviderById($id);
+
+ return $provider;
+ }
+
+ private function isDefaultProvider($provider)
+ {
+ return !empty($provider) && DefaultProvider::ID == $provider->getId();
+ }
+
+ private function getProvider()
+ {
+ $id = Common::getCurrentLocationProviderId();
+ $provider = LocationProvider::getProviderById($id);
+
+ if ($provider === false) {
+ $provider = $this->getDefaultProvider();
+ Common::printDebug("GEO: no current location provider sent, falling back to default '$id' one.");
+ }
+
+ return $provider;
+ }
+
+} \ No newline at end of file
diff --git a/plugins/UserCountry/Columns/City.php b/plugins/UserCountry/Columns/City.php
new file mode 100644
index 0000000000..aa353e6ca3
--- /dev/null
+++ b/plugins/UserCountry/Columns/City.php
@@ -0,0 +1,77 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserCountry\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugins\UserCountry\LocationProvider;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+use Piwik\Tracker\Action;
+use Piwik\Plugins\UserCountry\Segment;
+
+class City extends Base
+{
+ protected $fieldName = 'location_city';
+ protected $fieldType = 'varchar(255) DEFAULT NULL';
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setSegment('city');
+ $segment->setName('UserCountry_City');
+ $segment->setAcceptedValues('Sydney, Sao Paolo, Rome, etc.');
+ $this->addSegment($segment);
+ }
+
+ public function getName()
+ {
+ return Piwik::translate('UserCountry_City');
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ $value = $this->getUrlOverrideValueIfAllowed('city', $request);
+
+ if ($value !== false) {
+ return $value;
+ }
+
+ $userInfo = $this->getUserInfo($request, $visitor);
+
+ return $this->getLocationDetail($userInfo, LocationProvider::CITY_NAME_KEY);
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return int
+ */
+ public function onExistingVisit(Request $request, Visitor $visitor, $action)
+ {
+ return $this->getUrlOverrideValueIfAllowed('city', $request);
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onRecordGoal(Request $request, Visitor $visitor, $action)
+ {
+ return $visitor->getVisitorColumn($this->fieldName);
+ }
+} \ No newline at end of file
diff --git a/plugins/UserCountry/Columns/Continent.php b/plugins/UserCountry/Columns/Continent.php
new file mode 100644
index 0000000000..ca3438e745
--- /dev/null
+++ b/plugins/UserCountry/Columns/Continent.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserCountry\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+
+class Continent extends VisitDimension
+{
+ public function getName()
+ {
+ return Piwik::translate('UserCountry_Continent');
+ }
+} \ No newline at end of file
diff --git a/plugins/UserCountry/Columns/Country.php b/plugins/UserCountry/Columns/Country.php
new file mode 100644
index 0000000000..9e7e41b47a
--- /dev/null
+++ b/plugins/UserCountry/Columns/Country.php
@@ -0,0 +1,141 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserCountry\Columns;
+
+use Piwik\Common;
+use Piwik\Config;
+use Piwik\IP;
+use Piwik\Piwik;
+use Piwik\Plugins\Provider\Provider;
+use Piwik\Plugins\UserCountry\LocationProvider;
+use Piwik\Plugins\UserCountry\Segment;
+use Piwik\Tracker\Visit;
+use Piwik\Tracker\Visitor;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\Request;
+
+class Country extends Base
+{
+ protected $fieldName = 'location_country';
+ protected $fieldType = 'CHAR(3) NOT NULL';
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setSegment('countryCode');
+ $segment->setName('UserCountry_Country');
+ $segment->setAcceptedValues('de, us, fr, in, es, etc.');
+ $this->addSegment($segment);
+
+ $segment = new Segment();
+ $segment->setSegment('continentCode');
+ $segment->setName('UserCountry_Continent');
+ $segment->setSqlFilter('Piwik\Plugins\UserCountry\UserCountry::getCountriesForContinent');
+ $segment->setAcceptedValues('eur, asi, amc, amn, ams, afr, ant, oce');
+ $this->addSegment($segment);
+ }
+
+ public function getName()
+ {
+ return Piwik::translate('UserCountry_Country');
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ $value = $this->getUrlOverrideValueIfAllowed('country', $request);
+
+ if ($value !== false) {
+ return $value;
+ }
+
+ $userInfo = $this->getUserInfo($request, $visitor);
+ $country = $this->getLocationDetail($userInfo, LocationProvider::COUNTRY_CODE_KEY);
+
+ if (!empty($country) && $country != Visit::UNKNOWN_CODE) {
+
+ return strtolower($country);
+ }
+
+ $country = $this->getCountryUsingProviderExtensionIfValid($userInfo['ip']);
+
+ if (!empty($country)) {
+ return $country;
+ }
+
+ return Visit::UNKNOWN_CODE;
+ }
+
+ private function getCountryUsingProviderExtensionIfValid($ipAddress)
+ {
+ $hostname = $this->getHost($ipAddress);
+ $hostnameExtension = Provider::getCleanHostname($hostname);
+
+ $hostnameDomain = substr($hostnameExtension, 1 + strrpos($hostnameExtension, '.'));
+ if ($hostnameDomain == 'uk') {
+ $hostnameDomain = 'gb';
+ }
+
+ if (array_key_exists($hostnameDomain, Common::getCountriesList())) {
+ return $hostnameDomain;
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns the hostname given the IP address string
+ *
+ * @param string $ip IP Address
+ * @return string hostname (or human-readable IP address)
+ */
+ private function getHost($ip)
+ {
+ return trim(strtolower(@IP::getHostByAddr($ip)));
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return int
+ */
+ public function onExistingVisit(Request $request, Visitor $visitor, $action)
+ {
+ return $this->getUrlOverrideValueIfAllowed('country', $request);
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onRecordGoal(Request $request, Visitor $visitor, $action)
+ {
+ $country = $visitor->getVisitorColumn($this->fieldName);
+
+ if (isset($country) && false !== $country) {
+ return $country;
+ }
+
+ $browserLanguage = $request->getBrowserLanguage();
+ $enableLanguageToCountryGuess = Config::getInstance()->Tracker['enable_language_to_country_guess'];
+ $locationIp = $visitor->getVisitorColumn('location_ip');
+
+ $country = Common::getCountry($browserLanguage, $enableLanguageToCountryGuess, $locationIp);
+
+ return $country;
+ }
+} \ No newline at end of file
diff --git a/plugins/UserCountry/Columns/Latitude.php b/plugins/UserCountry/Columns/Latitude.php
new file mode 100644
index 0000000000..ec1b543c5c
--- /dev/null
+++ b/plugins/UserCountry/Columns/Latitude.php
@@ -0,0 +1,77 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserCountry\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugins\UserCountry\LocationProvider;
+use Piwik\Plugins\UserCountry\Segment;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+use Piwik\Tracker\Action;
+
+class Latitude extends Base
+{
+ protected $fieldName = 'location_latitude';
+ protected $fieldType = 'float(10, 6) DEFAULT NULL';
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setSegment('latitude');
+ $segment->setName('UserCountry_Latitude');
+ $segment->setAcceptedValues('-33.578, 40.830, etc.<br/>You can select visitors within a lat/long range using &segment=lat&gt;X;lat&lt;Y;long&gt;M;long&lt;N.');
+ $this->addSegment($segment);
+ }
+
+ public function getName()
+ {
+ return Piwik::translate('UserCountry_Latitude');
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ $value = $this->getUrlOverrideValueIfAllowed('lat', $request);
+
+ if ($value !== false) {
+ return $value;
+ }
+
+ $userInfo = $this->getUserInfo($request, $visitor);
+
+ return $this->getLocationDetail($userInfo, LocationProvider::LATITUDE_KEY);
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return int
+ */
+ public function onExistingVisit(Request $request, Visitor $visitor, $action)
+ {
+ return $this->getUrlOverrideValueIfAllowed('lat', $request);
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onRecordGoal(Request $request, Visitor $visitor, $action)
+ {
+ return $visitor->getVisitorColumn($this->fieldName);
+ }
+} \ No newline at end of file
diff --git a/plugins/UserCountry/Columns/Longitude.php b/plugins/UserCountry/Columns/Longitude.php
new file mode 100644
index 0000000000..5fd4261329
--- /dev/null
+++ b/plugins/UserCountry/Columns/Longitude.php
@@ -0,0 +1,77 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserCountry\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugins\UserCountry\LocationProvider;
+use Piwik\Plugins\UserCountry\Segment;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+use Piwik\Tracker\Action;
+
+class Longitude extends Base
+{
+ protected $fieldName = 'location_longitude';
+ protected $fieldType = 'float(10, 6) DEFAULT NULL';
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setSegment('longitude');
+ $segment->setName('UserCountry_Longitude');
+ $segment->setAcceptedValues('-70.664, 14.326, etc.');
+ $this->addSegment($segment);
+ }
+
+ public function getName()
+ {
+ return Piwik::translate('UserCountry_Latitude');
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ $value = $this->getUrlOverrideValueIfAllowed('long', $request);
+
+ if ($value !== false) {
+ return $value;
+ }
+
+ $userInfo = $this->getUserInfo($request, $visitor);
+
+ return $this->getLocationDetail($userInfo, LocationProvider::LONGITUDE_KEY);
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return int
+ */
+ public function onExistingVisit(Request $request, Visitor $visitor, $action)
+ {
+ return $this->getUrlOverrideValueIfAllowed('long', $request);
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onRecordGoal(Request $request, Visitor $visitor, $action)
+ {
+ return $visitor->getVisitorColumn($this->fieldName);
+ }
+} \ No newline at end of file
diff --git a/plugins/UserCountry/Columns/Provider.php b/plugins/UserCountry/Columns/Provider.php
new file mode 100644
index 0000000000..8eb7761db1
--- /dev/null
+++ b/plugins/UserCountry/Columns/Provider.php
@@ -0,0 +1,61 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserCountry\Columns;
+
+use Piwik\Plugin\Manager;
+use Piwik\Plugins\UserCountry\LocationProvider;
+use Piwik\Tracker\Visitor;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\Request;
+
+class Provider extends Base
+{
+ protected $fieldName = 'location_provider';
+
+ public function getName()
+ {
+ return '';
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ if (!Manager::getInstance()->isPluginInstalled('Provider')) {
+ return false;
+ }
+
+ $userInfo = $this->getUserInfo($request, $visitor);
+
+ $isp = $this->getLocationDetail($userInfo, LocationProvider::ISP_KEY);
+ $org = $this->getLocationDetail($userInfo, LocationProvider::ORG_KEY);
+
+ // if the location has provider/organization info, set it
+ if (!empty($isp)) {
+ $providerValue = $isp;
+
+ // if the org is set and not the same as the isp, add it to the provider value
+ if (!empty($org) && $org != $providerValue) {
+ $providerValue .= ' - ' . $org;
+ }
+
+ return $providerValue;
+ }
+
+ if (!empty($org)) {
+ return $org;
+ }
+
+ return false;
+ }
+} \ No newline at end of file
diff --git a/plugins/UserCountry/Columns/Region.php b/plugins/UserCountry/Columns/Region.php
new file mode 100644
index 0000000000..b85ac2ab3b
--- /dev/null
+++ b/plugins/UserCountry/Columns/Region.php
@@ -0,0 +1,77 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserCountry\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugins\UserCountry\LocationProvider;
+use Piwik\Plugins\UserCountry\Segment;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+use Piwik\Tracker\Action;
+
+class Region extends Base
+{
+ protected $fieldName = 'location_region';
+ protected $fieldType = 'char(2) DEFAULT NULL';
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setSegment('regionCode');
+ $segment->setName('UserCountry_Region');
+ $segment->setAcceptedValues('01 02, OR, P8, etc.<br/>eg. region=A1;country=fr');
+ $this->addSegment($segment);
+ }
+
+ public function getName()
+ {
+ return Piwik::translate('UserCountry_Region');
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ $value = $this->getUrlOverrideValueIfAllowed('region', $request);
+
+ if ($value !== false) {
+ return $value;
+ }
+
+ $userInfo = $this->getUserInfo($request, $visitor);
+
+ return $this->getLocationDetail($userInfo, LocationProvider::REGION_CODE_KEY);
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return int
+ */
+ public function onExistingVisit(Request $request, Visitor $visitor, $action)
+ {
+ return $this->getUrlOverrideValueIfAllowed('region', $request);
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onRecordGoal(Request $request, Visitor $visitor, $action)
+ {
+ return $visitor->getVisitorColumn($this->fieldName);
+ }
+} \ No newline at end of file
diff --git a/plugins/UserCountry/LocationProvider.php b/plugins/UserCountry/LocationProvider.php
index 141368c075..d0ffd93f51 100755
--- a/plugins/UserCountry/LocationProvider.php
+++ b/plugins/UserCountry/LocationProvider.php
@@ -307,14 +307,21 @@ abstract class LocationProvider
public static function getProviderById($providerId)
{
foreach (self::getAvailableProviders() as $provider) {
- $info = $provider->getInfo();
- if ($info['id'] == $providerId) {
+ if ($provider->getId() == $providerId) {
return $provider;
}
}
+
return false;
}
+ public function getId()
+ {
+ $info = $this->getInfo();
+
+ return $info['id'];
+ }
+
/**
* Tries to fill in any missing information in a location result.
*
diff --git a/plugins/UserCountry/Reports/Base.php b/plugins/UserCountry/Reports/Base.php
new file mode 100644
index 0000000000..c488d13607
--- /dev/null
+++ b/plugins/UserCountry/Reports/Base.php
@@ -0,0 +1,64 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserCountry\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\UserCountry\UserCountry;
+use Piwik\Url;
+
+abstract class Base extends \Piwik\Plugin\Report
+{
+ protected function init()
+ {
+ $this->category = 'General_Visitors';
+ }
+
+ protected function getGeoIPReportDocSuffix()
+ {
+ return Piwik::translate('UserCountry_GeoIPDocumentationSuffix',
+ array('<a target="_blank" href="http://www.maxmind.com/?rId=piwik">',
+ '</a>',
+ '<a target="_blank" href="http://www.maxmind.com/en/city_accuracy?rId=piwik">',
+ '</a>')
+ );
+ }
+
+ /**
+ * Checks if a datatable for a view is empty and if so, displays a message in the footer
+ * telling users to configure GeoIP.
+ */
+ protected function checkIfNoDataForGeoIpReport(ViewDataTable $view)
+ {
+ $view->config->filters[] = function ($dataTable) use ($view) {
+ // if there's only one row whose label is 'Unknown', display a message saying there's no data
+ if ($dataTable->getRowsCount() == 1
+ && $dataTable->getFirstRow()->getColumn('label') == Piwik::translate('General_Unknown')
+ ) {
+ $footerMessage = Piwik::translate('UserCountry_NoDataForGeoIPReport1');
+
+ $userCountry = new UserCountry();
+ // if GeoIP is working, don't display this part of the message
+ if (!$userCountry->isGeoIPWorking()) {
+ $params = array('module' => 'UserCountry', 'action' => 'adminIndex');
+ $footerMessage .= ' ' . Piwik::translate('UserCountry_NoDataForGeoIPReport2',
+ array('<a target="_blank" href="' . Url::getCurrentQueryStringWithParametersModified($params) . '">',
+ '</a>',
+ '<a target="_blank" href="http://dev.maxmind.com/geoip/geolite?rId=piwik">',
+ '</a>'));
+ } else {
+ $footerMessage .= ' ' . Piwik::translate('UserCountry_ToGeolocateOldVisits',
+ array('<a target="_blank" href="http://piwik.org/faq/how-to/#faq_167">', '</a>'));
+ }
+
+ $view->config->show_footer_message = $footerMessage;
+ }
+ };
+ }
+}
diff --git a/plugins/UserCountry/Reports/GetCity.php b/plugins/UserCountry/Reports/GetCity.php
new file mode 100644
index 0000000000..7619e427f6
--- /dev/null
+++ b/plugins/UserCountry/Reports/GetCity.php
@@ -0,0 +1,42 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserCountry\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\UserCountry\Columns\City;
+
+class GetCity extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new City();
+ $this->name = Piwik::translate('UserCountry_City');
+ $this->documentation = Piwik::translate('UserCountry_getCityDocumentation') . '<br/>' . $this->getGeoIPReportDocSuffix();
+ $this->metrics = array('nb_visits', 'nb_uniq_visitors', 'nb_actions');
+ $this->hasGoalMetrics = true;
+ $this->order = 8;
+ $this->widgetTitle = Piwik::translate('UserCountry_WidgetLocation')
+ . ' (' . Piwik::translate('UserCountry_City') . ')';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->config->show_exclude_low_population = false;
+ $view->config->show_goals = true;
+ $view->config->documentation = $this->documentation;
+ $view->config->addTranslation('label', $this->dimension->getName());
+
+ $view->requestConfig->filter_limit = 5;
+
+ $this->checkIfNoDataForGeoIpReport($view);
+ }
+
+}
diff --git a/plugins/UserCountry/Reports/GetContinent.php b/plugins/UserCountry/Reports/GetContinent.php
new file mode 100644
index 0000000000..1640dd9cc3
--- /dev/null
+++ b/plugins/UserCountry/Reports/GetContinent.php
@@ -0,0 +1,42 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserCountry\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\UserCountry\Columns\Continent;
+
+class GetContinent extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new Continent();
+ $this->name = Piwik::translate('UserCountry_Continent');
+ $this->documentation = Piwik::translate('UserCountry_getContinentDocumentation');
+ $this->metrics = array('nb_visits', 'nb_uniq_visitors', 'nb_actions');
+ $this->hasGoalMetrics = true;
+ $this->order = 6;
+ $this->widgetTitle = Piwik::translate('UserCountry_WidgetLocation')
+ . ' (' . Piwik::translate('UserCountry_Continent') . ')';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->config->show_exclude_low_population = false;
+ $view->config->show_goals = true;
+ $view->config->show_search = false;
+ $view->config->show_offset_information = false;
+ $view->config->show_pagination_control = false;
+ $view->config->show_limit_control = false;
+ $view->config->documentation = $this->documentation;
+ $view->config->addTranslation('label', $this->dimension->getName());
+ }
+
+}
diff --git a/plugins/UserCountry/Reports/GetCountry.php b/plugins/UserCountry/Reports/GetCountry.php
new file mode 100644
index 0000000000..4e1a0475f4
--- /dev/null
+++ b/plugins/UserCountry/Reports/GetCountry.php
@@ -0,0 +1,50 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserCountry\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\UserCountry\Columns\Country;
+use Piwik\Plugins\UserCountry\LocationProvider;
+
+class GetCountry extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new Country();
+ $this->name = Piwik::translate('UserCountry_Country');
+ $this->documentation = Piwik::translate('UserCountry_getCountryDocumentation');
+ $this->metrics = array('nb_visits', 'nb_uniq_visitors', 'nb_actions');
+ $this->hasGoalMetrics = true;
+ $this->order = 5;
+ $this->widgetTitle = Piwik::translate('UserCountry_WidgetLocation')
+ . ' (' . Piwik::translate('UserCountry_Country') . ')';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->config->show_goals = true;
+ $view->config->show_exclude_low_population = false;
+ $view->config->addTranslation('label', $this->dimension->getName());
+ $view->config->documentation = $this->documentation;
+
+ $view->requestConfig->filter_limit = 5;
+
+ if (LocationProvider::getCurrentProviderId() == LocationProvider\DefaultProvider::ID) {
+ // if we're using the default location provider, add a note explaining how it works
+ $footerMessage = Piwik::translate("General_Note") . ': '
+ . Piwik::translate('UserCountry_DefaultLocationProviderExplanation',
+ array('<a target="_blank" href="http://piwik.org/docs/geo-locate/">', '</a>'));
+
+ $view->config->show_footer_message = $footerMessage;
+ }
+ }
+
+}
diff --git a/plugins/UserCountry/Reports/GetRegion.php b/plugins/UserCountry/Reports/GetRegion.php
new file mode 100644
index 0000000000..dd038ce63f
--- /dev/null
+++ b/plugins/UserCountry/Reports/GetRegion.php
@@ -0,0 +1,42 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserCountry\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\UserCountry\Columns\Region;
+
+class GetRegion extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new Region();
+ $this->name = Piwik::translate('UserCountry_Region');
+ $this->documentation = Piwik::translate('UserCountry_getRegionDocumentation') . '<br/>' . $this->getGeoIPReportDocSuffix();
+ $this->metrics = array('nb_visits', 'nb_uniq_visitors', 'nb_actions');
+ $this->hasGoalMetrics = true;
+ $this->order = 7;
+ $this->widgetTitle = Piwik::translate('UserCountry_WidgetLocation')
+ . ' (' . Piwik::translate('UserCountry_Region') . ')';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->config->show_exclude_low_population = false;
+ $view->config->show_goals = true;
+ $view->config->documentation = $this->documentation;
+ $view->config->addTranslation('label', $this->dimension->getName());
+
+ $view->requestConfig->filter_limit = 5;
+
+ $this->checkIfNoDataForGeoIpReport($view);
+ }
+
+}
diff --git a/plugins/UserCountry/Segment.php b/plugins/UserCountry/Segment.php
new file mode 100644
index 0000000000..8f6b77559e
--- /dev/null
+++ b/plugins/UserCountry/Segment.php
@@ -0,0 +1,21 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserCountry;
+
+/**
+ * UserCountry segment base class.
+ *
+ */
+class Segment extends \Piwik\Plugin\Segment
+{
+ protected function init()
+ {
+ $this->setCategory('Visit Location');
+ }
+}
diff --git a/plugins/UserCountry/UserCountry.php b/plugins/UserCountry/UserCountry.php
index 95e6f389ac..23d4c4c3e3 100644
--- a/plugins/UserCountry/UserCountry.php
+++ b/plugins/UserCountry/UserCountry.php
@@ -11,14 +11,9 @@ namespace Piwik\Plugins\UserCountry;
use Piwik\ArchiveProcessor;
use Piwik\Common;
use Piwik\Config;
-use Piwik\IP;
use Piwik\Piwik;
-use Piwik\Plugin\Manager;
-use Piwik\Plugin\ViewDataTable;
-use Piwik\Plugins\PrivacyManager\Config as PrivacyManagerConfig;
use Piwik\Plugins\UserCountry\LocationProvider\GeoIp;
use Piwik\Plugins\UserCountry\LocationProvider;
-use Piwik\Plugins\UserCountry\LocationProvider\DefaultProvider;
use Piwik\Url;
/**
@@ -36,19 +31,13 @@ class UserCountry extends \Piwik\Plugin
*/
public function getListHooksRegistered()
{
- $hooks = array(
- 'Goals.getReportsWithGoalMetrics' => 'getReportsWithGoalMetrics',
- 'API.getReportMetadata' => 'getReportMetadata',
- 'API.getSegmentDimensionMetadata' => 'getSegmentsMetadata',
+ return array(
'AssetManager.getStylesheetFiles' => 'getStylesheetFiles',
'AssetManager.getJavaScriptFiles' => 'getJsFiles',
- 'Tracker.newVisitorInformation' => 'enrichVisitWithLocation',
- 'ViewDataTable.configure' => 'configureViewDataTable',
'Translate.getClientSideTranslationKeys' => 'getClientSideTranslationKeys',
'Tracker.setTrackerCacheGeneral' => 'setTrackerCacheGeneral',
'Insights.addReportToOverview' => 'addReportToInsightsOverview'
);
- return $hooks;
}
public function addReportToInsightsOverview(&$reports)
@@ -71,223 +60,6 @@ class UserCountry extends \Piwik\Plugin
$jsFiles[] = "plugins/UserCountry/javascripts/userCountry.js";
}
- public function enrichVisitWithLocation(&$visitorInfo, \Piwik\Tracker\Request $request)
- {
- require_once PIWIK_INCLUDE_PATH . "/plugins/UserCountry/LocationProvider.php";
-
- $privacyConfig = new PrivacyManagerConfig();
-
- $ipAddress = IP::N2P($privacyConfig->useAnonymizedIpForVisitEnrichment ? $visitorInfo['location_ip'] : $request->getIp());
- $userInfo = array(
- 'lang' => $visitorInfo['location_browser_lang'],
- 'ip' => $ipAddress
- );
-
- $id = Common::getCurrentLocationProviderId();
- $provider = LocationProvider::getProviderById($id);
- if ($provider === false) {
- $id = DefaultProvider::ID;
- $provider = LocationProvider::getProviderById($id);
- Common::printDebug("GEO: no current location provider sent, falling back to default '$id' one.");
- }
-
- $location = $provider->getLocation($userInfo);
-
- // if we can't find a location, use default provider
- if ($location === false) {
- $defaultId = DefaultProvider::ID;
- $provider = LocationProvider::getProviderById($defaultId);
- $location = $provider->getLocation($userInfo);
- Common::printDebug("GEO: couldn't find a location with Geo Module '$id', using Default '$defaultId' provider as fallback...");
- $id = $defaultId;
- }
- Common::printDebug("GEO: Found IP $ipAddress location (provider '" . $id . "'): " . var_export($location, true));
-
- if (empty($location['country_code'])) { // sanity check
- $location['country_code'] = \Piwik\Tracker\Visit::UNKNOWN_CODE;
- }
-
- // add optional location components
- $this->updateVisitInfoWithLocation($visitorInfo, $location);
- }
-
- /**
- * Sets visitor info array with location info.
- *
- * @param array $visitorInfo
- * @param array $location See LocationProvider::getLocation for more info.
- */
- private function updateVisitInfoWithLocation(&$visitorInfo, $location)
- {
- static $logVisitToLowerLocationMapping = array(
- 'location_country' => LocationProvider::COUNTRY_CODE_KEY,
- );
-
- static $logVisitToLocationMapping = array(
- 'location_region' => LocationProvider::REGION_CODE_KEY,
- 'location_city' => LocationProvider::CITY_NAME_KEY,
- 'location_latitude' => LocationProvider::LATITUDE_KEY,
- 'location_longitude' => LocationProvider::LONGITUDE_KEY,
- );
-
- foreach ($logVisitToLowerLocationMapping as $column => $locationKey) {
- if (!empty($location[$locationKey])) {
- $visitorInfo[$column] = strtolower($location[$locationKey]);
- }
- }
-
- foreach ($logVisitToLocationMapping as $column => $locationKey) {
- if (!empty($location[$locationKey])) {
- $visitorInfo[$column] = $location[$locationKey];
- }
- }
-
- // if the location has provider/organization info, set it
- if (!empty($location[LocationProvider::ISP_KEY])) {
- $providerValue = $location[LocationProvider::ISP_KEY];
-
- // if the org is set and not the same as the isp, add it to the provider value
- if (!empty($location[LocationProvider::ORG_KEY])
- && $location[LocationProvider::ORG_KEY] != $providerValue
- ) {
- $providerValue .= ' - ' . $location[LocationProvider::ORG_KEY];
- }
- } else if (!empty($location[LocationProvider::ORG_KEY])) {
- $providerValue = $location[LocationProvider::ORG_KEY];
- }
-
- if (isset($providerValue)
- && Manager::getInstance()->isPluginInstalled('Provider')) {
- $visitorInfo['location_provider'] = $providerValue;
- }
- }
-
- public function getSegmentsMetadata(&$segments)
- {
- $segments[] = array(
- 'type' => 'dimension',
- 'category' => 'Visit Location',
- 'name' => Piwik::translate('UserCountry_Country'),
- 'segment' => 'countryCode',
- 'sqlSegment' => 'log_visit.location_country',
- 'acceptedValues' => 'de, us, fr, in, es, etc.',
- );
- $segments[] = array(
- 'type' => 'dimension',
- 'category' => 'Visit Location',
- 'name' => Piwik::translate('UserCountry_Continent'),
- 'segment' => 'continentCode',
- 'sqlSegment' => 'log_visit.location_country',
- 'acceptedValues' => 'eur, asi, amc, amn, ams, afr, ant, oce',
- 'sqlFilter' => __NAMESPACE__ . '\UserCountry::getCountriesForContinent',
- );
- $segments[] = array(
- 'type' => 'dimension',
- 'category' => 'Visit Location',
- 'name' => Piwik::translate('UserCountry_Region'),
- 'segment' => 'regionCode',
- 'sqlSegment' => 'log_visit.location_region',
- 'acceptedValues' => '01 02, OR, P8, etc.<br/>eg. region=A1;country=fr',
- );
- $segments[] = array(
- 'type' => 'dimension',
- 'category' => 'Visit Location',
- 'name' => Piwik::translate('UserCountry_City'),
- 'segment' => 'city',
- 'sqlSegment' => 'log_visit.location_city',
- 'acceptedValues' => 'Sydney, Sao Paolo, Rome, etc.',
- );
- $segments[] = array(
- 'type' => 'dimension',
- 'category' => 'Visit Location',
- 'name' => Piwik::translate('UserCountry_Latitude'),
- 'segment' => 'latitude',
- 'sqlSegment' => 'log_visit.location_latitude',
- 'acceptedValues' => '-33.578, 40.830, etc.<br/>You can select visitors within a lat/long range using &segment=lat&gt;X;lat&lt;Y;long&gt;M;long&lt;N.',
- );
- $segments[] = array(
- 'type' => 'dimension',
- 'category' => 'Visit Location',
- 'name' => Piwik::translate('UserCountry_Longitude'),
- 'segment' => 'longitude',
- 'sqlSegment' => 'log_visit.location_longitude',
- 'acceptedValues' => '-70.664, 14.326, etc.',
- );
- }
-
- public function getReportMetadata(&$reports)
- {
- $metrics = array(
- 'nb_visits' => Piwik::translate('General_ColumnNbVisits'),
- 'nb_uniq_visitors' => Piwik::translate('General_ColumnNbUniqVisitors'),
- 'nb_actions' => Piwik::translate('General_ColumnNbActions'),
- );
-
- $reports[] = array(
- 'category' => Piwik::translate('General_Visitors'),
- 'name' => Piwik::translate('UserCountry_Country'),
- 'module' => 'UserCountry',
- 'action' => 'getCountry',
- 'dimension' => Piwik::translate('UserCountry_Country'),
- 'metrics' => $metrics,
- 'order' => 5,
- );
-
- $reports[] = array(
- 'category' => Piwik::translate('General_Visitors'),
- 'name' => Piwik::translate('UserCountry_Continent'),
- 'module' => 'UserCountry',
- 'action' => 'getContinent',
- 'dimension' => Piwik::translate('UserCountry_Continent'),
- 'metrics' => $metrics,
- 'order' => 6,
- );
-
- $reports[] = array(
- 'category' => Piwik::translate('General_Visitors'),
- 'name' => Piwik::translate('UserCountry_Region'),
- 'module' => 'UserCountry',
- 'action' => 'getRegion',
- 'dimension' => Piwik::translate('UserCountry_Region'),
- 'metrics' => $metrics,
- 'order' => 7,
- );
-
- $reports[] = array(
- 'category' => Piwik::translate('General_Visitors'),
- 'name' => Piwik::translate('UserCountry_City'),
- 'module' => 'UserCountry',
- 'action' => 'getCity',
- 'dimension' => Piwik::translate('UserCountry_City'),
- 'metrics' => $metrics,
- 'order' => 8,
- );
- }
-
- public function getReportsWithGoalMetrics(&$dimensions)
- {
- $dimensions = array_merge($dimensions, array(
- array('category' => Piwik::translate('General_Visit'),
- 'name' => Piwik::translate('UserCountry_Country'),
- 'module' => 'UserCountry',
- 'action' => 'getCountry',
- ),
- array('category' => Piwik::translate('General_Visit'),
- 'name' => Piwik::translate('UserCountry_Continent'),
- 'module' => 'UserCountry',
- 'action' => 'getContinent',
- ),
- array('category' => Piwik::translate('General_Visit'),
- 'name' => Piwik::translate('UserCountry_Region'),
- 'module' => 'UserCountry',
- 'action' => 'getRegion'),
- array('category' => Piwik::translate('General_Visit'),
- 'name' => Piwik::translate('UserCountry_City'),
- 'module' => 'UserCountry',
- 'action' => 'getCity'),
- ));
- }
-
/**
* Returns a list of country codes for a given continent code.
*
@@ -307,121 +79,6 @@ class UserCountry extends \Piwik\Plugin
'bind' => '-'); // HACK: SegmentExpression requires a $bind, even if there's nothing to bind
}
- public function configureViewDataTable(ViewDataTable $view)
- {
- switch ($view->requestConfig->apiMethodToRequestDataTable) {
- case 'UserCountry.getCountry':
- $this->configureViewForGetCountry($view);
- break;
- case 'UserCountry.getContinent':
- $this->configureViewForGetContinent($view);
- break;
- case 'UserCountry.getRegion':
- $this->configureViewForGetRegion($view);
- break;
- case 'UserCountry.getCity':
- $this->configureViewForGetCity($view);
- break;
- }
- }
-
- private function configureViewForGetCountry(ViewDataTable $view)
- {
- $view->config->show_goals = true;
- $view->config->show_exclude_low_population = false;
- $view->config->addTranslation('label', Piwik::translate('UserCountry_Country'));
- $view->config->documentation = Piwik::translate('UserCountry_getCountryDocumentation');
-
- $view->requestConfig->filter_limit = 5;
-
- if (LocationProvider::getCurrentProviderId() == DefaultProvider::ID) {
- // if we're using the default location provider, add a note explaining how it works
- $footerMessage = Piwik::translate("General_Note") . ': '
- . Piwik::translate('UserCountry_DefaultLocationProviderExplanation',
- array('<a target="_blank" href="http://piwik.org/docs/geo-locate/">', '</a>'));
-
- $view->config->show_footer_message = $footerMessage;
- }
- }
-
- private function configureViewForGetContinent(ViewDataTable $view)
- {
- $view->config->show_exclude_low_population = false;
- $view->config->show_goals = true;
- $view->config->show_search = false;
- $view->config->show_offset_information = false;
- $view->config->show_pagination_control = false;
- $view->config->show_limit_control = false;
- $view->config->documentation = Piwik::translate('UserCountry_getContinentDocumentation');
- $view->config->addTranslation('label', Piwik::translate('UserCountry_Continent'));
- }
-
- private function configureViewForGetRegion(ViewDataTable $view)
- {
- $view->config->show_exclude_low_population = false;
- $view->config->show_goals = true;
- $view->config->documentation = Piwik::translate('UserCountry_getRegionDocumentation') . '<br/>' . $this->getGeoIPReportDocSuffix();
- $view->config->addTranslation('label', Piwik::translate('UserCountry_Region'));
-
- $view->requestConfig->filter_limit = 5;
-
- $this->checkIfNoDataForGeoIpReport($view);
- }
-
- private function configureViewForGetCity(ViewDataTable $view)
- {
- $view->config->show_exclude_low_population = false;
- $view->config->show_goals = true;
- $view->config->documentation = Piwik::translate('UserCountry_getCityDocumentation') . '<br/>' . $this->getGeoIPReportDocSuffix();
- $view->config->addTranslation('label', Piwik::translate('UserCountry_City'));
-
- $view->requestConfig->filter_limit = 5;
-
- $this->checkIfNoDataForGeoIpReport($view);
- }
-
- private function getGeoIPReportDocSuffix()
- {
- return Piwik::translate('UserCountry_GeoIPDocumentationSuffix',
- array('<a target="_blank" href="http://www.maxmind.com/?rId=piwik">',
- '</a>',
- '<a target="_blank" href="http://www.maxmind.com/en/city_accuracy?rId=piwik">',
- '</a>')
- );
- }
-
- /**
- * Checks if a datatable for a view is empty and if so, displays a message in the footer
- * telling users to configure GeoIP.
- */
- private function checkIfNoDataForGeoIpReport(ViewDataTable $view)
- {
- $self = $this;
- $view->config->filters[] = function ($dataTable) use ($self, $view) {
- // if there's only one row whose label is 'Unknown', display a message saying there's no data
- if ($dataTable->getRowsCount() == 1
- && $dataTable->getFirstRow()->getColumn('label') == Piwik::translate('General_Unknown')
- ) {
- $footerMessage = Piwik::translate('UserCountry_NoDataForGeoIPReport1');
-
- // if GeoIP is working, don't display this part of the message
- if (!$self->isGeoIPWorking()) {
- $params = array('module' => 'UserCountry', 'action' => 'adminIndex');
- $footerMessage .= ' ' . Piwik::translate('UserCountry_NoDataForGeoIPReport2',
- array('<a target="_blank" href="' . Url::getCurrentQueryStringWithParametersModified($params) . '">',
- '</a>',
- '<a target="_blank" href="http://dev.maxmind.com/geoip/geolite?rId=piwik">',
- '</a>'));
- } else {
- $footerMessage .= ' ' . Piwik::translate('UserCountry_ToGeolocateOldVisits',
- array('<a target="_blank" href="http://piwik.org/faq/how-to/#faq_167">', '</a>'));
- }
-
- $view->config->show_footer_message = $footerMessage;
- }
- };
- }
-
/**
* Returns true if a GeoIP provider is installed & working, false if otherwise.
*
diff --git a/plugins/UserCountry/Widgets.php b/plugins/UserCountry/Widgets.php
deleted file mode 100644
index 6044e04e8c..0000000000
--- a/plugins/UserCountry/Widgets.php
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- *
- */
-namespace Piwik\Plugins\UserCountry;
-
-use Piwik\WidgetsList;
-use Piwik\Piwik;
-
-class Widgets extends \Piwik\Plugin\Widgets
-{
- public function configure(WidgetsList $widgetsList)
- {
- $widgetContinentLabel = Piwik::translate('UserCountry_WidgetLocation')
- . ' (' . Piwik::translate('UserCountry_Continent') . ')';
- $widgetCountryLabel = Piwik::translate('UserCountry_WidgetLocation')
- . ' (' . Piwik::translate('UserCountry_Country') . ')';
- $widgetRegionLabel = Piwik::translate('UserCountry_WidgetLocation')
- . ' (' . Piwik::translate('UserCountry_Region') . ')';
- $widgetCityLabel = Piwik::translate('UserCountry_WidgetLocation')
- . ' (' . Piwik::translate('UserCountry_City') . ')';
-
- $category = 'General_Visitors';
- $controller = 'UserCountry';
-
- WidgetsList::add($category, $widgetContinentLabel, $controller, 'getContinent');
- WidgetsList::add($category, $widgetCountryLabel, $controller, 'getCountry');
- WidgetsList::add($category, $widgetRegionLabel, $controller, 'getRegion');
- WidgetsList::add($category, $widgetCityLabel, $controller, 'getCity');
- }
-
-}
diff --git a/plugins/UserSettings/Columns/Browser.php b/plugins/UserSettings/Columns/Browser.php
new file mode 100644
index 0000000000..e3534b426e
--- /dev/null
+++ b/plugins/UserSettings/Columns/Browser.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugins\DevicesDetection\Columns\BrowserName;
+use Piwik\Plugins\UserSettings\Segment;
+
+class Browser extends BrowserName
+{
+ protected $fieldName = 'config_browser_name';
+ protected $fieldType = 'VARCHAR(10) NOT NULL';
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setSegment('browserCode');
+ $segment->setName('UserSettings_ColumnBrowser');
+ $segment->setAcceptedValues('FF, IE, CH, SF, OP, etc.');
+ $this->addSegment($segment);
+ }
+
+ public function getName()
+ {
+ return Piwik::translate('UserSettings_ColumnBrowser');
+ }
+} \ No newline at end of file
diff --git a/plugins/UserSettings/Columns/Browserfamily.php b/plugins/UserSettings/Columns/Browserfamily.php
new file mode 100644
index 0000000000..227a31dd4f
--- /dev/null
+++ b/plugins/UserSettings/Columns/Browserfamily.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+
+class BrowserFamily extends VisitDimension
+{
+ public function getName()
+ {
+ return Piwik::translate('UserSettings_ColumnBrowserFamily');
+ }
+} \ No newline at end of file
diff --git a/plugins/UserSettings/Columns/Browserversion.php b/plugins/UserSettings/Columns/Browserversion.php
new file mode 100644
index 0000000000..4decf25450
--- /dev/null
+++ b/plugins/UserSettings/Columns/Browserversion.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugins\UserSettings\Segment;
+
+class BrowserVersion extends \Piwik\Plugins\DevicesDetection\Columns\BrowserVersion
+{
+ protected $fieldName = 'config_browser_version';
+ protected $fieldType = 'VARCHAR(20) NOT NULL';
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setSegment('browserVersion');
+ $segment->setName('UserSettings_ColumnBrowserVersion');
+ $segment->setAcceptedValues('1.0, 8.0, etc.');
+ $this->addSegment($segment);
+ }
+
+ public function getName()
+ {
+ return Piwik::translate('UserSettings_ColumnBrowserVersion');
+ }
+} \ No newline at end of file
diff --git a/plugins/UserSettings/Columns/Configuration.php b/plugins/UserSettings/Columns/Configuration.php
new file mode 100644
index 0000000000..96f9053042
--- /dev/null
+++ b/plugins/UserSettings/Columns/Configuration.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+
+class Configuration extends VisitDimension
+{
+ public function getName()
+ {
+ return Piwik::translate('UserSettings_ColumnConfiguration');
+ }
+} \ No newline at end of file
diff --git a/plugins/UserSettings/Columns/Language.php b/plugins/UserSettings/Columns/Language.php
new file mode 100644
index 0000000000..a9997e806a
--- /dev/null
+++ b/plugins/UserSettings/Columns/Language.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+
+class Language extends VisitDimension
+{
+ protected $fieldName = 'location_browser_lang';
+ protected $fieldType = 'VARCHAR(20) NOT NULL';
+
+ public function getName()
+ {
+ return Piwik::translate('General_Language');
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ return substr($request->getBrowserLanguage(), 0, 20);
+ }
+} \ No newline at end of file
diff --git a/plugins/UserSettings/Columns/MobilevsDesktop.php b/plugins/UserSettings/Columns/MobilevsDesktop.php
new file mode 100644
index 0000000000..fdb0517588
--- /dev/null
+++ b/plugins/UserSettings/Columns/MobilevsDesktop.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+
+class MobilevsDesktop extends VisitDimension
+{
+ public function getName()
+ {
+ return Piwik::translate('UserSettings_MobileVsDesktop');
+ }
+} \ No newline at end of file
diff --git a/plugins/UserSettings/Columns/Operatingsystem.php b/plugins/UserSettings/Columns/Operatingsystem.php
new file mode 100644
index 0000000000..0a6d6770cf
--- /dev/null
+++ b/plugins/UserSettings/Columns/Operatingsystem.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugins\DevicesDetection\Columns\Os;
+use Piwik\Plugins\UserSettings\Segment;
+
+class Operatingsystem extends Os
+{
+ protected $fieldName = 'config_os';
+ protected $fieldType = 'CHAR(3) NOT NULL';
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setSegment('operatingSystemCode');
+ $segment->setName('UserSettings_ColumnOperatingSystem');
+ $segment->setAcceptedValues('WXP, WI7, MAC, LIN, AND, IPD, etc.');
+ $this->addSegment($segment);
+ }
+
+ public function getName()
+ {
+ return Piwik::translate('UserSettings_ColumnOperatingSystem');
+ }
+} \ No newline at end of file
diff --git a/plugins/UserSettings/Columns/Operatingsystemfamily.php b/plugins/UserSettings/Columns/Operatingsystemfamily.php
new file mode 100644
index 0000000000..b4c2d6640d
--- /dev/null
+++ b/plugins/UserSettings/Columns/Operatingsystemfamily.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+
+class OperatingsystemFamily extends VisitDimension
+{
+ public function getName()
+ {
+ return Piwik::translate('UserSettings_OperatingSystemFamily');
+ }
+} \ No newline at end of file
diff --git a/plugins/UserSettings/Columns/Plugin.php b/plugins/UserSettings/Columns/Plugin.php
new file mode 100644
index 0000000000..f6753cc5c9
--- /dev/null
+++ b/plugins/UserSettings/Columns/Plugin.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+
+class Plugin extends VisitDimension
+{
+ public function getName()
+ {
+ return Piwik::translate('General_Plugin');
+ }
+} \ No newline at end of file
diff --git a/plugins/UserSettings/Columns/PluginCookie.php b/plugins/UserSettings/Columns/PluginCookie.php
new file mode 100644
index 0000000000..653bd757da
--- /dev/null
+++ b/plugins/UserSettings/Columns/PluginCookie.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\Columns;
+
+use Piwik\Common;
+use Piwik\Plugin\VisitDimension;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+use Piwik\Tracker\Action;
+
+class PluginCookie extends VisitDimension
+{
+ protected $fieldName = 'config_cookie';
+ protected $fieldType = 'TINYINT(1) NOT NULL';
+
+ public function getName()
+ {
+ return '';
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ return Common::getRequestVar('cookie', 0, 'int', $request->getParams());
+ }
+} \ No newline at end of file
diff --git a/plugins/UserSettings/Columns/PluginDirector.php b/plugins/UserSettings/Columns/PluginDirector.php
new file mode 100644
index 0000000000..8e8ec9041b
--- /dev/null
+++ b/plugins/UserSettings/Columns/PluginDirector.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\Columns;
+
+use Piwik\Common;
+use Piwik\Plugin\VisitDimension;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+use Piwik\Tracker\Action;
+
+class PluginDirector extends VisitDimension
+{
+ protected $fieldName = 'config_director';
+ protected $fieldType = 'TINYINT(1) NOT NULL';
+
+ public function getName()
+ {
+ return '';
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ return Common::getRequestVar('dir', 0, 'int', $request->getParams());
+ }
+} \ No newline at end of file
diff --git a/plugins/UserSettings/Columns/PluginFlash.php b/plugins/UserSettings/Columns/PluginFlash.php
new file mode 100644
index 0000000000..b2b546704f
--- /dev/null
+++ b/plugins/UserSettings/Columns/PluginFlash.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\Columns;
+
+use Piwik\Common;
+use Piwik\Plugin\VisitDimension;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+use Piwik\Tracker\Action;
+
+class PluginFlash extends VisitDimension
+{
+ protected $fieldName = 'config_flash';
+ protected $fieldType = 'TINYINT(1) NOT NULL';
+
+ public function getName()
+ {
+ return '';
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ return Common::getRequestVar('fla', 0, 'int', $request->getParams());
+ }
+} \ No newline at end of file
diff --git a/plugins/UserSettings/Columns/PluginGears.php b/plugins/UserSettings/Columns/PluginGears.php
new file mode 100644
index 0000000000..46aee3d6b5
--- /dev/null
+++ b/plugins/UserSettings/Columns/PluginGears.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\Columns;
+
+use Piwik\Common;
+use Piwik\Plugin\VisitDimension;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+use Piwik\Tracker\Action;
+
+class PluginGears extends VisitDimension
+{
+ protected $fieldName = 'config_gears';
+ protected $fieldType = 'TINYINT(1) NOT NULL';
+
+ public function getName()
+ {
+ return '';
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ return Common::getRequestVar('gears', 0, 'int', $request->getParams());
+ }
+} \ No newline at end of file
diff --git a/plugins/UserSettings/Columns/PluginJava.php b/plugins/UserSettings/Columns/PluginJava.php
new file mode 100644
index 0000000000..1caf4845d3
--- /dev/null
+++ b/plugins/UserSettings/Columns/PluginJava.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\Columns;
+
+use Piwik\Common;
+use Piwik\Plugin\VisitDimension;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+use Piwik\Tracker\Action;
+
+class PluginJava extends VisitDimension
+{
+ protected $fieldName = 'config_java';
+ protected $fieldType = 'TINYINT(1) NOT NULL';
+
+ public function getName()
+ {
+ return '';
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ return Common::getRequestVar('java', 0, 'int', $request->getParams());
+ }
+} \ No newline at end of file
diff --git a/plugins/UserSettings/Columns/PluginPdf.php b/plugins/UserSettings/Columns/PluginPdf.php
new file mode 100644
index 0000000000..8270387b49
--- /dev/null
+++ b/plugins/UserSettings/Columns/PluginPdf.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\Columns;
+
+use Piwik\Common;
+use Piwik\Plugin\VisitDimension;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+use Piwik\Tracker\Action;
+
+class PluginPdf extends VisitDimension
+{
+ protected $fieldName = 'config_pdf';
+ protected $fieldType = 'TINYINT(1) NOT NULL';
+
+ public function getName()
+ {
+ return '';
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ return Common::getRequestVar('pdf', 0, 'int', $request->getParams());
+ }
+} \ No newline at end of file
diff --git a/plugins/UserSettings/Columns/PluginQuickTime.php b/plugins/UserSettings/Columns/PluginQuickTime.php
new file mode 100644
index 0000000000..dbb1ccb569
--- /dev/null
+++ b/plugins/UserSettings/Columns/PluginQuickTime.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\Columns;
+
+use Piwik\Common;
+use Piwik\Plugin\VisitDimension;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+use Piwik\Tracker\Action;
+
+class PluginQuickTime extends VisitDimension
+{
+ protected $fieldName = 'config_quicktime';
+ protected $fieldType = 'TINYINT(1) NOT NULL';
+
+ public function getName()
+ {
+ return '';
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ return Common::getRequestVar('qt', 0, 'int', $request->getParams());
+ }
+} \ No newline at end of file
diff --git a/plugins/UserSettings/Columns/PluginRealPlayer.php b/plugins/UserSettings/Columns/PluginRealPlayer.php
new file mode 100644
index 0000000000..66f2453e15
--- /dev/null
+++ b/plugins/UserSettings/Columns/PluginRealPlayer.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\Columns;
+
+use Piwik\Common;
+use Piwik\Plugin\VisitDimension;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+use Piwik\Tracker\Action;
+
+class PluginRealPlayer extends VisitDimension
+{
+ protected $fieldName = 'config_realplayer';
+ protected $fieldType = 'TINYINT(1) NOT NULL';
+
+ public function getName()
+ {
+ return '';
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ return Common::getRequestVar('realp', 0, 'int', $request->getParams());
+ }
+} \ No newline at end of file
diff --git a/plugins/UserSettings/Columns/PluginSilverlight.php b/plugins/UserSettings/Columns/PluginSilverlight.php
new file mode 100644
index 0000000000..7462b61933
--- /dev/null
+++ b/plugins/UserSettings/Columns/PluginSilverlight.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\Columns;
+
+use Piwik\Common;
+use Piwik\Plugin\VisitDimension;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+use Piwik\Tracker\Action;
+
+class PluginSilverlight extends VisitDimension
+{
+ protected $fieldName = 'config_silverlight';
+ protected $fieldType = 'TINYINT(1) NOT NULL';
+
+ public function getName()
+ {
+ return '';
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ return Common::getRequestVar('ag', 0, 'int', $request->getParams());
+ }
+} \ No newline at end of file
diff --git a/plugins/UserSettings/Columns/PluginWindowsMedia.php b/plugins/UserSettings/Columns/PluginWindowsMedia.php
new file mode 100644
index 0000000000..2879a7cbce
--- /dev/null
+++ b/plugins/UserSettings/Columns/PluginWindowsMedia.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\Columns;
+
+use Piwik\Common;
+use Piwik\Plugin\VisitDimension;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+use Piwik\Tracker\Action;
+
+class PluginWindowsMedia extends VisitDimension
+{
+ protected $fieldName = 'config_windowsmedia';
+ protected $fieldType = 'TINYINT(1) NOT NULL';
+
+ public function getName()
+ {
+ return '';
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ return Common::getRequestVar('wma', 0, 'int', $request->getParams());
+ }
+} \ No newline at end of file
diff --git a/plugins/UserSettings/Columns/Resolution.php b/plugins/UserSettings/Columns/Resolution.php
new file mode 100644
index 0000000000..19bf2a1ee5
--- /dev/null
+++ b/plugins/UserSettings/Columns/Resolution.php
@@ -0,0 +1,53 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+use Piwik\Plugins\UserSettings\Segment;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+
+class Resolution extends VisitDimension
+{
+ protected $fieldName = 'config_resolution';
+ protected $fieldType = 'VARCHAR(9) NOT NULL';
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setSegment('resolution');
+ $segment->setName('UserSettings_ColumnResolution');
+ $segment->setAcceptedValues('1280x1024, 800x600, etc.');
+ $this->addSegment($segment);
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ $resolution = $request->getParam('res');
+
+ if (!empty($resolution)) {
+ return substr($resolution, 0, 9);
+ }
+
+ return $resolution;
+ }
+
+ public function getName()
+ {
+ return Piwik::translate('UserSettings_ColumnResolution');
+ }
+} \ No newline at end of file
diff --git a/plugins/UserSettings/Columns/Typeofscreen.php b/plugins/UserSettings/Columns/Typeofscreen.php
new file mode 100644
index 0000000000..a042d2323d
--- /dev/null
+++ b/plugins/UserSettings/Columns/Typeofscreen.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+
+class TypeOfScreen extends VisitDimension
+{
+ public function getName()
+ {
+ return Piwik::translate('UserSettings_ColumnTypeOfScreen');
+ }
+} \ No newline at end of file
diff --git a/plugins/UserSettings/Reports/Base.php b/plugins/UserSettings/Reports/Base.php
new file mode 100644
index 0000000000..bfa11a78c3
--- /dev/null
+++ b/plugins/UserSettings/Reports/Base.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\Reports;
+
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\CoreVisualizations\Visualizations\Graph;
+
+abstract class Base extends \Piwik\Plugin\Report
+{
+ protected function init()
+ {
+ $this->category = 'UserSettings_VisitorSettings';
+ }
+
+ protected function getBasicUserSettingsDisplayProperties(ViewDataTable $view)
+ {
+ $view->config->show_search = false;
+ $view->config->show_exclude_low_population = false;
+
+ $view->requestConfig->filter_limit = 5;
+
+ if ($view->isViewDataTableId(Graph::ID)) {
+ $view->config->max_graph_elements = 5;
+ }
+ }
+}
diff --git a/plugins/UserSettings/Reports/GetBrowser.php b/plugins/UserSettings/Reports/GetBrowser.php
new file mode 100644
index 0000000000..b0a169bf9a
--- /dev/null
+++ b/plugins/UserSettings/Reports/GetBrowser.php
@@ -0,0 +1,46 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\CoreVisualizations\Visualizations\Graph;
+use Piwik\Plugins\UserSettings\Columns\Browser;
+
+class GetBrowser extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new Browser();
+ $this->name = Piwik::translate('UserSettings_WidgetBrowsers');
+ $this->documentation = Piwik::translate('UserSettings_WidgetBrowsersDocumentation', '<br />');
+ $this->order = 1;
+ $this->widgetTitle = 'UserSettings_WidgetBrowsers';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $this->getBasicUserSettingsDisplayProperties($view);
+
+ $view->config->title = Piwik::translate('UserSettings_Browsers');
+ $view->config->addTranslation('label', $this->dimension->getName());
+
+ if ($view->isViewDataTableId(Graph::ID)) {
+ $view->config->max_graph_elements = 7;
+ }
+ }
+
+ public function getRelatedReports()
+ {
+ return array(
+ new GetBrowserVersion()
+ );
+ }
+}
diff --git a/plugins/UserSettings/Reports/GetBrowserType.php b/plugins/UserSettings/Reports/GetBrowserType.php
new file mode 100644
index 0000000000..063abab7ce
--- /dev/null
+++ b/plugins/UserSettings/Reports/GetBrowserType.php
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\CoreVisualizations\Visualizations\JqplotGraph\Pie;
+use Piwik\Plugins\UserSettings\Columns\BrowserFamily;
+
+class GetBrowserType extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new BrowserFamily();
+ $this->name = Piwik::translate('UserSettings_WidgetBrowserFamilies');
+ $this->documentation = Piwik::translate('UserSettings_WidgetBrowserFamiliesDocumentation', '<br />');
+ $this->order = 3;
+ $this->widgetTitle = 'UserSettings_WidgetBrowserFamilies';
+ }
+
+ public function getDefaultTypeViewDataTable()
+ {
+ return Pie::ID;
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $this->getBasicUserSettingsDisplayProperties($view);
+
+ $view->config->addTranslation('label', $this->dimension->getName());
+ $view->config->show_offset_information = false;
+ $view->config->show_pagination_control = false;
+ $view->config->show_limit_control = false;
+ }
+
+}
diff --git a/plugins/UserSettings/Reports/GetBrowserVersion.php b/plugins/UserSettings/Reports/GetBrowserVersion.php
new file mode 100644
index 0000000000..31cb0a74c7
--- /dev/null
+++ b/plugins/UserSettings/Reports/GetBrowserVersion.php
@@ -0,0 +1,47 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\CoreVisualizations\Visualizations\Graph;
+use Piwik\Plugins\UserSettings\Columns\BrowserVersion;
+
+class GetBrowserVersion extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new BrowserVersion();
+ $this->name = Piwik::translate('UserSettings_WidgetBrowserVersion');
+ $this->documentation = ''; // TODO
+ $this->order = 2;
+ $this->widgetTitle = 'UserSettings_WidgetBrowserVersion';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $this->getBasicUserSettingsDisplayProperties($view);
+
+ $view->config->title = Piwik::translate('UserSettings_ColumnBrowserVersion');
+ $view->config->addTranslation('label', $this->dimension->getName());
+
+ if ($view->isViewDataTableId(Graph::ID)) {
+ $view->config->max_graph_elements = 7;
+ }
+ }
+
+ public function getRelatedReports()
+ {
+ return array(
+ new GetBrowser()
+ );
+ }
+
+}
diff --git a/plugins/UserSettings/Reports/GetConfiguration.php b/plugins/UserSettings/Reports/GetConfiguration.php
new file mode 100644
index 0000000000..89000e75ae
--- /dev/null
+++ b/plugins/UserSettings/Reports/GetConfiguration.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\UserSettings\Columns\Configuration;
+
+class GetConfiguration extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new Configuration();
+ $this->name = Piwik::translate('UserSettings_WidgetGlobalVisitors');
+ $this->documentation = Piwik::translate('UserSettings_WidgetGlobalVisitorsDocumentation', '<br />');
+ $this->order = 7;
+ $this->widgetTitle = 'UserSettings_WidgetGlobalVisitors';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $this->getBasicUserSettingsDisplayProperties($view);
+
+ $view->config->addTranslation('label', $this->dimension->getName());
+
+ $view->requestConfig->filter_limit = 3;
+ }
+
+}
diff --git a/plugins/UserSettings/Reports/GetLanguage.php b/plugins/UserSettings/Reports/GetLanguage.php
new file mode 100644
index 0000000000..3c479f8bc8
--- /dev/null
+++ b/plugins/UserSettings/Reports/GetLanguage.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\UserSettings\Columns\Language;
+
+class GetLanguage extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new Language();
+ $this->name = Piwik::translate('UserSettings_BrowserLanguage');
+ $this->documentation = ''; // TODO
+ $this->order = 10;
+ $this->widgetTitle = 'UserSettings_BrowserLanguage';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->config->show_search = false;
+ $view->config->columns_to_display = array('label', 'nb_visits');
+ $view->config->show_exclude_low_population = false;
+ $view->config->addTranslation('label', $this->dimension->getName());
+
+ $view->requestConfig->filter_sort_column = 'nb_visits';
+ $view->requestConfig->filter_sort_order = 'desc';
+ }
+
+}
diff --git a/plugins/UserSettings/Reports/GetMobileVsDesktop.php b/plugins/UserSettings/Reports/GetMobileVsDesktop.php
new file mode 100644
index 0000000000..4eb06d5b26
--- /dev/null
+++ b/plugins/UserSettings/Reports/GetMobileVsDesktop.php
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\UserSettings\Columns\MobilevsDesktop;
+
+class GetMobileVsDesktop extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new MobilevsDesktop();
+ $this->name = Piwik::translate('UserSettings_MobileVsDesktop');
+ $this->documentation = ''; // TODO
+ $this->constantRowsCount = true;
+ $this->order = 9;
+ $this->widgetTitle = 'UserSettings_MobileVsDesktop';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $this->getBasicUserSettingsDisplayProperties($view);
+
+ $view->config->title = Piwik::translate('UserSettings_MobileVsDesktop');
+ $view->config->addTranslation('label', $this->dimension->getName());
+ }
+
+ public function getRelatedReports()
+ {
+ return array(
+ new GetWideScreen()
+ );
+ }
+
+}
diff --git a/plugins/UserSettings/Reports/GetOS.php b/plugins/UserSettings/Reports/GetOS.php
new file mode 100644
index 0000000000..d42793630e
--- /dev/null
+++ b/plugins/UserSettings/Reports/GetOS.php
@@ -0,0 +1,41 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\UserSettings\Columns\Operatingsystem;
+
+class GetOS extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new Operatingsystem();
+ $this->name = Piwik::translate('UserSettings_WidgetOperatingSystems');
+ $this->documentation = ''; // TODO
+ $this->order = 6;
+ $this->widgetTitle = 'UserSettings_WidgetOperatingSystems';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $this->getBasicUserSettingsDisplayProperties($view);
+
+ $view->config->title = Piwik::translate('UserSettings_OperatingSystems');
+ $view->config->addTranslation('label', $this->dimension->getName());
+ }
+
+ public function getRelatedReports()
+ {
+ return array(
+ new GetOSFamily()
+ );
+ }
+}
diff --git a/plugins/UserSettings/Reports/GetOSFamily.php b/plugins/UserSettings/Reports/GetOSFamily.php
new file mode 100644
index 0000000000..c1c112d71c
--- /dev/null
+++ b/plugins/UserSettings/Reports/GetOSFamily.php
@@ -0,0 +1,42 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\UserSettings\Columns\OperatingsystemFamily;
+
+class GetOSFamily extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new OperatingsystemFamily();
+ $this->name = Piwik::translate('UserSettings_OperatingSystemFamily');
+ $this->documentation = ''; // TODO
+ $this->order = 8;
+ $this->widgetTitle = 'UserSettings_OperatingSystemFamily';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $this->getBasicUserSettingsDisplayProperties($view);
+
+ $view->config->title = $this->name;
+ $view->config->addTranslation('label', $this->dimension->getName());
+ }
+
+ public function getRelatedReports()
+ {
+ return array(
+ new GetOS()
+ );
+ }
+
+}
diff --git a/plugins/UserSettings/Reports/GetPlugin.php b/plugins/UserSettings/Reports/GetPlugin.php
new file mode 100644
index 0000000000..938d3e4390
--- /dev/null
+++ b/plugins/UserSettings/Reports/GetPlugin.php
@@ -0,0 +1,53 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\UserSettings\Columns\Plugin;
+
+class GetPlugin extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new Plugin();
+ $this->name = Piwik::translate('UserSettings_WidgetPlugins');
+ $this->documentation = Piwik::translate('UserSettings_WidgetPluginsDocumentation', '<br />');
+ $this->metrics = array('nb_visits', 'nb_visits_percentage');
+ $this->constantRowsCount = true;
+ $this->processedMetrics = array();
+ $this->order = 4;
+ $this->widgetTitle = 'UserSettings_WidgetPlugins';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $this->getBasicUserSettingsDisplayProperties($view);
+
+ $view->config->addTranslations(array(
+ 'label' => $this->dimension->getName(),
+ 'nb_visits_percentage' =>
+ str_replace(' ', '&nbsp;', Piwik::translate('General_ColumnPercentageVisits'))
+ ));
+
+ $view->config->show_offset_information = false;
+ $view->config->show_pagination_control = false;
+ $view->config->show_limit_control = false;
+ $view->config->show_all_views_icons = false;
+ $view->config->show_table_all_columns = false;
+ $view->config->columns_to_display = array('label', 'nb_visits_percentage', 'nb_visits');
+ $view->config->show_footer_message = Piwik::translate('UserSettings_PluginDetectionDoesNotWorkInIE');
+
+ $view->requestConfig->filter_sort_column = 'nb_visits_percentage';
+ $view->requestConfig->filter_sort_order = 'desc';
+ $view->requestConfig->filter_limit = 10;
+ }
+
+}
diff --git a/plugins/UserSettings/Reports/GetResolution.php b/plugins/UserSettings/Reports/GetResolution.php
new file mode 100644
index 0000000000..c61126614a
--- /dev/null
+++ b/plugins/UserSettings/Reports/GetResolution.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\UserSettings\Columns\Resolution;
+
+class GetResolution extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new Resolution();
+ $this->name = Piwik::translate('UserSettings_WidgetResolutions');
+ $this->documentation = ''; // TODO
+ $this->order = 0;
+ $this->widgetTitle = 'UserSettings_WidgetResolutions';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $this->getBasicUserSettingsDisplayProperties($view);
+
+ $view->config->addTranslation('label', $this->dimension->getName());
+ }
+
+}
diff --git a/plugins/UserSettings/Reports/GetWideScreen.php b/plugins/UserSettings/Reports/GetWideScreen.php
new file mode 100644
index 0000000000..23b6547613
--- /dev/null
+++ b/plugins/UserSettings/Reports/GetWideScreen.php
@@ -0,0 +1,44 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\UserSettings\Columns\TypeOfScreen;
+
+class GetWideScreen extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new TypeOfScreen();
+ $this->name = Piwik::translate('UserSettings_WidgetWidescreen');
+ $this->documentation = ''; // TODO
+ $this->order = 5;
+ $this->widgetTitle = 'UserSettings_WidgetWidescreen';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $this->getBasicUserSettingsDisplayProperties($view);
+
+ $view->config->title = Piwik::translate('UserSettings_ColumnTypeOfScreen');
+ $view->config->show_offset_information = false;
+ $view->config->show_pagination_control = false;
+ $view->config->show_limit_control = false;
+ $view->config->addTranslation('label', $this->dimension->getName());
+ }
+
+ public function getRelatedReports()
+ {
+ return array(
+ new GetMobileVsDesktop()
+ );
+ }
+}
diff --git a/plugins/UserSettings/Segment.php b/plugins/UserSettings/Segment.php
new file mode 100644
index 0000000000..8cbd4b8b5a
--- /dev/null
+++ b/plugins/UserSettings/Segment.php
@@ -0,0 +1,21 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings;
+
+/**
+ * UserSettings segment base class.
+ *
+ */
+class Segment extends \Piwik\Plugin\Segment
+{
+ protected function init()
+ {
+ $this->setCategory('General_Visit');
+ }
+}
diff --git a/plugins/UserSettings/UserSettings.php b/plugins/UserSettings/UserSettings.php
index 5da8af6c69..69f9b6519e 100644
--- a/plugins/UserSettings/UserSettings.php
+++ b/plugins/UserSettings/UserSettings.php
@@ -9,10 +9,8 @@
namespace Piwik\Plugins\UserSettings;
use Piwik\Piwik;
-use Piwik\Plugin\ViewDataTable;
use Piwik\Plugins\CoreVisualizations\Visualizations\Graph;
use Piwik\Plugins\CoreVisualizations\Visualizations\HtmlTable;
-use Piwik\Plugins\CoreVisualizations\Visualizations\JqplotGraph\Pie;
/**
*
@@ -33,417 +31,22 @@ class UserSettings extends \Piwik\Plugin
);
/**
- * Defines API reports.
- * Also used to define Widgets.
- *
- * @type array
- *
- * Category, Report Name, API Module, API action, Translated column name,
- * $segment, $sqlSegment, $acceptedValues, $sqlFilter
- */
- protected $reportMetadata = array(
- array('UserSettings_VisitorSettings',
- 'UserSettings_WidgetResolutions',
- 'UserSettings',
- 'getResolution',
- 'UserSettings_ColumnResolution',
- 'resolution',
- 'log_visit.config_resolution',
- '1280x1024, 800x600, etc.',
- null),
-
- array('UserSettings_VisitorSettings',
- 'UserSettings_WidgetBrowsers',
- 'UserSettings',
- 'getBrowser',
- 'UserSettings_ColumnBrowser',
- 'browserCode',
- 'log_visit.config_browser_name',
- 'FF, IE, CH, SF, OP, etc.',
- null),
-
- // browser version
- array('UserSettings_VisitorSettings',
- 'UserSettings_WidgetBrowserVersion',
- 'UserSettings',
- 'getBrowserVersion',
- 'UserSettings_ColumnBrowserVersion',
- 'browserVersion',
- 'log_visit.config_browser_version',
- '1.0, 8.0, etc.',
- null),
-
- array('UserSettings_VisitorSettings',
- 'UserSettings_WidgetBrowserFamilies',
- 'UserSettings',
- 'getBrowserType',
- 'UserSettings_ColumnBrowserFamily',
- null,
- null,
- null,
- null),
-
- array('UserSettings_VisitorSettings',
- 'UserSettings_WidgetPlugins',
- 'UserSettings',
- 'getPlugin',
- 'General_Plugin',
- null,
- null,
- null,
- null),
-
- array('UserSettings_VisitorSettings',
- 'UserSettings_WidgetWidescreen',
- 'UserSettings',
- 'getWideScreen',
- 'UserSettings_ColumnTypeOfScreen',
- null,
- null,
- null,
- null),
-
- array('UserSettings_VisitorSettings',
- 'UserSettings_WidgetOperatingSystems',
- 'UserSettings',
- 'getOS',
- 'UserSettings_ColumnOperatingSystem',
- 'operatingSystemCode',
- 'log_visit.config_os',
- 'WXP, WI7, MAC, LIN, AND, IPD, etc.',
- null),
-
- array('UserSettings_VisitorSettings',
- 'UserSettings_WidgetGlobalVisitors',
- 'UserSettings',
- 'getConfiguration',
- 'UserSettings_ColumnConfiguration',
- null,
- null,
- null,
- null),
-
- // operating system family
- array('UserSettings_VisitorSettings',
- 'UserSettings_OperatingSystemFamily',
- 'UserSettings',
- 'getOSFamily',
- 'UserSettings_OperatingSystemFamily',
- null,
- null,
- null,
- null),
-
- // device type
- array('UserSettings_VisitorSettings',
- 'UserSettings_MobileVsDesktop',
- 'UserSettings',
- 'getMobileVsDesktop',
- 'UserSettings_MobileVsDesktop',
- null,
- null,
- null,
- null),
-
- // Browser language
- array('UserSettings_VisitorSettings',
- 'UserSettings_BrowserLanguage',
- 'UserSettings',
- 'getLanguage',
- 'General_Language',
- null,
- null,
- null,
- null),
- );
-
- /**
* @see Piwik\Plugin::getListHooksRegistered
*/
public function getListHooksRegistered()
{
- $hooks = array(
- 'API.getReportMetadata' => 'getReportMetadata',
- 'API.getSegmentDimensionMetadata' => 'getSegmentsMetadata',
- 'ViewDataTable.configure' => 'configureViewDataTable',
- 'ViewDataTable.getDefaultType' => 'getDefaultTypeViewDataTable'
- );
- return $hooks;
- }
-
- public function getDefaultTypeViewDataTable(&$defaultViewTypes)
- {
- $defaultViewTypes['UserSettings.getBrowserType'] = Pie::ID;
- }
-
- public function configureViewDataTable(ViewDataTable $view)
- {
- switch ($view->requestConfig->apiMethodToRequestDataTable) {
- case 'UserSettings.getResolution':
- $this->configureViewForGetResolution($view);
- break;
- case 'UserSettings.getConfiguration':
- $this->configureViewForGetConfiguration($view);
- break;
- case 'UserSettings.getOS':
- $this->configureViewForGetOS($view);
- break;
- case 'UserSettings.getOSFamily':
- $this->configureViewForGetOSFamily($view);
- break;
- case 'UserSettings.getBrowserVersion':
- $this->configureViewForGetBrowserVersion($view);
- break;
- case 'UserSettings.getBrowser':
- $this->configureViewForGetBrowser($view);
- break;
- case 'UserSettings.getBrowserType':
- $this->configureViewForGetBrowserType($view);
- break;
- case 'UserSettings.getWideScreen':
- $this->configureViewForGetWideScreen($view);
- break;
- case 'UserSettings.getMobileVsDesktop':
- $this->configureViewForGetMobileVsDesktop($view);
- break;
- case 'UserSettings.getPlugin':
- $this->configureViewForGetPlugin($view);
- break;
- case 'UserSettings.getLanguage':
- $this->configureViewForGetLanguage($view);
- break;
- }
- }
-
- private function configureViewForGetResolution(ViewDataTable $view)
- {
- $this->getBasicUserSettingsDisplayProperties($view);
-
- $view->config->addTranslation('label', Piwik::translate('UserSettings_ColumnResolution'));
- }
-
- private function configureViewForGetConfiguration(ViewDataTable $view)
- {
- $this->getBasicUserSettingsDisplayProperties($view);
-
- $view->config->addTranslation('label', Piwik::translate('UserSettings_ColumnConfiguration'));
-
- $view->requestConfig->filter_limit = 3;
- }
-
- private function configureViewForGetOS(ViewDataTable $view)
- {
- $this->getBasicUserSettingsDisplayProperties($view);
-
- $view->config->title = Piwik::translate('UserSettings_OperatingSystems');
- $view->config->addTranslation('label', Piwik::translate('UserSettings_ColumnOperatingSystem'));
- $view->config->addRelatedReports($this->getOsRelatedReports());
- }
-
- private function configureViewForGetOSFamily(ViewDataTable $view)
- {
- $this->getBasicUserSettingsDisplayProperties($view);
-
- $view->config->title = Piwik::translate('UserSettings_OperatingSystemFamily');
- $view->config->addTranslation('label', Piwik::translate('UserSettings_OperatingSystemFamily'));
- $view->config->addRelatedReports($this->getOsRelatedReports());
- }
-
- private function configureViewForGetBrowserVersion(ViewDataTable $view)
- {
- $this->getBasicUserSettingsDisplayProperties($view);
-
- $view->config->title = Piwik::translate('UserSettings_ColumnBrowserVersion');
- $view->config->addTranslation('label', Piwik::translate('UserSettings_ColumnBrowserVersion'));
- $view->config->addRelatedReports($this->getBrowserRelatedReports());
-
- if ($view->isViewDataTableId(Graph::ID)) {
- $view->config->max_graph_elements = 7;
- }
- }
-
- private function configureViewForGetBrowser(ViewDataTable $view)
- {
- $this->getBasicUserSettingsDisplayProperties($view);
-
- $view->config->title = Piwik::translate('UserSettings_Browsers');
- $view->config->addTranslation('label', Piwik::translate('UserSettings_ColumnBrowser'));
- $view->config->addRelatedReports($this->getBrowserRelatedReports());
-
- if ($view->isViewDataTableId(Graph::ID)) {
- $view->config->max_graph_elements = 7;
- }
- }
-
- private function configureViewForGetBrowserType(ViewDataTable $view)
- {
- $this->getBasicUserSettingsDisplayProperties($view);
-
- $view->config->addTranslation('label', Piwik::translate('UserSettings_ColumnBrowserFamily'));
- $view->config->show_offset_information = false;
- $view->config->show_pagination_control = false;
- $view->config->show_limit_control = false;
- }
-
- private function configureViewForGetWideScreen(ViewDataTable $view)
- {
- $this->getBasicUserSettingsDisplayProperties($view);
-
- $view->config->title = Piwik::translate('UserSettings_ColumnTypeOfScreen');
- $view->config->show_offset_information = false;
- $view->config->show_pagination_control = false;
- $view->config->show_limit_control = false;
- $view->config->addTranslation('label', Piwik::translate('UserSettings_ColumnTypeOfScreen'));
- $view->config->addRelatedReports($this->getWideScreenDeviceTypeRelatedReports());
- }
-
- private function configureViewForGetMobileVsDesktop(ViewDataTable $view)
- {
- $this->getBasicUserSettingsDisplayProperties($view);
-
- $view->config->title = Piwik::translate('UserSettings_MobileVsDesktop');
- $view->config->addTranslation('label', Piwik::translate('UserSettings_MobileVsDesktop'));
- $view->config->addRelatedReports($this->getWideScreenDeviceTypeRelatedReports());
- }
-
- private function configureViewForGetPlugin(ViewDataTable $view)
- {
- $this->getBasicUserSettingsDisplayProperties($view);
-
- $view->config->addTranslations(array(
- 'label' => Piwik::translate('General_Plugin'),
- 'nb_visits_percentage' =>
- str_replace(' ', '&nbsp;', Piwik::translate('General_ColumnPercentageVisits'))
- ));
-
- $view->config->show_offset_information = false;
- $view->config->show_pagination_control = false;
- $view->config->show_limit_control = false;
- $view->config->show_all_views_icons = false;
- $view->config->show_table_all_columns = false;
- $view->config->columns_to_display = array('label', 'nb_visits_percentage', 'nb_visits');
- $view->config->show_footer_message = Piwik::translate('UserSettings_PluginDetectionDoesNotWorkInIE');
-
- $view->requestConfig->filter_sort_column = 'nb_visits_percentage';
- $view->requestConfig->filter_sort_order = 'desc';
- $view->requestConfig->filter_limit = 10;
- }
-
- private function configureViewForGetLanguage(ViewDataTable $view)
- {
- $view->config->show_search = false;
- $view->config->columns_to_display = array('label', 'nb_visits');
- $view->config->show_exclude_low_population = false;
- $view->config->addTranslation('label', Piwik::translate('General_Language'));
-
- $view->requestConfig->filter_sort_column = 'nb_visits';
- $view->requestConfig->filter_sort_order = 'desc';
- }
-
- private function getWideScreenDeviceTypeRelatedReports()
- {
- return array(
- 'UserSettings.getMobileVsDesktop' => Piwik::translate('UserSettings_MobileVsDesktop'),
- 'UserSettings.getWideScreen' => Piwik::translate('UserSettings_ColumnTypeOfScreen')
- );
- }
-
- private function getBrowserRelatedReports()
- {
return array(
- 'UserSettings.getBrowser' => Piwik::translate('UserSettings_Browsers'),
- 'UserSettings.getBrowserVersion' => Piwik::translate('UserSettings_ColumnBrowserVersion')
+ 'Metrics.getDefaultMetricTranslations' => 'addMetricTranslations'
);
}
- private function getOsRelatedReports()
+ public function addMetricTranslations(&$translations)
{
- return array(
- 'UserSettings.getOSFamily' => Piwik::translate('UserSettings_OperatingSystemFamily'),
- 'UserSettings.getOS' => Piwik::translate('UserSettings_OperatingSystems')
+ $metrics = array(
+ 'nb_visits_percentage' => Piwik::translate('General_ColumnPercentageVisits')
);
- }
-
- private function getBasicUserSettingsDisplayProperties(ViewDataTable $view)
- {
- $view->config->show_search = false;
- $view->config->show_exclude_low_population = false;
-
- $view->requestConfig->filter_limit = 5;
-
- if ($view->isViewDataTableId(Graph::ID)) {
- $view->config->max_graph_elements = 5;
- }
- }
-
- public function getRawReportMetadata()
- {
- return $this->reportMetadata;
- }
- /**
- * Registers reports metadata
- *
- * @param array $reports
- */
- public function getReportMetadata(&$reports)
- {
- $i = 0;
- foreach ($this->getRawReportMetadata() as $report) {
- list($category, $name, $apiModule, $apiAction, $columnName) = $report;
- if ($category == false) continue;
-
- $report = array(
- 'category' => Piwik::translate($category),
- 'name' => Piwik::translate($name),
- 'module' => $apiModule,
- 'action' => $apiAction,
- 'dimension' => Piwik::translate($columnName),
- 'order' => $i++
- );
-
- $translation = $name . 'Documentation';
- $translated = Piwik::translate($translation, '<br />');
- if ($translated != $translation) {
- $report['documentation'] = $translated;
- }
-
- if ($apiAction == 'getMobileVsDesktop') {
- $report['constantRowsCount'] = true;
- }
-
- // getPlugin returns only a subset of metrics
- if ($apiAction == 'getPlugin') {
- $report['metrics'] = array(
- 'nb_visits',
- 'nb_visits_percentage' => Piwik::translate('General_ColumnPercentageVisits')
- );
- // There is no processedMetrics for this report
- $report['processedMetrics'] = array();
- // Always has same number of rows, 1 per plugin
- $report['constantRowsCount'] = true;
- }
- $reports[] = $report;
- }
- }
-
- /**
- * Get segments meta data
- */
- public function getSegmentsMetadata(&$segments)
- {
- foreach ($this->reportMetadata as $report) {
- @list($category, $name, $apiModule, $apiAction, $columnName, $segment, $sqlSegment, $acceptedValues) = $report;
- if (empty($segment)) continue;
- $segments[] = array(
- 'type' => 'dimension',
- 'category' => Piwik::translate('General_Visit'),
- 'name' => $columnName,
- 'segment' => $segment,
- 'acceptedValues' => $acceptedValues,
- 'sqlSegment' => $sqlSegment
- );
- }
+ $translations = array_merge($translations, $metrics);
}
}
diff --git a/plugins/UserSettings/Widgets.php b/plugins/UserSettings/Widgets.php
deleted file mode 100644
index 36099b5149..0000000000
--- a/plugins/UserSettings/Widgets.php
+++ /dev/null
@@ -1,30 +0,0 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- *
- */
-namespace Piwik\Plugins\UserSettings;
-
-use Piwik\WidgetsList;
-
-class Widgets extends \Piwik\Plugin\Widgets
-{
- public function configure(WidgetsList $widgetsList)
- {
- $userSettings = new UserSettings();
-
- foreach ($userSettings->getRawReportMetadata() as $report) {
- list($category, $name, $controllerName, $controllerAction) = $report;
-
- if ($category == false) {
- continue;
- }
-
- $widgetsList->add($category, $name, $controllerName, $controllerAction);
- }
- }
-
-}
diff --git a/plugins/VisitFrequency/Reports/Get.php b/plugins/VisitFrequency/Reports/Get.php
new file mode 100644
index 0000000000..624d8440e1
--- /dev/null
+++ b/plugins/VisitFrequency/Reports/Get.php
@@ -0,0 +1,25 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\VisitFrequency\Reports;
+
+use Piwik\Piwik;
+
+class Get extends \Piwik\Plugin\Report
+{
+ protected function init()
+ {
+ parent::init();
+ $this->category = 'General_Visitors';
+ $this->name = Piwik::translate('VisitFrequency_ColumnReturningVisits');
+ $this->documentation = ''; // TODO
+ $this->metrics = array('nb_visits_returning', 'nb_actions_returning', 'avg_time_on_site_returning', 'bounce_rate_returning', 'nb_actions_per_visit_returning', 'nb_uniq_visitors_returning');
+ $this->processedMetrics = false;
+ $this->order = 40;
+ }
+}
diff --git a/plugins/VisitFrequency/VisitFrequency.php b/plugins/VisitFrequency/VisitFrequency.php
index f3dcf598b6..1666edd0dc 100644
--- a/plugins/VisitFrequency/VisitFrequency.php
+++ b/plugins/VisitFrequency/VisitFrequency.php
@@ -9,10 +9,9 @@
namespace Piwik\Plugins\VisitFrequency;
use Piwik\Piwik;
+use Piwik\Plugins\CoreVisualizations\Visualizations\Graph;
+use Piwik\Plugins\CoreVisualizations\Visualizations\HtmlTable;
-/**
- *
- */
class VisitFrequency extends \Piwik\Plugin
{
/**
@@ -20,34 +19,23 @@ class VisitFrequency extends \Piwik\Plugin
*/
public function getListHooksRegistered()
{
- $hooks = array(
- 'API.getReportMetadata' => 'getReportMetadata',
+ return array(
+ 'Metrics.getDefaultMetricTranslations' => 'addMetricTranslations'
);
- return $hooks;
}
- public function getReportMetadata(&$reports)
+ public function addMetricTranslations(&$translations)
{
- $reports[] = array(
- 'category' => Piwik::translate('General_Visitors'),
- 'name' => Piwik::translate('VisitFrequency_ColumnReturningVisits'),
- 'module' => 'VisitFrequency',
- 'action' => 'get',
- 'metrics' => array(
- 'nb_visits_returning' => Piwik::translate('VisitFrequency_ColumnReturningVisits'),
- 'nb_actions_returning' => Piwik::translate('VisitFrequency_ColumnActionsByReturningVisits'),
- 'avg_time_on_site_returning' => Piwik::translate('VisitFrequency_ColumnAverageVisitDurationForReturningVisitors'),
- 'bounce_rate_returning' => Piwik::translate('VisitFrequency_ColumnBounceRateForReturningVisits'),
- 'nb_actions_per_visit_returning' => Piwik::translate('VisitFrequency_ColumnAvgActionsPerReturningVisit'),
- 'nb_uniq_visitors_returning' => Piwik::translate('VisitFrequency_ColumnUniqueReturningVisitors'),
-// Not displayed
-// 'nb_visits_converted_returning',
-// 'sum_visit_length_returning',
-// 'max_actions_returning',
-// 'bounce_count_returning',
- ),
- 'processedMetrics' => false,
- 'order' => 40
+ $metrics = array(
+ 'nb_visits_returning' => 'VisitFrequency_ColumnReturningVisits',
+ 'nb_actions_returning' => 'VisitFrequency_ColumnActionsByReturningVisits',
+ 'avg_time_on_site_returning' => 'VisitFrequency_ColumnAverageVisitDurationForReturningVisitors',
+ 'bounce_rate_returning' => 'VisitFrequency_ColumnBounceRateForReturningVisits',
+ 'nb_actions_per_visit_returning' => 'VisitFrequency_ColumnAvgActionsPerReturningVisit',
+ 'nb_uniq_visitors_returning' => 'VisitFrequency_ColumnUniqueReturningVisitors'
);
+
+ $translations = array_merge($translations, $metrics);
}
+
}
diff --git a/plugins/VisitTime/Columns/Dayoftheweek.php b/plugins/VisitTime/Columns/Dayoftheweek.php
new file mode 100644
index 0000000000..99b8f819d5
--- /dev/null
+++ b/plugins/VisitTime/Columns/Dayoftheweek.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\VisitTime\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+
+class DayOfTheWeek extends VisitDimension
+{
+ public function getName()
+ {
+ return Piwik::translate('VisitTime_DayOfWeek');
+ }
+} \ No newline at end of file
diff --git a/plugins/VisitTime/Columns/Localtime.php b/plugins/VisitTime/Columns/Localtime.php
new file mode 100644
index 0000000000..ea57eb3e68
--- /dev/null
+++ b/plugins/VisitTime/Columns/Localtime.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\VisitTime\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+use Piwik\Plugins\VisitTime\Segment;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+
+class LocalTime extends VisitDimension
+{
+ protected $fieldName = 'visitor_localtime';
+ protected $fieldType = 'TIME NOT NULL';
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setSegment('visitLocalHour');
+ $segment->setName('VisitTime_ColumnLocalTime');
+ $segment->setSqlSegment('HOUR(log_visit.visitor_localtime)');
+ $segment->setAcceptedValues('0, 1, 2, 3, ..., 20, 21, 22, 23');
+ $this->addSegment($segment);
+ }
+
+ public function getName()
+ {
+ return Piwik::translate('VisitTime_ColumnLocalTime');
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ return $request->getLocalTime();
+ }
+} \ No newline at end of file
diff --git a/plugins/VisitTime/Columns/Servertime.php b/plugins/VisitTime/Columns/Servertime.php
new file mode 100644
index 0000000000..6e69670d93
--- /dev/null
+++ b/plugins/VisitTime/Columns/Servertime.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\VisitTime\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+use Piwik\Plugins\VisitTime\Segment;
+
+class ServerTime extends VisitDimension
+{
+ protected $fieldName = 'visit_last_action_time';
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setSegment('visitServerHour');
+ $segment->setName('VisitTime_ColumnServerTime');
+ $segment->setSqlSegment('HOUR(log_visit.visit_last_action_time)');
+ $segment->setAcceptedValues('0, 1, 2, 3, ..., 20, 21, 22, 23');
+ $this->addSegment($segment);
+ }
+
+ public function getName()
+ {
+ return Piwik::translate('VisitTime_ColumnServerTime');
+ }
+} \ No newline at end of file
diff --git a/plugins/VisitTime/Reports/Base.php b/plugins/VisitTime/Reports/Base.php
new file mode 100644
index 0000000000..41a616d55e
--- /dev/null
+++ b/plugins/VisitTime/Reports/Base.php
@@ -0,0 +1,41 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\VisitTime\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\CoreVisualizations\Visualizations\JqplotGraph\Bar;
+
+abstract class Base extends \Piwik\Plugin\Report
+{
+ protected function init()
+ {
+ $this->category = 'VisitsSummary_VisitsSummary';
+ }
+
+ public function getDefaultTypeViewDataTable()
+ {
+ return Bar::ID;
+ }
+
+ /**
+ * @param ViewDataTable $view
+ */
+ protected function setBasicConfigViewProperties(ViewDataTable $view)
+ {
+ $view->requestConfig->filter_sort_column = 'label';
+ $view->requestConfig->filter_sort_order = 'asc';
+ $view->requestConfig->addPropertiesThatShouldBeAvailableClientSide(array('filter_sort_column'));
+ $view->config->show_search = false;
+ $view->config->show_limit_control = false;
+ $view->config->show_exclude_low_population = false;
+ $view->config->show_offset_information = false;
+ $view->config->show_pagination_control = false;
+ }
+}
diff --git a/plugins/VisitTime/Reports/GetByDayOfWeek.php b/plugins/VisitTime/Reports/GetByDayOfWeek.php
new file mode 100644
index 0000000000..a01d0ed8ce
--- /dev/null
+++ b/plugins/VisitTime/Reports/GetByDayOfWeek.php
@@ -0,0 +1,72 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\VisitTime\Reports;
+
+use Piwik\Common;
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\CoreVisualizations\Visualizations\Graph;
+use Piwik\Plugins\VisitTime\Columns\DayOfTheWeek;
+use Piwik\Period;
+use Piwik\Site;
+
+class GetByDayOfWeek extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new DayOfTheWeek();
+ $this->name = Piwik::translate('VisitTime_VisitsByDayOfWeek');
+ $this->documentation = Piwik::translate('VisitTime_WidgetByDayOfWeekDocumentation');
+ $this->constantRowsCount = true;
+ $this->order = 25;
+ $this->widgetTitle = 'VisitTime_VisitsByDayOfWeek';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $this->setBasicConfigViewProperties($view);
+
+ $view->requestConfig->filter_limit = 7;
+
+ $view->config->enable_sort = false;
+ $view->config->show_footer_message = Piwik::translate('General_ReportGeneratedFrom', $this->getDateRangeForFooterMessage());
+ $view->config->addTranslation('label', $this->dimension->getName());
+
+ if ($view->isViewDataTableId(Graph::ID)) {
+ $view->config->max_graph_elements = false;
+ $view->config->show_all_ticks = true;
+ }
+ }
+
+ private function getDateRangeForFooterMessage()
+ {
+ // get query params
+ $idSite = Common::getRequestVar('idSite', false);
+ $date = Common::getRequestVar('date', false);
+ $period = Common::getRequestVar('period', false);
+
+ // create a period instance
+ try {
+ $oPeriod = Period\Factory::makePeriodFromQueryParams(Site::getTimezoneFor($idSite), $period, $date);
+ } catch (\Exception $ex) {
+ return ''; // if query params are incorrect, forget about the footer message
+ }
+
+ // set the footer message using the period start & end date
+ $start = $oPeriod->getDateStart()->toString();
+ $end = $oPeriod->getDateEnd()->toString();
+ if ($start == $end) {
+ $dateRange = $start;
+ } else {
+ $dateRange = $start . " &ndash; " . $end;
+ }
+ return $dateRange;
+ }
+}
diff --git a/plugins/VisitTime/Reports/GetVisitInformationPerLocalTime.php b/plugins/VisitTime/Reports/GetVisitInformationPerLocalTime.php
new file mode 100644
index 0000000000..7700cc67d5
--- /dev/null
+++ b/plugins/VisitTime/Reports/GetVisitInformationPerLocalTime.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\VisitTime\Reports;
+
+use Piwik\Common;
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\CoreVisualizations\Visualizations\Graph;
+use Piwik\Plugins\VisitTime\Columns\LocalTime;
+
+class GetVisitInformationPerLocalTime extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new LocalTime();
+ $this->name = Piwik::translate('VisitTime_WidgetLocalTime');
+ $this->documentation = Piwik::translate('VisitTime_WidgetLocalTimeDocumentation', array('<strong>', '</strong>'));
+ $this->constantRowsCount = true;
+ $this->order = 20;
+ $this->widgetTitle = 'VisitTime_WidgetLocalTime';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $this->setBasicConfigViewProperties($view);
+
+ $view->requestConfig->filter_limit = 24;
+
+ $view->config->title = Piwik::translate('VisitTime_ColumnLocalTime');
+ $view->config->addTranslation('label', Piwik::translate('VisitTime_LocalTime'));
+
+ if ($view->isViewDataTableId(Graph::ID)) {
+ $view->config->max_graph_elements = false;
+ }
+
+ // add the visits by day of week as a related report, if the current period is not 'day'
+ if (Common::getRequestVar('period', 'day') != 'day') {
+ $view->config->addRelatedReport('VisitTime.getByDayOfWeek', Piwik::translate('VisitTime_VisitsByDayOfWeek'));
+ }
+ }
+}
diff --git a/plugins/VisitTime/Reports/GetVisitInformationPerServerTime.php b/plugins/VisitTime/Reports/GetVisitInformationPerServerTime.php
new file mode 100644
index 0000000000..87901a97ac
--- /dev/null
+++ b/plugins/VisitTime/Reports/GetVisitInformationPerServerTime.php
@@ -0,0 +1,44 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\VisitTime\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\CoreVisualizations\Visualizations\Graph;
+use Piwik\Plugins\VisitTime\Columns\ServerTime;
+
+class GetVisitInformationPerServerTime extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new ServerTime();
+ $this->name = Piwik::translate('VisitTime_WidgetServerTime');
+ $this->documentation = Piwik::translate('VisitTime_WidgetServerTimeDocumentation', array('<strong>', '</strong>'));
+ $this->constantRowsCount = true;
+ $this->hasGoalMetrics = true;
+ $this->order = 15;
+ $this->widgetTitle = 'VisitTime_WidgetServerTime';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $this->setBasicConfigViewProperties($view);
+
+ $view->requestConfig->filter_limit = 24;
+ $view->requestConfig->request_parameters_to_modify['hideFutureHoursWhenToday'] = 1;
+
+ $view->config->show_goals = true;
+ $view->config->addTranslation('label', $this->dimension->getName());
+
+ if ($view->isViewDataTableId(Graph::ID)) {
+ $view->config->max_graph_elements = false;
+ }
+ }
+}
diff --git a/plugins/VisitTime/Segment.php b/plugins/VisitTime/Segment.php
new file mode 100644
index 0000000000..741cb67c3e
--- /dev/null
+++ b/plugins/VisitTime/Segment.php
@@ -0,0 +1,21 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\VisitTime;
+
+/**
+ * VisitTime segment base class.
+ *
+ */
+class Segment extends \Piwik\Plugin\Segment
+{
+ protected function init()
+ {
+ $this->setCategory('Visit');
+ }
+}
diff --git a/plugins/VisitTime/VisitTime.php b/plugins/VisitTime/VisitTime.php
index fbf115748c..39ac47d536 100644
--- a/plugins/VisitTime/VisitTime.php
+++ b/plugins/VisitTime/VisitTime.php
@@ -8,209 +8,7 @@
*/
namespace Piwik\Plugins\VisitTime;
-use Exception;
-use Piwik\ArchiveProcessor;
-use Piwik\Common;
-use Piwik\Period;
-use Piwik\Piwik;
-use Piwik\Plugin\ViewDataTable;
-use Piwik\Plugins\CoreVisualizations\Visualizations\Graph;
-use Piwik\Plugins\CoreVisualizations\Visualizations\JqplotGraph\Bar;
-use Piwik\Site;
-
-/**
- *
- */
+// empty plugin definition, otherwise plugin won't be installed during test run
class VisitTime extends \Piwik\Plugin
{
- /**
- * @see Piwik\Plugin::getListHooksRegistered
- */
- public function getListHooksRegistered()
- {
- $hooks = array(
- 'Goals.getReportsWithGoalMetrics' => 'getReportsWithGoalMetrics',
- 'API.getReportMetadata' => 'getReportMetadata',
- 'API.getSegmentDimensionMetadata' => 'getSegmentsMetadata',
- 'ViewDataTable.configure' => 'configureViewDataTable',
- 'ViewDataTable.getDefaultType' => 'getDefaultTypeViewDataTable'
- );
- return $hooks;
- }
-
- public function getReportMetadata(&$reports)
- {
- $reports[] = array(
- 'category' => Piwik::translate('VisitsSummary_VisitsSummary'),
- 'name' => Piwik::translate('VisitTime_WidgetLocalTime'),
- 'module' => 'VisitTime',
- 'action' => 'getVisitInformationPerLocalTime',
- 'dimension' => Piwik::translate('VisitTime_ColumnLocalTime'),
- 'documentation' => Piwik::translate('VisitTime_WidgetLocalTimeDocumentation', array('<strong>', '</strong>')),
- 'constantRowsCount' => true,
- 'order' => 20
- );
-
- $reports[] = array(
- 'category' => Piwik::translate('VisitsSummary_VisitsSummary'),
- 'name' => Piwik::translate('VisitTime_WidgetServerTime'),
- 'module' => 'VisitTime',
- 'action' => 'getVisitInformationPerServerTime',
- 'dimension' => Piwik::translate('VisitTime_ColumnServerTime'),
- 'documentation' => Piwik::translate('VisitTime_WidgetServerTimeDocumentation', array('<strong>', '</strong>')),
- 'constantRowsCount' => true,
- 'order' => 15,
- );
-
- $reports[] = array(
- 'category' => Piwik::translate('VisitsSummary_VisitsSummary'),
- 'name' => Piwik::translate('VisitTime_VisitsByDayOfWeek'),
- 'module' => 'VisitTime',
- 'action' => 'getByDayOfWeek',
- 'dimension' => Piwik::translate('VisitTime_DayOfWeek'),
- 'documentation' => Piwik::translate('VisitTime_WidgetByDayOfWeekDocumentation'),
- 'constantRowsCount' => true,
- 'order' => 25,
- );
- }
-
- public function getReportsWithGoalMetrics(&$dimensions)
- {
- $dimensions[] = array('category' => Piwik::translate('VisitTime_ColumnServerTime'),
- 'name' => Piwik::translate('VisitTime_ColumnServerTime'),
- 'module' => 'VisitTime',
- 'action' => 'getVisitInformationPerServerTime',
- );
- }
-
- public function getSegmentsMetadata(&$segments)
- {
- $acceptedValues = "0, 1, 2, 3, ..., 20, 21, 22, 23";
- $segments[] = array(
- 'type' => 'dimension',
- 'category' => Piwik::translate('General_Visit'),
- 'name' => Piwik::translate('VisitTime_ColumnServerTime'),
- 'segment' => 'visitServerHour',
- 'sqlSegment' => 'HOUR(log_visit.visit_last_action_time)',
- 'acceptedValues' => $acceptedValues
- );
- $segments[] = array(
- 'type' => 'dimension',
- 'category' => Piwik::translate('General_Visit'),
- 'name' => Piwik::translate('VisitTime_ColumnLocalTime'),
- 'segment' => 'visitLocalHour',
- 'sqlSegment' => 'HOUR(log_visit.visitor_localtime)',
- 'acceptedValues' => $acceptedValues
- );
- }
-
- public function getDefaultTypeViewDataTable(&$defaultViewTypes)
- {
- $defaultViewTypes['VisitTime.getVisitInformationPerServerTime'] = Bar::ID;
- $defaultViewTypes['VisitTime.getVisitInformationPerLocalTime'] = Bar::ID;
- $defaultViewTypes['VisitTime.getByDayOfWeek'] = Bar::ID;
- }
-
- public function configureViewDataTable(ViewDataTable $view)
- {
- switch ($view->requestConfig->apiMethodToRequestDataTable) {
- case 'VisitTime.getVisitInformationPerServerTime':
- $this->setBasicConfigViewProperties($view);
- $this->configureViewForVisitInformationPerServerTime($view);
- break;
- case 'VisitTime.getVisitInformationPerLocalTime':
- $this->setBasicConfigViewProperties($view);
- $this->configureViewForVisitInformationPerLocalTime($view);
- break;
- case 'VisitTime.getByDayOfWeek':
- $this->setBasicConfigViewProperties($view);
- $this->configureViewForByDayOfWeek($view);
- break;
- }
- }
-
- protected function configureViewForVisitInformationPerServerTime(ViewDataTable $view)
- {
- $view->requestConfig->filter_limit = 24;
- $view->requestConfig->request_parameters_to_modify['hideFutureHoursWhenToday'] = 1;
-
- $view->config->show_goals = true;
- $view->config->addTranslation('label', Piwik::translate('VisitTime_ColumnServerTime'));
-
- if ($view->isViewDataTableId(Graph::ID)) {
- $view->config->max_graph_elements = false;
- }
- }
-
- protected function configureViewForVisitInformationPerLocalTime(ViewDataTable $view)
- {
- $view->requestConfig->filter_limit = 24;
-
- $view->config->title = Piwik::translate('VisitTime_ColumnLocalTime');
- $view->config->addTranslation('label', Piwik::translate('VisitTime_LocalTime'));
-
- if ($view->isViewDataTableId(Graph::ID)) {
- $view->config->max_graph_elements = false;
- }
-
- // add the visits by day of week as a related report, if the current period is not 'day'
- if (Common::getRequestVar('period', 'day') != 'day') {
- $view->config->addRelatedReport('VisitTime.getByDayOfWeek', Piwik::translate('VisitTime_VisitsByDayOfWeek'));
- }
-
- }
-
- protected function configureViewForByDayOfWeek(ViewDataTable $view)
- {
- $view->requestConfig->filter_limit = 7;
-
- $view->config->enable_sort = false;
- $view->config->show_footer_message = Piwik::translate('General_ReportGeneratedFrom', self::getDateRangeForFooterMessage());
- $view->config->addTranslation('label', Piwik::translate('VisitTime_DayOfWeek'));
-
- if ($view->isViewDataTableId(Graph::ID)) {
- $view->config->max_graph_elements = false;
- $view->config->show_all_ticks = true;
- }
- }
-
- private static function getDateRangeForFooterMessage()
- {
- // get query params
- $idSite = Common::getRequestVar('idSite', false);
- $date = Common::getRequestVar('date', false);
- $period = Common::getRequestVar('period', false);
-
- // create a period instance
- try {
- $oPeriod = Period\Factory::makePeriodFromQueryParams(Site::getTimezoneFor($idSite), $period, $date);
- } catch (Exception $ex) {
- return ''; // if query params are incorrect, forget about the footer message
- }
-
- // set the footer message using the period start & end date
- $start = $oPeriod->getDateStart()->toString();
- $end = $oPeriod->getDateEnd()->toString();
- if ($start == $end) {
- $dateRange = $start;
- } else {
- $dateRange = $start . " &ndash; " . $end;
- }
- return $dateRange;
- }
-
- /**
- * @param ViewDataTable $view
- */
- private function setBasicConfigViewProperties(ViewDataTable $view)
- {
- $view->requestConfig->filter_sort_column = 'label';
- $view->requestConfig->filter_sort_order = 'asc';
- $view->requestConfig->addPropertiesThatShouldBeAvailableClientSide(array('filter_sort_column'));
- $view->config->show_search = false;
- $view->config->show_limit_control = false;
- $view->config->show_exclude_low_population = false;
- $view->config->show_offset_information = false;
- $view->config->show_pagination_control = false;
- }
}
diff --git a/plugins/VisitTime/Widgets.php b/plugins/VisitTime/Widgets.php
deleted file mode 100644
index 32541ea4f4..0000000000
--- a/plugins/VisitTime/Widgets.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- *
- */
-namespace Piwik\Plugins\VisitTime;
-
-use Piwik\WidgetsList;
-
-class Widgets extends \Piwik\Plugin\Widgets
-{
- public function configure(WidgetsList $widgetsList)
- {
- $category = 'VisitsSummary_VisitsSummary';
- $controller = 'VisitTime';
-
- $widgetsList->add($category, 'VisitTime_WidgetLocalTime', $controller, 'getVisitInformationPerLocalTime');
- $widgetsList->add($category, 'VisitTime_WidgetServerTime', $controller, 'getVisitInformationPerServerTime');
- $widgetsList->add($category, 'VisitTime_VisitsByDayOfWeek', $controller, 'getByDayOfWeek');
- }
-
-}
diff --git a/plugins/VisitorInterest/Columns/Pagespervisit.php b/plugins/VisitorInterest/Columns/Pagespervisit.php
new file mode 100644
index 0000000000..a85b8bf71e
--- /dev/null
+++ b/plugins/VisitorInterest/Columns/Pagespervisit.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\VisitorInterest\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+
+class PagesPerVisit extends VisitDimension
+{
+ public function getName()
+ {
+ return Piwik::translate('VisitorInterest_ColumnPagesPerVisit');
+ }
+} \ No newline at end of file
diff --git a/plugins/VisitorInterest/Columns/Visitduration.php b/plugins/VisitorInterest/Columns/Visitduration.php
new file mode 100644
index 0000000000..e483bc7c3a
--- /dev/null
+++ b/plugins/VisitorInterest/Columns/Visitduration.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\VisitorInterest\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+
+class VisitDuration extends VisitDimension
+{
+ public function getName()
+ {
+ return Piwik::translate('VisitorInterest_ColumnVisitDuration');
+ }
+} \ No newline at end of file
diff --git a/plugins/VisitorInterest/Columns/VisitsbyVisitNumber.php b/plugins/VisitorInterest/Columns/VisitsbyVisitNumber.php
new file mode 100644
index 0000000000..a5b436deaf
--- /dev/null
+++ b/plugins/VisitorInterest/Columns/VisitsbyVisitNumber.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\VisitorInterest\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+
+class VisitsbyVisitNumber extends VisitDimension
+{
+ public function getName()
+ {
+ return Piwik::translate('VisitorInterest_visitsByVisitCount');
+ }
+} \ No newline at end of file
diff --git a/plugins/VisitorInterest/Columns/Visitsbydayssincelastvisit.php b/plugins/VisitorInterest/Columns/Visitsbydayssincelastvisit.php
new file mode 100644
index 0000000000..e64515181d
--- /dev/null
+++ b/plugins/VisitorInterest/Columns/Visitsbydayssincelastvisit.php
@@ -0,0 +1,49 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\VisitorInterest\Columns;
+
+use Piwik\Piwik;
+use Piwik\Plugin\VisitDimension;
+use Piwik\Plugins\CoreHome\Segment;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+
+class VisitsByDaysSinceLastVisit extends VisitDimension
+{
+ protected $fieldName = 'visitor_days_since_last';
+ protected $fieldType = 'SMALLINT(5) UNSIGNED NOT NULL';
+
+ protected function init()
+ {
+ $segment = new Segment();
+ $segment->setSegment('daysSinceLastVisit');
+ $segment->setName('General_DaysSinceLastVisit');
+ $segment->setType(Segment::TYPE_METRIC);
+
+ $this->addSegment($segment);
+ }
+
+ public function getName()
+ {
+ return Piwik::translate('VisitorInterest_VisitsByDaysSinceLast');
+ }
+
+ /**
+ * @param Request $request
+ * @param Visitor $visitor
+ * @param Action|null $action
+ * @return mixed
+ */
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ return $request->getDaysSinceLastVisit();
+ }
+
+} \ No newline at end of file
diff --git a/plugins/VisitorInterest/Reports/Base.php b/plugins/VisitorInterest/Reports/Base.php
new file mode 100644
index 0000000000..a91cd23091
--- /dev/null
+++ b/plugins/VisitorInterest/Reports/Base.php
@@ -0,0 +1,18 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\VisitorInterest\Reports;
+
+abstract class Base extends \Piwik\Plugin\Report
+{
+ protected function init()
+ {
+ $this->category = 'General_Visitors';
+ }
+
+}
diff --git a/plugins/VisitorInterest/Reports/GetNumberOfVisitsByDaysSinceLast.php b/plugins/VisitorInterest/Reports/GetNumberOfVisitsByDaysSinceLast.php
new file mode 100644
index 0000000000..679917fdcc
--- /dev/null
+++ b/plugins/VisitorInterest/Reports/GetNumberOfVisitsByDaysSinceLast.php
@@ -0,0 +1,47 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\VisitorInterest\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\VisitorInterest\Columns\VisitsByDaysSinceLastVisit;
+
+class GetNumberOfVisitsByDaysSinceLast extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new VisitsByDaysSinceLastVisit();
+ $this->name = Piwik::translate('VisitorInterest_VisitsByDaysSinceLast');
+ $this->documentation = Piwik::translate('VisitorInterest_WidgetVisitsByDaysSinceLastDocumentation');
+ $this->metrics = array('nb_visits');
+ $this->processedMetrics = false;
+ $this->constantRowsCount = true;
+ $this->order = 30;
+ $this->widgetTitle = 'VisitorInterest_WidgetVisitsByDaysSinceLast';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->requestConfig->filter_sort_column = 'label';
+ $view->requestConfig->filter_sort_order = 'asc';
+ $view->requestConfig->filter_limit = 15;
+
+ $view->config->show_search = false;
+ $view->config->enable_sort = false;
+ $view->config->show_offset_information = false;
+ $view->config->show_pagination_control = false;
+ $view->config->show_limit_control = false;
+ $view->config->show_all_views_icons = false;
+ $view->config->show_table_all_columns = false;
+ $view->config->show_exclude_low_population = false;
+ $view->config->addTranslation('label', Piwik::translate('General_DaysSinceLastVisit'));
+ }
+
+}
diff --git a/plugins/VisitorInterest/Reports/GetNumberOfVisitsByVisitCount.php b/plugins/VisitorInterest/Reports/GetNumberOfVisitsByVisitCount.php
new file mode 100644
index 0000000000..c3a12f9a46
--- /dev/null
+++ b/plugins/VisitorInterest/Reports/GetNumberOfVisitsByVisitCount.php
@@ -0,0 +1,55 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\VisitorInterest\Reports;
+
+use Piwik\Metrics;
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\VisitorInterest\Columns\VisitsbyVisitNumber;
+
+class GetNumberOfVisitsByVisitCount extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new VisitsbyVisitNumber();
+ $this->name = Piwik::translate('VisitorInterest_visitsByVisitCount');
+ $this->documentation = Piwik::translate('VisitorInterest_WidgetVisitsByNumDocumentation')
+ . '<br />' . Piwik::translate('General_ChangeTagCloudView');
+ $this->metrics = array('nb_visits', 'nb_visits_percentage');
+ $this->processedMetrics = false;
+ $this->constantRowsCount = true;
+ $this->order = 25;
+ $this->widgetTitle = 'VisitorInterest_visitsByVisitCount';
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->requestConfig->filter_sort_column = 'label';
+ $view->requestConfig->filter_sort_order = 'asc';
+ $view->requestConfig->filter_limit = 15;
+
+ $view->config->addTranslations(array(
+ 'label' => Piwik::translate('VisitorInterest_VisitNum'),
+ 'nb_visits_percentage' => Metrics::getPercentVisitColumn())
+ );
+
+ $view->config->columns_to_display = array('label', 'nb_visits', 'nb_visits_percentage');
+ $view->config->show_exclude_low_population = false;
+
+ $view->config->enable_sort = false;
+ $view->config->show_offset_information = false;
+ $view->config->show_pagination_control = false;
+ $view->config->show_limit_control = false;
+ $view->config->show_search = false;
+ $view->config->show_table_all_columns = false;
+ $view->config->show_all_views_icons = false;
+ }
+
+}
diff --git a/plugins/VisitorInterest/Reports/GetNumberOfVisitsPerPage.php b/plugins/VisitorInterest/Reports/GetNumberOfVisitsPerPage.php
new file mode 100644
index 0000000000..3efc243ccc
--- /dev/null
+++ b/plugins/VisitorInterest/Reports/GetNumberOfVisitsPerPage.php
@@ -0,0 +1,60 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\VisitorInterest\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\CoreVisualizations\Visualizations\Cloud;
+use Piwik\Plugins\CoreVisualizations\Visualizations\Graph;
+use Piwik\Plugins\VisitorInterest\Columns\PagesPerVisit;
+
+class GetNumberOfVisitsPerPage extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new PagesPerVisit();
+ $this->name = Piwik::translate('VisitorInterest_WidgetPages');
+ $this->documentation = Piwik::translate('VisitorInterest_WidgetPagesDocumentation')
+ . '<br />' . Piwik::translate('General_ChangeTagCloudView');
+ $this->metrics = array('nb_visits');
+ $this->processedMetrics = false;
+ $this->constantRowsCount = true;
+ $this->order = 20;
+ $this->widgetTitle = 'VisitorInterest_WidgetPages';
+ }
+
+ public function getDefaultTypeViewDataTable()
+ {
+ return Cloud::ID;
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->requestConfig->filter_sort_column = 'label';
+ $view->requestConfig->filter_sort_order = 'asc';
+
+ $view->config->addTranslation('label', Piwik::translate('VisitorInterest_ColumnVisitDuration'));
+ $view->config->enable_sort = false;
+ $view->config->show_exclude_low_population = false;
+ $view->config->show_offset_information = false;
+ $view->config->show_pagination_control = false;
+ $view->config->show_limit_control = false;
+ $view->config->show_search = false;
+ $view->config->show_table_all_columns = false;
+ $view->config->columns_to_display = array('label', 'nb_visits');
+
+ if ($view->isViewDataTableId(Graph::ID)) {
+ $view->config->show_series_picker = false;
+ $view->config->selectable_columns = array();
+ $view->config->max_graph_elements = 10;
+ }
+ }
+
+}
diff --git a/plugins/VisitorInterest/Reports/GetNumberOfVisitsPerVisitDuration.php b/plugins/VisitorInterest/Reports/GetNumberOfVisitsPerVisitDuration.php
new file mode 100644
index 0000000000..a447ea22fe
--- /dev/null
+++ b/plugins/VisitorInterest/Reports/GetNumberOfVisitsPerVisitDuration.php
@@ -0,0 +1,60 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\VisitorInterest\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\CoreVisualizations\Visualizations\Cloud;
+use Piwik\Plugins\CoreVisualizations\Visualizations\Graph;
+use Piwik\Plugins\VisitorInterest\Columns\VisitDuration;
+
+class GetNumberOfVisitsPerVisitDuration extends Base
+{
+ protected function init()
+ {
+ parent::init();
+ $this->dimension = new VisitDuration();
+ $this->name = Piwik::translate('VisitorInterest_WidgetLengths');
+ $this->documentation = Piwik::translate('VisitorInterest_WidgetLengthsDocumentation')
+ . '<br />' . Piwik::translate('General_ChangeTagCloudView');
+ $this->metrics = array('nb_visits');
+ $this->processedMetrics = false;
+ $this->constantRowsCount = true;
+ $this->order = 15;
+ $this->widgetTitle = 'VisitorInterest_WidgetLengths';
+ }
+
+ public function getDefaultTypeViewDataTable()
+ {
+ return Cloud::ID;
+ }
+
+ public function configureView(ViewDataTable $view)
+ {
+ $view->requestConfig->filter_sort_column = 'label';
+ $view->requestConfig->filter_sort_order = 'asc';
+
+ $view->config->addTranslation('label', $this->dimension->getName());
+ $view->config->enable_sort = false;
+ $view->config->show_exclude_low_population = false;
+ $view->config->show_offset_information = false;
+ $view->config->show_pagination_control = false;
+ $view->config->show_limit_control = false;
+ $view->config->show_search = false;
+ $view->config->show_table_all_columns = false;
+ $view->config->columns_to_display = array('label', 'nb_visits');
+
+ if ($view->isViewDataTableId(Graph::ID)) {
+ $view->config->show_series_picker = false;
+ $view->config->selectable_columns = array();
+ $view->config->max_graph_elements = 10;
+ }
+ }
+
+}
diff --git a/plugins/VisitorInterest/VisitorInterest.php b/plugins/VisitorInterest/VisitorInterest.php
index 0401883781..3a38f40c18 100644
--- a/plugins/VisitorInterest/VisitorInterest.php
+++ b/plugins/VisitorInterest/VisitorInterest.php
@@ -12,7 +12,6 @@ use Piwik\ArchiveProcessor;
use Piwik\FrontController;
use Piwik\Metrics;
use Piwik\Piwik;
-use Piwik\Plugin\ViewDataTable;
use Piwik\Plugins\CoreVisualizations\Visualizations\Cloud;
use Piwik\Plugins\CoreVisualizations\Visualizations\Graph;
@@ -21,79 +20,6 @@ use Piwik\Plugins\CoreVisualizations\Visualizations\Graph;
*/
class VisitorInterest extends \Piwik\Plugin
{
- /**
- * @see Piwik\Plugin::getListHooksRegistered
- */
- public function getListHooksRegistered()
- {
- $hooks = array(
- 'API.getReportMetadata' => 'getReportMetadata',
- 'ViewDataTable.configure' => 'configureViewDataTable',
- 'ViewDataTable.getDefaultType' => 'getDefaultTypeViewDataTable'
- );
- return $hooks;
- }
-
- public function getReportMetadata(&$reports)
- {
- $reports[] = array(
- 'category' => Piwik::translate('General_Visitors'),
- 'name' => Piwik::translate('VisitorInterest_WidgetLengths'),
- 'module' => 'VisitorInterest',
- 'action' => 'getNumberOfVisitsPerVisitDuration',
- 'dimension' => Piwik::translate('VisitorInterest_ColumnVisitDuration'),
- 'metrics' => array('nb_visits'),
- 'processedMetrics' => false,
- 'constantRowsCount' => true,
- 'documentation' => Piwik::translate('VisitorInterest_WidgetLengthsDocumentation')
- . '<br />' . Piwik::translate('General_ChangeTagCloudView'),
- 'order' => 15
- );
-
- $reports[] = array(
- 'category' => Piwik::translate('General_Visitors'),
- 'name' => Piwik::translate('VisitorInterest_WidgetPages'),
- 'module' => 'VisitorInterest',
- 'action' => 'getNumberOfVisitsPerPage',
- 'dimension' => Piwik::translate('VisitorInterest_ColumnPagesPerVisit'),
- 'metrics' => array('nb_visits'),
- 'processedMetrics' => false,
- 'constantRowsCount' => true,
- 'documentation' => Piwik::translate('VisitorInterest_WidgetPagesDocumentation')
- . '<br />' . Piwik::translate('General_ChangeTagCloudView'),
- 'order' => 20
- );
-
- $reports[] = array(
- 'category' => Piwik::translate('General_Visitors'),
- 'name' => Piwik::translate('VisitorInterest_visitsByVisitCount'),
- 'module' => 'VisitorInterest',
- 'action' => 'getNumberOfVisitsByVisitCount',
- 'dimension' => Piwik::translate('VisitorInterest_visitsByVisitCount'),
- 'metrics' => array(
- 'nb_visits',
- 'nb_visits_percentage' => Piwik::translate('General_ColumnPercentageVisits'),
- ),
- 'processedMetrics' => false,
- 'constantRowsCount' => true,
- 'documentation' => Piwik::translate('VisitorInterest_WidgetVisitsByNumDocumentation')
- . '<br />' . Piwik::translate('General_ChangeTagCloudView'),
- 'order' => 25
- );
-
- $reports[] = array(
- 'category' => Piwik::translate('General_Visitors'),
- 'name' => Piwik::translate('VisitorInterest_VisitsByDaysSinceLast'),
- 'module' => 'VisitorInterest',
- 'action' => 'getNumberOfVisitsByDaysSinceLast',
- 'dimension' => Piwik::translate('VisitorInterest_VisitsByDaysSinceLast'),
- 'metrics' => array('nb_visits'),
- 'processedMetrics' => false,
- 'constantRowsCount' => true,
- 'documentation' => Piwik::translate('VisitorInterest_WidgetVisitsByDaysSinceLastDocumentation'),
- 'order' => 30
- );
- }
function postLoad()
{
@@ -114,112 +40,4 @@ class VisitorInterest extends \Piwik\Plugin
$out .= FrontController::getInstance()->fetchDispatch('VisitorInterest', 'index');
$out .= '</div>';
}
-
- public function getDefaultTypeViewDataTable(&$defaultViewTypes)
- {
- $defaultViewTypes['VisitorInterest.getNumberOfVisitsPerVisitDuration'] = Cloud::ID;
- $defaultViewTypes['VisitorInterest.getNumberOfVisitsPerPage'] = Cloud::ID;
- }
-
- public function configureViewDataTable(ViewDataTable $view)
- {
- switch ($view->requestConfig->apiMethodToRequestDataTable) {
- case 'VisitorInterest.getNumberOfVisitsPerVisitDuration':
- $this->configureViewForGetNumberOfVisitsPerVisitDuration($view);
- break;
- case 'VisitorInterest.getNumberOfVisitsPerPage':
- $this->configureViewForGetNumberOfVisitsPerPage($view);
- break;
- case 'VisitorInterest.getNumberOfVisitsByVisitCount':
- $this->configureViewForGetNumberOfVisitsByVisitCount($view);
- break;
- case 'VisitorInterest.getNumberOfVisitsByDaysSinceLast':
- $this->configureViewForGetNumberOfVisitsByDaysSinceLast($view);
- break;
- }
- }
-
- private function configureViewForGetNumberOfVisitsPerVisitDuration(ViewDataTable $view)
- {
- $view->requestConfig->filter_sort_column = 'label';
- $view->requestConfig->filter_sort_order = 'asc';
-
- $view->config->addTranslation('label', Piwik::translate('VisitorInterest_ColumnVisitDuration'));
- $view->config->enable_sort = false;
- $view->config->show_exclude_low_population = false;
- $view->config->show_offset_information = false;
- $view->config->show_pagination_control = false;
- $view->config->show_limit_control = false;
- $view->config->show_search = false;
- $view->config->show_table_all_columns = false;
- $view->config->columns_to_display = array('label', 'nb_visits');
-
- if ($view->isViewDataTableId(Graph::ID)) {
- $view->config->show_series_picker = false;
- $view->config->selectable_columns = array();
- $view->config->max_graph_elements = 10;
- }
- }
-
- private function configureViewForGetNumberOfVisitsPerPage(ViewDataTable $view)
- {
- $view->requestConfig->filter_sort_column = 'label';
- $view->requestConfig->filter_sort_order = 'asc';
-
- $view->config->addTranslation('label', Piwik::translate('VisitorInterest_ColumnVisitDuration'));
- $view->config->enable_sort = false;
- $view->config->show_exclude_low_population = false;
- $view->config->show_offset_information = false;
- $view->config->show_pagination_control = false;
- $view->config->show_limit_control = false;
- $view->config->show_search = false;
- $view->config->show_table_all_columns = false;
- $view->config->columns_to_display = array('label', 'nb_visits');
-
- if ($view->isViewDataTableId(Graph::ID)) {
- $view->config->show_series_picker = false;
- $view->config->selectable_columns = array();
- $view->config->max_graph_elements = 10;
- }
- }
-
- private function configureViewForGetNumberOfVisitsByVisitCount(ViewDataTable $view)
- {
- $view->requestConfig->filter_sort_column = 'label';
- $view->requestConfig->filter_sort_order = 'asc';
- $view->requestConfig->filter_limit = 15;
-
- $view->config->addTranslations(array(
- 'label' => Piwik::translate('VisitorInterest_VisitNum'),
- 'nb_visits_percentage' => Metrics::getPercentVisitColumn())
- );
-
- $view->config->columns_to_display = array('label', 'nb_visits', 'nb_visits_percentage');
- $view->config->show_exclude_low_population = false;
-
- $view->config->enable_sort = false;
- $view->config->show_offset_information = false;
- $view->config->show_pagination_control = false;
- $view->config->show_limit_control = false;
- $view->config->show_search = false;
- $view->config->show_table_all_columns = false;
- $view->config->show_all_views_icons = false;
- }
-
- private function configureViewForGetNumberOfVisitsByDaysSinceLast(ViewDataTable $view)
- {
- $view->requestConfig->filter_sort_column = 'label';
- $view->requestConfig->filter_sort_order = 'asc';
- $view->requestConfig->filter_limit = 15;
-
- $view->config->show_search = false;
- $view->config->enable_sort = false;
- $view->config->show_offset_information = false;
- $view->config->show_pagination_control = false;
- $view->config->show_limit_control = false;
- $view->config->show_all_views_icons = false;
- $view->config->show_table_all_columns = false;
- $view->config->show_exclude_low_population = false;
- $view->config->addTranslation('label', Piwik::translate('General_DaysSinceLastVisit'));
- }
}
diff --git a/plugins/VisitorInterest/Widgets.php b/plugins/VisitorInterest/Widgets.php
deleted file mode 100644
index 8aa6f12627..0000000000
--- a/plugins/VisitorInterest/Widgets.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- *
- */
-namespace Piwik\Plugins\VisitorInterest;
-
-use Piwik\WidgetsList;
-
-class Widgets extends \Piwik\Plugin\Widgets
-{
- public function configure(WidgetsList $widgetsList)
- {
- $category = 'General_Visitors';
- $controller = 'VisitorInterest';
-
- $widgetsList->add($category, 'VisitorInterest_WidgetLengths', $controller, 'getNumberOfVisitsPerVisitDuration');
- $widgetsList->add($category, 'VisitorInterest_WidgetPages', $controller, 'getNumberOfVisitsPerPage');
- $widgetsList->add($category, 'VisitorInterest_visitsByVisitCount', $controller, 'getNumberOfVisitsByVisitCount');
- $widgetsList->add($category, 'VisitorInterest_WidgetVisitsByDaysSinceLast', $controller, 'getNumberOfVisitsByDaysSinceLast');
- }
-
-}
diff --git a/plugins/VisitsSummary/Reports/Get.php b/plugins/VisitsSummary/Reports/Get.php
new file mode 100644
index 0000000000..433eb85ab7
--- /dev/null
+++ b/plugins/VisitsSummary/Reports/Get.php
@@ -0,0 +1,46 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\VisitsSummary\Reports;
+
+use Piwik\Piwik;
+
+class Get extends \Piwik\Plugin\Report
+{
+ protected function init()
+ {
+ parent::init();
+ $this->category = 'VisitsSummary_VisitsSummary';
+ $this->name = Piwik::translate('VisitsSummary_VisitsSummary');
+ $this->documentation = ''; // TODO
+ $this->processedMetrics = false;
+ $this->metrics = array(
+ 'nb_uniq_visitors',
+ 'nb_visits',
+ 'nb_actions',
+ 'nb_actions_per_visit',
+ 'bounce_rate',
+ 'avg_time_on_site',
+ 'max_actions'
+ );
+ // Used to process metrics, not displayed/used directly
+// 'sum_visit_length',
+// 'nb_visits_converted',
+ $this->order = 1;
+ }
+
+ public function getMetrics()
+ {
+ $metrics = parent::getMetrics();
+
+ $metrics['avg_time_on_site'] = Piwik::translate('General_VisitDuration');
+ $metrics['max_actions'] = Piwik::translate('General_ColumnMaxActions');
+
+ return $metrics;
+ }
+}
diff --git a/plugins/VisitsSummary/VisitsSummary.php b/plugins/VisitsSummary/VisitsSummary.php
index 3c3bcceda8..066a8e2e35 100644
--- a/plugins/VisitsSummary/VisitsSummary.php
+++ b/plugins/VisitsSummary/VisitsSummary.php
@@ -8,8 +8,6 @@
*/
namespace Piwik\Plugins\VisitsSummary;
-use Piwik\Piwik;
-
/**
* Note: This plugin does not hook on Daily and Period Archiving like other Plugins because it reports the
* very core metrics (visits, actions, visit duration, etc.) which are processed in the Core
@@ -25,32 +23,7 @@ class VisitsSummary extends \Piwik\Plugin
public function getListHooksRegistered()
{
return array(
- 'API.getReportMetadata' => 'getReportMetadata',
- 'AssetManager.getStylesheetFiles' => 'getStylesheetFiles',
- );
- }
-
- public function getReportMetadata(&$reports)
- {
- $reports[] = array(
- 'category' => Piwik::translate('VisitsSummary_VisitsSummary'),
- 'name' => Piwik::translate('VisitsSummary_VisitsSummary'),
- 'module' => 'VisitsSummary',
- 'action' => 'get',
- 'metrics' => array(
- 'nb_uniq_visitors',
- 'nb_visits',
- 'nb_actions',
- 'nb_actions_per_visit',
- 'bounce_rate',
- 'avg_time_on_site' => Piwik::translate('General_VisitDuration'),
- 'max_actions' => Piwik::translate('General_ColumnMaxActions'),
-// Used to process metrics, not displayed/used directly
-// 'sum_visit_length',
-// 'nb_visits_converted',
- ),
- 'processedMetrics' => false,
- 'order' => 1
+ 'AssetManager.getStylesheetFiles' => 'getStylesheetFiles'
);
}
diff --git a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_sortByProcessedMetric__API.getProcessedReport_day.xml b/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_sortByProcessedMetric__API.getProcessedReport_day.xml
index ad4b1d21f3..ea574a289f 100644
--- a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_sortByProcessedMetric__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_sortByProcessedMetric__API.getProcessedReport_day.xml
@@ -8,6 +8,7 @@
<module>Actions</module>
<action>getPageUrls</action>
<dimension>Page URL</dimension>
+ <documentation>This report contains information about the page URLs that have been visited. &lt;br /&gt; The table is organized hierarchically, the URLs are displayed as a folder structure.&lt;br /&gt;Use the plus and minus icons on the left to navigate.</documentation>
<metrics>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
@@ -22,7 +23,6 @@
<avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
<exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
</metricsDocumentation>
- <documentation>This report contains information about the page URLs that have been visited. &lt;br /&gt; The table is organized hierarchically, the URLs are displayed as a folder structure.&lt;br /&gt;Use the plus and minus icons on the left to navigate.</documentation>
<actionToLoadSubTables>getPageUrls</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageUrls&amp;period=day&amp;date=2010-01-03</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageUrls&amp;period=day&amp;date=2009-12-05,2010-01-03</imageGraphEvolutionUrl>
diff --git a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_sortByProcessedMetric_constantRowsCountShouldKeepEmptyRows__API.getProcessedReport_day.xml b/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_sortByProcessedMetric_constantRowsCountShouldKeepEmptyRows__API.getProcessedReport_day.xml
index 44760dc087..5386b28232 100644
--- a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_sortByProcessedMetric_constantRowsCountShouldKeepEmptyRows__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_sortByProcessedMetric_constantRowsCountShouldKeepEmptyRows__API.getProcessedReport_day.xml
@@ -9,29 +9,22 @@
<action>getVisitInformationPerServerTime</action>
<dimension>Server time</dimension>
<documentation>This graph shows what time it was in the &lt;strong&gt; server's time zone &lt;/strong&gt; during the visits.</documentation>
- <constantRowsCount>1</constantRowsCount>
<metrics>
<nb_visits>Visits</nb_visits>
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
- <processedMetrics>
- <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>
- </processedMetrics>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
<nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
<nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <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>
+ </processedMetrics>
+ <constantRowsCount>1</constantRowsCount>
<metricsGoal>
<nb_conversions>Conversions</nb_conversions>
<revenue>Revenue</revenue>
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__subtable__API.getProcessedReport_week.xml b/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__subtable__API.getProcessedReport_week.xml
index 1b53d25ac9..7279329235 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__subtable__API.getProcessedReport_week.xml
+++ b/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__subtable__API.getProcessedReport_week.xml
@@ -8,6 +8,7 @@
<module>Actions</module>
<action>getPageUrls</action>
<dimension>Page URL</dimension>
+ <documentation>This report contains information about the page URLs that have been visited. &lt;br /&gt; The table is organized hierarchically, the URLs are displayed as a folder structure.&lt;br /&gt;Use the plus and minus icons on the left to navigate.</documentation>
<metrics>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
@@ -24,7 +25,6 @@
<exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
<avg_time_generation>The average time it took to generate the page. This metric includes the time it took the server to generate the web page, plus the time it took for the visitor to download the response from the server. A lower 'Avg. generation time' means a faster website for your visitors!</avg_time_generation>
</metricsDocumentation>
- <documentation>This report contains information about the page URLs that have been visited. &lt;br /&gt; The table is organized hierarchically, the URLs are displayed as a folder structure.&lt;br /&gt;Use the plus and minus icons on the left to navigate.</documentation>
<actionToLoadSubTables>getPageUrls</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageUrls&amp;period=week&amp;date=2010-03-06&amp;idSubtable=</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageUrls&amp;period=week&amp;date=2009-08-10,2010-03-07&amp;idSubtable=</imageGraphEvolutionUrl>
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_hideColumns___API.getProcessedReport_day.xml b/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_hideColumns___API.getProcessedReport_day.xml
index 6b905f647f..fe3da65352 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_hideColumns___API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_hideColumns___API.getProcessedReport_day.xml
@@ -8,13 +8,13 @@
<module>Actions</module>
<action>getPageTitles</action>
<dimension>Page Name</dimension>
+ <documentation>This report contains information about the titles of the pages that have been visited. &lt;br /&gt; The page title is the HTML &lt;title&gt; Tag that most browsers show in their window title.</documentation>
<metrics>
<exit_rate>Exit rate</exit_rate>
</metrics>
<metricsDocumentation>
<exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
</metricsDocumentation>
- <documentation>This report contains information about the titles of the pages that have been visited. &lt;br /&gt; The page title is the HTML &lt;title&gt; Tag that most browsers show in their window title.</documentation>
<actionToLoadSubTables>getPageTitles</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageTitles&amp;period=day&amp;date=2010-03-06</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageTitles&amp;period=day&amp;date=2010-02-05,2010-03-06</imageGraphEvolutionUrl>
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_showColumnsWithProcessedMetrics___API.getProcessedReport_day.xml b/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_showColumnsWithProcessedMetrics___API.getProcessedReport_day.xml
index c204596614..1a1180bbff 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_showColumnsWithProcessedMetrics___API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_showColumnsWithProcessedMetrics___API.getProcessedReport_day.xml
@@ -9,13 +9,13 @@
<action>getVisitInformationPerServerTime</action>
<dimension>Server time</dimension>
<documentation>This graph shows what time it was in the &lt;strong&gt; server's time zone &lt;/strong&gt; during the visits.</documentation>
- <constantRowsCount>1</constantRowsCount>
<metrics>
<nb_visits>Visits</nb_visits>
</metrics>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
</metricsDocumentation>
+ <constantRowsCount>1</constantRowsCount>
<metricsGoal>
<nb_conversions>Conversions</nb_conversions>
<revenue>Revenue</revenue>
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_showColumns___API.getProcessedReport_day.xml b/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_showColumns___API.getProcessedReport_day.xml
index d63a5ec71c..6c94a197f7 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_showColumns___API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_showColumns___API.getProcessedReport_day.xml
@@ -8,6 +8,7 @@
<module>Actions</module>
<action>getPageTitles</action>
<dimension>Page Name</dimension>
+ <documentation>This report contains information about the titles of the pages that have been visited. &lt;br /&gt; The page title is the HTML &lt;title&gt; Tag that most browsers show in their window title.</documentation>
<metrics>
<nb_hits>Pageviews</nb_hits>
<bounce_rate>Bounce Rate</bounce_rate>
@@ -16,7 +17,6 @@
<nb_hits>The number of times this page was visited.</nb_hits>
<bounce_rate>The percentage of visits that started on this page and left the website straight away.</bounce_rate>
</metricsDocumentation>
- <documentation>This report contains information about the titles of the pages that have been visited. &lt;br /&gt; The page title is the HTML &lt;title&gt; Tag that most browsers show in their window title.</documentation>
<actionToLoadSubTables>getPageTitles</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageTitles&amp;period=day&amp;date=2010-03-06</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageTitles&amp;period=day&amp;date=2010-02-05,2010-03-06</imageGraphEvolutionUrl>
diff --git a/tests/PHPUnit/Integration/expected/test_RowEvolution_entryPageTitles__API.getRowEvolution_day.xml b/tests/PHPUnit/Integration/expected/test_RowEvolution_entryPageTitles__API.getRowEvolution_day.xml
index 27eb97f81e..e73ba39d1d 100644
--- a/tests/PHPUnit/Integration/expected/test_RowEvolution_entryPageTitles__API.getRowEvolution_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_RowEvolution_entryPageTitles__API.getRowEvolution_day.xml
@@ -110,6 +110,6 @@
<max>100</max>
</bounce_rate>
</metrics>
- <dimension>Page Name</dimension>
+ <dimension>Entry Page title</dimension>
</metadata>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageTitlesFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageTitlesFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_day.xml
index 2257d15106..e1254c611b 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageTitlesFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageTitlesFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_day.xml
@@ -8,6 +8,7 @@
<module>Actions</module>
<action>getPageTitlesFollowingSiteSearch</action>
<dimension>Destination Page</dimension>
+ <documentation>When visitors search on your website, they are looking for a particular page, content, product, or service. This report lists the pages that were clicked the most after an internal search. In other words, the list of pages the most searched for by visitors already on your website.&lt;br/&gt;Use the plus and minus icons on the left to navigate.</documentation>
<metrics>
<nb_hits_following_search>Clicked in search results</nb_hits_following_search>
<nb_hits>Total Pageviews</nb_hits>
@@ -16,7 +17,6 @@
<nb_hits_following_search>The number of times this Page was visited after a visitor did a search on your website, and clicked on this page in the search results.</nb_hits_following_search>
<nb_hits>The number of times this page was visited.</nb_hits>
</metricsDocumentation>
- <documentation>When visitors search on your website, they are looking for a particular page, content, product, or service. This report lists the pages that were clicked the most after an internal search. In other words, the list of pages the most searched for by visitors already on your website.&lt;br/&gt;Use the plus and minus icons on the left to navigate.</documentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageTitlesFollowingSiteSearch&amp;period=range&amp;date=2010-01-03,2010-01-09</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageTitlesFollowingSiteSearch&amp;period=day&amp;date=2010-01-03,2010-01-09</imageGraphEvolutionUrl>
<uniqueId>Actions_getPageTitlesFollowingSiteSearch</uniqueId>
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageTitlesFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_month.xml b/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageTitlesFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_month.xml
index ba0cfd4ca6..358b09c180 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageTitlesFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_month.xml
+++ b/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageTitlesFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_month.xml
@@ -8,6 +8,7 @@
<module>Actions</module>
<action>getPageTitlesFollowingSiteSearch</action>
<dimension>Destination Page</dimension>
+ <documentation>When visitors search on your website, they are looking for a particular page, content, product, or service. This report lists the pages that were clicked the most after an internal search. In other words, the list of pages the most searched for by visitors already on your website.&lt;br/&gt;Use the plus and minus icons on the left to navigate.</documentation>
<metrics>
<nb_hits_following_search>Clicked in search results</nb_hits_following_search>
<nb_hits>Total Pageviews</nb_hits>
@@ -16,7 +17,6 @@
<nb_hits_following_search>The number of times this Page was visited after a visitor did a search on your website, and clicked on this page in the search results.</nb_hits_following_search>
<nb_hits>The number of times this page was visited.</nb_hits>
</metricsDocumentation>
- <documentation>When visitors search on your website, they are looking for a particular page, content, product, or service. This report lists the pages that were clicked the most after an internal search. In other words, the list of pages the most searched for by visitors already on your website.&lt;br/&gt;Use the plus and minus icons on the left to navigate.</documentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageTitlesFollowingSiteSearch&amp;period=range&amp;date=2010-01-03,2010-07-03</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageTitlesFollowingSiteSearch&amp;period=month&amp;date=2010-01-03,2010-07-03</imageGraphEvolutionUrl>
<uniqueId>Actions_getPageTitlesFollowingSiteSearch</uniqueId>
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml
index 4fddcb23fb..c1f7037343 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml
@@ -8,6 +8,7 @@
<module>Actions</module>
<action>getPageTitles</action>
<dimension>Page Name</dimension>
+ <documentation>This report contains information about the titles of the pages that have been visited. &lt;br /&gt; The page title is the HTML &lt;title&gt; Tag that most browsers show in their window title.</documentation>
<metrics>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
@@ -24,7 +25,6 @@
<exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
<avg_time_generation>The average time it took to generate the page. This metric includes the time it took the server to generate the web page, plus the time it took for the visitor to download the response from the server. A lower 'Avg. generation time' means a faster website for your visitors!</avg_time_generation>
</metricsDocumentation>
- <documentation>This report contains information about the titles of the pages that have been visited. &lt;br /&gt; The page title is the HTML &lt;title&gt; Tag that most browsers show in their window title.</documentation>
<actionToLoadSubTables>getPageTitles</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageTitles&amp;period=range&amp;date=2010-01-03,2010-01-09</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageTitles&amp;period=day&amp;date=2010-01-03,2010-01-09</imageGraphEvolutionUrl>
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_month.xml b/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_month.xml
index fc5ea10e47..33516984c8 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_month.xml
+++ b/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_month.xml
@@ -8,6 +8,7 @@
<module>Actions</module>
<action>getPageTitles</action>
<dimension>Page Name</dimension>
+ <documentation>This report contains information about the titles of the pages that have been visited. &lt;br /&gt; The page title is the HTML &lt;title&gt; Tag that most browsers show in their window title.</documentation>
<metrics>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
@@ -24,7 +25,6 @@
<exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
<avg_time_generation>The average time it took to generate the page. This metric includes the time it took the server to generate the web page, plus the time it took for the visitor to download the response from the server. A lower 'Avg. generation time' means a faster website for your visitors!</avg_time_generation>
</metricsDocumentation>
- <documentation>This report contains information about the titles of the pages that have been visited. &lt;br /&gt; The page title is the HTML &lt;title&gt; Tag that most browsers show in their window title.</documentation>
<actionToLoadSubTables>getPageTitles</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageTitles&amp;period=range&amp;date=2010-01-03,2010-07-03</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageTitles&amp;period=month&amp;date=2010-01-03,2010-07-03</imageGraphEvolutionUrl>
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageUrlsFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageUrlsFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_day.xml
index 267fc71a02..a139b8c186 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageUrlsFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageUrlsFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_day.xml
@@ -8,6 +8,7 @@
<module>Actions</module>
<action>getPageUrlsFollowingSiteSearch</action>
<dimension>Destination Page</dimension>
+ <documentation>When visitors search on your website, they are looking for a particular page, content, product, or service. This report lists the pages that were clicked the most after an internal search. In other words, the list of pages the most searched for by visitors already on your website.&lt;br/&gt;Use the plus and minus icons on the left to navigate.</documentation>
<metrics>
<nb_hits_following_search>Clicked in search results</nb_hits_following_search>
<nb_hits>Total Pageviews</nb_hits>
@@ -16,7 +17,6 @@
<nb_hits_following_search>The number of times this Page was visited after a visitor did a search on your website, and clicked on this page in the search results.</nb_hits_following_search>
<nb_hits>The number of times this page was visited.</nb_hits>
</metricsDocumentation>
- <documentation>When visitors search on your website, they are looking for a particular page, content, product, or service. This report lists the pages that were clicked the most after an internal search. In other words, the list of pages the most searched for by visitors already on your website.&lt;br/&gt;Use the plus and minus icons on the left to navigate.</documentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageUrlsFollowingSiteSearch&amp;period=range&amp;date=2010-01-03,2010-01-09</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageUrlsFollowingSiteSearch&amp;period=day&amp;date=2010-01-03,2010-01-09</imageGraphEvolutionUrl>
<uniqueId>Actions_getPageUrlsFollowingSiteSearch</uniqueId>
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageUrlsFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_month.xml b/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageUrlsFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_month.xml
index 891b6485a6..ddbfc27323 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageUrlsFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_month.xml
+++ b/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageUrlsFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_month.xml
@@ -8,6 +8,7 @@
<module>Actions</module>
<action>getPageUrlsFollowingSiteSearch</action>
<dimension>Destination Page</dimension>
+ <documentation>When visitors search on your website, they are looking for a particular page, content, product, or service. This report lists the pages that were clicked the most after an internal search. In other words, the list of pages the most searched for by visitors already on your website.&lt;br/&gt;Use the plus and minus icons on the left to navigate.</documentation>
<metrics>
<nb_hits_following_search>Clicked in search results</nb_hits_following_search>
<nb_hits>Total Pageviews</nb_hits>
@@ -16,7 +17,6 @@
<nb_hits_following_search>The number of times this Page was visited after a visitor did a search on your website, and clicked on this page in the search results.</nb_hits_following_search>
<nb_hits>The number of times this page was visited.</nb_hits>
</metricsDocumentation>
- <documentation>When visitors search on your website, they are looking for a particular page, content, product, or service. This report lists the pages that were clicked the most after an internal search. In other words, the list of pages the most searched for by visitors already on your website.&lt;br/&gt;Use the plus and minus icons on the left to navigate.</documentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageUrlsFollowingSiteSearch&amp;period=range&amp;date=2010-01-03,2010-07-03</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageUrlsFollowingSiteSearch&amp;period=month&amp;date=2010-01-03,2010-07-03</imageGraphEvolutionUrl>
<uniqueId>Actions_getPageUrlsFollowingSiteSearch</uniqueId>
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_day.xml
index afc1d09316..3778066188 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_day.xml
@@ -8,6 +8,7 @@
<module>Actions</module>
<action>getPageUrls</action>
<dimension>Page URL</dimension>
+ <documentation>This report contains information about the page URLs that have been visited. &lt;br /&gt; The table is organized hierarchically, the URLs are displayed as a folder structure.&lt;br /&gt;Use the plus and minus icons on the left to navigate.</documentation>
<metrics>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
@@ -24,7 +25,6 @@
<exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
<avg_time_generation>The average time it took to generate the page. This metric includes the time it took the server to generate the web page, plus the time it took for the visitor to download the response from the server. A lower 'Avg. generation time' means a faster website for your visitors!</avg_time_generation>
</metricsDocumentation>
- <documentation>This report contains information about the page URLs that have been visited. &lt;br /&gt; The table is organized hierarchically, the URLs are displayed as a folder structure.&lt;br /&gt;Use the plus and minus icons on the left to navigate.</documentation>
<actionToLoadSubTables>getPageUrls</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageUrls&amp;period=range&amp;date=2010-01-03,2010-01-09</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageUrls&amp;period=day&amp;date=2010-01-03,2010-01-09</imageGraphEvolutionUrl>
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_month.xml b/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_month.xml
index 2e1f0405ff..c4d5795571 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_month.xml
+++ b/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_month.xml
@@ -8,6 +8,7 @@
<module>Actions</module>
<action>getPageUrls</action>
<dimension>Page URL</dimension>
+ <documentation>This report contains information about the page URLs that have been visited. &lt;br /&gt; The table is organized hierarchically, the URLs are displayed as a folder structure.&lt;br /&gt;Use the plus and minus icons on the left to navigate.</documentation>
<metrics>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
@@ -24,7 +25,6 @@
<exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
<avg_time_generation>The average time it took to generate the page. This metric includes the time it took the server to generate the web page, plus the time it took for the visitor to download the response from the server. A lower 'Avg. generation time' means a faster website for your visitors!</avg_time_generation>
</metricsDocumentation>
- <documentation>This report contains information about the page URLs that have been visited. &lt;br /&gt; The table is organized hierarchically, the URLs are displayed as a folder structure.&lt;br /&gt;Use the plus and minus icons on the left to navigate.</documentation>
<actionToLoadSubTables>getPageUrls</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageUrls&amp;period=range&amp;date=2010-01-03,2010-07-03</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageUrls&amp;period=month&amp;date=2010-01-03,2010-07-03</imageGraphEvolutionUrl>
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchCategories_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchCategories_firstSite_lastN__API.getProcessedReport_day.xml
index 9f2dac1197..48dec5534c 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchCategories_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchCategories_firstSite_lastN__API.getProcessedReport_day.xml
@@ -8,6 +8,7 @@
<module>Actions</module>
<action>getSiteSearchCategories</action>
<dimension>Search Category</dimension>
+ <documentation>This report lists the Categories that visitors selected when they made a Search on your website.&lt;br/&gt;For example, Ecommerce websites typically have a &quot;Category&quot; selector so that visitors can restrict their searches to all products in a specific Category.</documentation>
<metrics>
<nb_visits>Searches</nb_visits>
<nb_pages_per_search>Search Results pages</nb_pages_per_search>
@@ -18,7 +19,6 @@
<nb_pages_per_search>Visitors will search on your website, and sometimes click &quot;next&quot; to view more results. This is the average number of search results pages viewed for this keyword.</nb_pages_per_search>
<exit_rate>The percentage of visits that left the website after searching for this Keyword on your Site Search engine.</exit_rate>
</metricsDocumentation>
- <documentation>This report lists the Categories that visitors selected when they made a Search on your website.&lt;br/&gt;For example, Ecommerce websites typically have a &quot;Category&quot; selector so that visitors can restrict their searches to all products in a specific Category.</documentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getSiteSearchCategories&amp;period=range&amp;date=2010-01-03,2010-01-09</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getSiteSearchCategories&amp;period=day&amp;date=2010-01-03,2010-01-09</imageGraphEvolutionUrl>
<uniqueId>Actions_getSiteSearchCategories</uniqueId>
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchCategories_firstSite_lastN__API.getProcessedReport_month.xml b/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchCategories_firstSite_lastN__API.getProcessedReport_month.xml
index 76f0c59e99..cb33390062 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchCategories_firstSite_lastN__API.getProcessedReport_month.xml
+++ b/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchCategories_firstSite_lastN__API.getProcessedReport_month.xml
@@ -8,6 +8,7 @@
<module>Actions</module>
<action>getSiteSearchCategories</action>
<dimension>Search Category</dimension>
+ <documentation>This report lists the Categories that visitors selected when they made a Search on your website.&lt;br/&gt;For example, Ecommerce websites typically have a &quot;Category&quot; selector so that visitors can restrict their searches to all products in a specific Category.</documentation>
<metrics>
<nb_visits>Searches</nb_visits>
<nb_pages_per_search>Search Results pages</nb_pages_per_search>
@@ -18,7 +19,6 @@
<nb_pages_per_search>Visitors will search on your website, and sometimes click &quot;next&quot; to view more results. This is the average number of search results pages viewed for this keyword.</nb_pages_per_search>
<exit_rate>The percentage of visits that left the website after searching for this Keyword on your Site Search engine.</exit_rate>
</metricsDocumentation>
- <documentation>This report lists the Categories that visitors selected when they made a Search on your website.&lt;br/&gt;For example, Ecommerce websites typically have a &quot;Category&quot; selector so that visitors can restrict their searches to all products in a specific Category.</documentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getSiteSearchCategories&amp;period=range&amp;date=2010-01-03,2010-07-03</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getSiteSearchCategories&amp;period=month&amp;date=2010-01-03,2010-07-03</imageGraphEvolutionUrl>
<uniqueId>Actions_getSiteSearchCategories</uniqueId>
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchKeywords_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchKeywords_firstSite_lastN__API.getProcessedReport_day.xml
index f54f55fa27..84b4b19ea1 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchKeywords_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchKeywords_firstSite_lastN__API.getProcessedReport_day.xml
@@ -8,6 +8,7 @@
<module>Actions</module>
<action>getSiteSearchKeywords</action>
<dimension>Keyword</dimension>
+ <documentation>This report lists the Search Keywords that visitors searched for on your internal Search Engine.&lt;br/&gt;&lt;br/&gt;Tracking searches that visitors make on your website is a very effective way to learn more about what your audience is looking for, it can help find ideas for new content, new Ecommerce products that potential customers might be searching for, and generally improve the visitors' experience on your website.&lt;br/&gt;&lt;br/&gt;&lt;a href=&quot;http://piwik.org/docs/site-search/&quot; target=&quot;_blank&quot;&gt;Learn more about Tracking how your visitors use your Search engine.&lt;/a&gt;</documentation>
<metrics>
<nb_visits>Searches</nb_visits>
<nb_pages_per_search>Search Results pages</nb_pages_per_search>
@@ -18,7 +19,6 @@
<nb_pages_per_search>Visitors will search on your website, and sometimes click &quot;next&quot; to view more results. This is the average number of search results pages viewed for this keyword.</nb_pages_per_search>
<exit_rate>The percentage of visits that left the website after searching for this Keyword on your Site Search engine.</exit_rate>
</metricsDocumentation>
- <documentation>This report lists the Search Keywords that visitors searched for on your internal Search Engine.&lt;br/&gt;&lt;br/&gt;Tracking searches that visitors make on your website is a very effective way to learn more about what your audience is looking for, it can help find ideas for new content, new Ecommerce products that potential customers might be searching for, and generally improve the visitors' experience on your website.&lt;br/&gt;&lt;br/&gt;&lt;a href=&quot;http://piwik.org/docs/site-search/&quot; target=&quot;_blank&quot;&gt;Learn more about Tracking how your visitors use your Search engine.&lt;/a&gt;</documentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getSiteSearchKeywords&amp;period=range&amp;date=2010-01-03,2010-01-09</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getSiteSearchKeywords&amp;period=day&amp;date=2010-01-03,2010-01-09</imageGraphEvolutionUrl>
<uniqueId>Actions_getSiteSearchKeywords</uniqueId>
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchKeywords_firstSite_lastN__API.getProcessedReport_month.xml b/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchKeywords_firstSite_lastN__API.getProcessedReport_month.xml
index 224ae8f903..133ef2f538 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchKeywords_firstSite_lastN__API.getProcessedReport_month.xml
+++ b/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchKeywords_firstSite_lastN__API.getProcessedReport_month.xml
@@ -8,6 +8,7 @@
<module>Actions</module>
<action>getSiteSearchKeywords</action>
<dimension>Keyword</dimension>
+ <documentation>This report lists the Search Keywords that visitors searched for on your internal Search Engine.&lt;br/&gt;&lt;br/&gt;Tracking searches that visitors make on your website is a very effective way to learn more about what your audience is looking for, it can help find ideas for new content, new Ecommerce products that potential customers might be searching for, and generally improve the visitors' experience on your website.&lt;br/&gt;&lt;br/&gt;&lt;a href=&quot;http://piwik.org/docs/site-search/&quot; target=&quot;_blank&quot;&gt;Learn more about Tracking how your visitors use your Search engine.&lt;/a&gt;</documentation>
<metrics>
<nb_visits>Searches</nb_visits>
<nb_pages_per_search>Search Results pages</nb_pages_per_search>
@@ -18,7 +19,6 @@
<nb_pages_per_search>Visitors will search on your website, and sometimes click &quot;next&quot; to view more results. This is the average number of search results pages viewed for this keyword.</nb_pages_per_search>
<exit_rate>The percentage of visits that left the website after searching for this Keyword on your Site Search engine.</exit_rate>
</metricsDocumentation>
- <documentation>This report lists the Search Keywords that visitors searched for on your internal Search Engine.&lt;br/&gt;&lt;br/&gt;Tracking searches that visitors make on your website is a very effective way to learn more about what your audience is looking for, it can help find ideas for new content, new Ecommerce products that potential customers might be searching for, and generally improve the visitors' experience on your website.&lt;br/&gt;&lt;br/&gt;&lt;a href=&quot;http://piwik.org/docs/site-search/&quot; target=&quot;_blank&quot;&gt;Learn more about Tracking how your visitors use your Search engine.&lt;/a&gt;</documentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getSiteSearchKeywords&amp;period=range&amp;date=2010-01-03,2010-07-03</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getSiteSearchKeywords&amp;period=month&amp;date=2010-01-03,2010-07-03</imageGraphEvolutionUrl>
<uniqueId>Actions_getSiteSearchKeywords</uniqueId>
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchNoResultKeywords_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchNoResultKeywords_firstSite_lastN__API.getProcessedReport_day.xml
index c470b54e87..e52d6cd8f3 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchNoResultKeywords_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchNoResultKeywords_firstSite_lastN__API.getProcessedReport_day.xml
@@ -8,6 +8,7 @@
<module>Actions</module>
<action>getSiteSearchNoResultKeywords</action>
<dimension>Keyword with No Search Result</dimension>
+ <documentation>Tracking searches that visitors make on your website is a very effective way to learn more about what your audience is looking for, it can help find ideas for new content, new Ecommerce products that potential customers might be searching for, and generally improve the visitors' experience on your website.&lt;br /&gt;&lt;br /&gt;This report lists the Search Keywords that did not return any Search result: maybe the search engine algorithm can be improved, or maybe your visitors are looking for content that is not (yet) on your website?</documentation>
<metrics>
<nb_visits>Searches</nb_visits>
<exit_rate>% Search Exits</exit_rate>
@@ -16,7 +17,6 @@
<nb_visits>The number of visits that searched for this keyword on your website's search engine.</nb_visits>
<exit_rate>The percentage of visits that left the website after searching for this Keyword on your Site Search engine.</exit_rate>
</metricsDocumentation>
- <documentation>Tracking searches that visitors make on your website is a very effective way to learn more about what your audience is looking for, it can help find ideas for new content, new Ecommerce products that potential customers might be searching for, and generally improve the visitors' experience on your website.&lt;br /&gt;&lt;br /&gt;This report lists the Search Keywords that did not return any Search result: maybe the search engine algorithm can be improved, or maybe your visitors are looking for content that is not (yet) on your website?</documentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getSiteSearchNoResultKeywords&amp;period=range&amp;date=2010-01-03,2010-01-09</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getSiteSearchNoResultKeywords&amp;period=day&amp;date=2010-01-03,2010-01-09</imageGraphEvolutionUrl>
<uniqueId>Actions_getSiteSearchNoResultKeywords</uniqueId>
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchNoResultKeywords_firstSite_lastN__API.getProcessedReport_month.xml b/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchNoResultKeywords_firstSite_lastN__API.getProcessedReport_month.xml
index e24254261c..63ba94eaf9 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchNoResultKeywords_firstSite_lastN__API.getProcessedReport_month.xml
+++ b/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchNoResultKeywords_firstSite_lastN__API.getProcessedReport_month.xml
@@ -8,6 +8,7 @@
<module>Actions</module>
<action>getSiteSearchNoResultKeywords</action>
<dimension>Keyword with No Search Result</dimension>
+ <documentation>Tracking searches that visitors make on your website is a very effective way to learn more about what your audience is looking for, it can help find ideas for new content, new Ecommerce products that potential customers might be searching for, and generally improve the visitors' experience on your website.&lt;br /&gt;&lt;br /&gt;This report lists the Search Keywords that did not return any Search result: maybe the search engine algorithm can be improved, or maybe your visitors are looking for content that is not (yet) on your website?</documentation>
<metrics>
<nb_visits>Searches</nb_visits>
<exit_rate>% Search Exits</exit_rate>
@@ -16,7 +17,6 @@
<nb_visits>The number of visits that searched for this keyword on your website's search engine.</nb_visits>
<exit_rate>The percentage of visits that left the website after searching for this Keyword on your Site Search engine.</exit_rate>
</metricsDocumentation>
- <documentation>Tracking searches that visitors make on your website is a very effective way to learn more about what your audience is looking for, it can help find ideas for new content, new Ecommerce products that potential customers might be searching for, and generally improve the visitors' experience on your website.&lt;br /&gt;&lt;br /&gt;This report lists the Search Keywords that did not return any Search result: maybe the search engine algorithm can be improved, or maybe your visitors are looking for content that is not (yet) on your website?</documentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getSiteSearchNoResultKeywords&amp;period=range&amp;date=2010-01-03,2010-07-03</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getSiteSearchNoResultKeywords&amp;period=month&amp;date=2010-01-03,2010-07-03</imageGraphEvolutionUrl>
<uniqueId>Actions_getSiteSearchNoResultKeywords</uniqueId>
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/Integration/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_day.xml
index 2091e19992..1e7e2b8d0c 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_day.xml
@@ -7,7 +7,6 @@
<name>Custom Variables</name>
<module>CustomVariables</module>
<action>getCustomVariables</action>
- <actionToLoadSubTables>getCustomVariablesValuesFromNameId</actionToLoadSubTables>
<dimension>Custom Variable name</dimension>
<documentation>This report contains information about your Custom Variables. Click on a variable name to see the distribution of the values. &lt;br /&gt; For more information about Custom Variables in general, read the &lt;a href=&quot;http://piwik.org/docs/custom-variables/&quot; target=&quot;_blank&quot;&gt;Custom Variables documentation on piwik.org&lt;/a&gt;</documentation>
<metrics>
@@ -15,23 +14,17 @@
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
- <processedMetrics>
- <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>
- </processedMetrics>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
<nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
<nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <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>
+ </processedMetrics>
+ <actionToLoadSubTables>getCustomVariablesValuesFromNameId</actionToLoadSubTables>
<metricsGoal>
<nb_conversions>Conversions</nb_conversions>
<revenue>Revenue</revenue>
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_month.xml b/tests/PHPUnit/Integration/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_month.xml
index 8b0c92adf2..a34a4ccc8f 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_month.xml
+++ b/tests/PHPUnit/Integration/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_month.xml
@@ -7,30 +7,23 @@
<name>Custom Variables</name>
<module>CustomVariables</module>
<action>getCustomVariables</action>
- <actionToLoadSubTables>getCustomVariablesValuesFromNameId</actionToLoadSubTables>
<dimension>Custom Variable name</dimension>
<documentation>This report contains information about your Custom Variables. Click on a variable name to see the distribution of the values. &lt;br /&gt; For more information about Custom Variables in general, read the &lt;a href=&quot;http://piwik.org/docs/custom-variables/&quot; target=&quot;_blank&quot;&gt;Custom Variables documentation on piwik.org&lt;/a&gt;</documentation>
<metrics>
<nb_visits>Visits</nb_visits>
<nb_actions>Actions</nb_actions>
</metrics>
- <processedMetrics>
- <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>
- </processedMetrics>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
<nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
<nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <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>
+ </processedMetrics>
+ <actionToLoadSubTables>getCustomVariablesValuesFromNameId</actionToLoadSubTables>
<metricsGoal>
<nb_conversions>Conversions</nb_conversions>
<revenue>Revenue</revenue>
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getOutlinks_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getOutlinks_firstSite_lastN__API.getProcessedReport_day.xml
index f6fbe6a31a..85885d4462 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getOutlinks_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getOutlinks_firstSite_lastN__API.getProcessedReport_day.xml
@@ -8,6 +8,7 @@
<module>Actions</module>
<action>getOutlinks</action>
<dimension>Clicked URL</dimension>
+ <documentation>This report shows a hierarchical list of outlink URLs that were clicked by your visitors. An outlink is a link that leads the visitor away from your website (to another domain).&lt;br /&gt;Use the plus and minus icons on the left to navigate.</documentation>
<metrics>
<nb_visits>Unique Clicks</nb_visits>
<nb_hits>Clicks</nb_hits>
@@ -16,7 +17,6 @@
<nb_visits>The number of visits that involved a click on this link. If a link was clicked multiple times during one visit, it is only counted once.</nb_visits>
<nb_hits>The number of times this link was clicked.</nb_hits>
</metricsDocumentation>
- <documentation>This report shows a hierarchical list of outlink URLs that were clicked by your visitors. An outlink is a link that leads the visitor away from your website (to another domain).&lt;br /&gt;Use the plus and minus icons on the left to navigate.</documentation>
<actionToLoadSubTables>getOutlinks</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getOutlinks&amp;period=range&amp;date=2010-01-03,2010-01-09</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getOutlinks&amp;period=day&amp;date=2010-01-03,2010-01-09</imageGraphEvolutionUrl>
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml
index 3fdf8404b4..7d8be22272 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml
@@ -8,6 +8,7 @@
<module>Actions</module>
<action>getPageTitles</action>
<dimension>Page Name</dimension>
+ <documentation>This report contains information about the titles of the pages that have been visited. &lt;br /&gt; The page title is the HTML &lt;title&gt; Tag that most browsers show in their window title.</documentation>
<metrics>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
@@ -24,7 +25,6 @@
<exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
<avg_time_generation>The average time it took to generate the page. This metric includes the time it took the server to generate the web page, plus the time it took for the visitor to download the response from the server. A lower 'Avg. generation time' means a faster website for your visitors!</avg_time_generation>
</metricsDocumentation>
- <documentation>This report contains information about the titles of the pages that have been visited. &lt;br /&gt; The page title is the HTML &lt;title&gt; Tag that most browsers show in their window title.</documentation>
<actionToLoadSubTables>getPageTitles</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageTitles&amp;period=range&amp;date=2010-01-03,2010-01-09</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageTitles&amp;period=day&amp;date=2010-01-03,2010-01-09</imageGraphEvolutionUrl>
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_day.xml
index 08ce9a57b0..dfccc81659 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_day.xml
@@ -8,6 +8,7 @@
<module>Actions</module>
<action>getPageUrls</action>
<dimension>Page URL</dimension>
+ <documentation>This report contains information about the page URLs that have been visited. &lt;br /&gt; The table is organized hierarchically, the URLs are displayed as a folder structure.&lt;br /&gt;Use the plus and minus icons on the left to navigate.</documentation>
<metrics>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
@@ -24,7 +25,6 @@
<exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
<avg_time_generation>The average time it took to generate the page. This metric includes the time it took the server to generate the web page, plus the time it took for the visitor to download the response from the server. A lower 'Avg. generation time' means a faster website for your visitors!</avg_time_generation>
</metricsDocumentation>
- <documentation>This report contains information about the page URLs that have been visited. &lt;br /&gt; The table is organized hierarchically, the URLs are displayed as a folder structure.&lt;br /&gt;Use the plus and minus icons on the left to navigate.</documentation>
<actionToLoadSubTables>getPageUrls</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageUrls&amp;period=range&amp;date=2010-01-03,2010-01-09</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageUrls&amp;period=day&amp;date=2010-01-03,2010-01-09</imageGraphEvolutionUrl>
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_MultiSites.getAll_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_MultiSites.getAll_firstSite_lastN__API.getProcessedReport_day.xml
index ccdae6dd68..31f9f11927 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_MultiSites.getAll_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_MultiSites.getAll_firstSite_lastN__API.getProcessedReport_day.xml
@@ -26,15 +26,8 @@
</metrics>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
<nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
+ <nb_pageviews>The number of times this page was visited.</nb_pageviews>
</metricsDocumentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=MultiSites&amp;apiAction=getAll&amp;period=range&amp;date=2010-01-03,2010-01-09</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=MultiSites&amp;apiAction=getAll&amp;period=day&amp;date=2010-01-03,2010-01-09</imageGraphEvolutionUrl>
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Referrers.getWebsites_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Referrers.getWebsites_firstSite_lastN__API.getProcessedReport_day.xml
index 04bde10b70..59aea854d4 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Referrers.getWebsites_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Referrers.getWebsites_firstSite_lastN__API.getProcessedReport_day.xml
@@ -9,29 +9,22 @@
<action>getWebsites</action>
<dimension>Website</dimension>
<documentation>In this table, you can see which websites referred visitors to your site. &lt;br /&gt; By clicking on a row in the table, you can see which URLs the links to your website were on.</documentation>
- <actionToLoadSubTables>getUrlsFromWebsiteId</actionToLoadSubTables>
<metrics>
<nb_visits>Visits</nb_visits>
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
- <processedMetrics>
- <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>
- </processedMetrics>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
<nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
<nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <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>
+ </processedMetrics>
+ <actionToLoadSubTables>getUrlsFromWebsiteId</actionToLoadSubTables>
<metricsGoal>
<nb_conversions>Conversions</nb_conversions>
<revenue>Revenue</revenue>
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_VisitFrequency.get_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_VisitFrequency.get_firstSite_lastN__API.getProcessedReport_day.xml
index 8e79d6b766..fa28a54c25 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_VisitFrequency.get_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_VisitFrequency.get_firstSite_lastN__API.getProcessedReport_day.xml
@@ -15,18 +15,6 @@
<nb_actions_per_visit_returning>Avg. Actions per Returning Visit</nb_actions_per_visit_returning>
<nb_uniq_visitors_returning>Unique returning visitors</nb_uniq_visitors_returning>
</metrics>
- <metricsDocumentation>
- <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
- <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
- </metricsDocumentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=VisitFrequency&amp;apiAction=get&amp;period=day&amp;date=2010-01-03,2010-01-09</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=VisitFrequency&amp;apiAction=get&amp;period=day&amp;date=2010-01-03,2010-01-09</imageGraphEvolutionUrl>
<uniqueId>VisitFrequency_get</uniqueId>
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_VisitorInterest.getNumberOfVisitsByDaysSinceLast_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_VisitorInterest.getNumberOfVisitsByDaysSinceLast_firstSite_lastN__API.getProcessedReport_day.xml
index 0c7dae5507..0cfdf60b49 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_VisitorInterest.getNumberOfVisitsByDaysSinceLast_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_VisitorInterest.getNumberOfVisitsByDaysSinceLast_firstSite_lastN__API.getProcessedReport_day.xml
@@ -8,23 +8,14 @@
<module>VisitorInterest</module>
<action>getNumberOfVisitsByDaysSinceLast</action>
<dimension>Visits by days since last visit</dimension>
+ <documentation>In this report, you can see how many visits were from visitors whose last visit was a certain number of days ago.</documentation>
<metrics>
<nb_visits>Visits</nb_visits>
</metrics>
- <constantRowsCount>1</constantRowsCount>
- <documentation>In this report, you can see how many visits were from visitors whose last visit was a certain number of days ago.</documentation>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
- <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
</metricsDocumentation>
+ <constantRowsCount>1</constantRowsCount>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=VisitorInterest&amp;apiAction=getNumberOfVisitsByDaysSinceLast&amp;period=range&amp;date=2010-01-03,2010-01-09</imageGraphUrl>
<uniqueId>VisitorInterest_getNumberOfVisitsByDaysSinceLast</uniqueId>
</metadata>
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_VisitsSummary.get_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_VisitsSummary.get_firstSite_lastN__API.getProcessedReport_day.xml
index 358f9e9937..ea77225478 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_VisitsSummary.get_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_VisitsSummary.get_firstSite_lastN__API.getProcessedReport_day.xml
@@ -17,16 +17,12 @@
<max_actions>Maximum actions in one visit</max_actions>
</metrics>
<metricsDocumentation>
- <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
<nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
+ <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
<nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
<nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
<bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
+ <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
</metricsDocumentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=VisitsSummary&amp;apiAction=get&amp;period=day&amp;date=2010-01-03,2010-01-09</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=VisitsSummary&amp;apiAction=get&amp;period=day&amp;date=2010-01-03,2010-01-09</imageGraphEvolutionUrl>
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_month.original.html b/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_month.original.html
index e1906cdab3..e2fc4d6505 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_month.original.html
+++ b/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_month.original.html
@@ -3216,7 +3216,7 @@
<table style="border-collapse:collapse; margin-left: 5px;">
<thead style="background-color: rgb(228,226,215); color: rgb(37,87,146); font-size: 11pt;">
<th style="padding: 6px 0;">
- &nbsp;Page URL&nbsp;&nbsp;
+ &nbsp;Entry Page URL&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
&nbsp;Entrances&nbsp;&nbsp;
@@ -3276,7 +3276,7 @@
<table style="border-collapse:collapse; margin-left: 5px;">
<thead style="background-color: rgb(228,226,215); color: rgb(37,87,146); font-size: 11pt;">
<th style="padding: 6px 0;">
- &nbsp;Page URL&nbsp;&nbsp;
+ &nbsp;Exit Page URL&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
&nbsp;Exits&nbsp;&nbsp;
@@ -3465,7 +3465,7 @@
<table style="border-collapse:collapse; margin-left: 5px;">
<thead style="background-color: rgb(228,226,215); color: rgb(37,87,146); font-size: 11pt;">
<th style="padding: 6px 0;">
- &nbsp;Page Name&nbsp;&nbsp;
+ &nbsp;Entry Page title&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
&nbsp;Entrances&nbsp;&nbsp;
@@ -3521,7 +3521,7 @@
<table style="border-collapse:collapse; margin-left: 5px;">
<thead style="background-color: rgb(228,226,215); color: rgb(37,87,146); font-size: 11pt;">
<th style="padding: 6px 0;">
- &nbsp;Page Name&nbsp;&nbsp;
+ &nbsp;Exit Page Title&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
&nbsp;Exits&nbsp;&nbsp;
diff --git a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getDefaultMetricTranslations.xml b/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getDefaultMetricTranslations.xml
index 8bbfb4595d..9c4cfa7941 100644
--- a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getDefaultMetricTranslations.xml
+++ b/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getDefaultMetricTranslations.xml
@@ -35,11 +35,38 @@
<sum_daily_exit_nb_uniq_visitors>Unique exits (daily sum)</sum_daily_exit_nb_uniq_visitors>
<entry_nb_actions>Actions after entering here</entry_nb_actions>
<entry_sum_visit_length>Total time spent by visitors (in seconds) after entering here</entry_sum_visit_length>
+ <nb_pageviews>Pageviews</nb_pageviews>
+ <nb_uniq_pageviews>Unique Pageviews</nb_uniq_pageviews>
+ <nb_downloads>Downloads</nb_downloads>
+ <nb_uniq_downloads>Unique Downloads</nb_uniq_downloads>
+ <nb_outlinks>Outlinks</nb_outlinks>
+ <nb_uniq_outlinks>Unique Outlinks</nb_uniq_outlinks>
+ <nb_searches>Searches</nb_searches>
+ <nb_keywords>Unique Keywords</nb_keywords>
+ <avg_time_generation>Avg. generation time</avg_time_generation>
+ <nb_pages_per_search>Search Results pages</nb_pages_per_search>
+ <nb_hits_following_search>Clicked in search results</nb_hits_following_search>
<nb_events>Total events</nb_events>
<sum_event_value>Total value</sum_event_value>
<min_event_value>Minimum value</min_event_value>
<max_event_value>Maximum value</max_event_value>
<avg_event_value>Average value</avg_event_value>
<nb_events_with_value>Events with a value</nb_events_with_value>
+ <orders>Ecommerce Orders</orders>
+ <ecommerce_revenue>Product Revenue</ecommerce_revenue>
+ <visits_evolution>Visits Evolution</visits_evolution>
+ <actions_evolution>Actions Evolution</actions_evolution>
+ <pageviews_evolution>Pageviews Evolution</pageviews_evolution>
+ <revenue_evolution>Revenue Evolution</revenue_evolution>
+ <nb_conversions_evolution>Conversions Evolution</nb_conversions_evolution>
+ <orders_evolution>Ecommerce Orders Evolution</orders_evolution>
+ <ecommerce_revenue_evolution>Product Revenue Evolution</ecommerce_revenue_evolution>
+ <nb_visits_percentage>% Visits</nb_visits_percentage>
+ <nb_visits_returning>Returning Visits</nb_visits_returning>
+ <nb_actions_returning>Actions by Returning Visits</nb_actions_returning>
+ <avg_time_on_site_returning>Avg. Duration of a Returning Visit (in sec)</avg_time_on_site_returning>
+ <bounce_rate_returning>Bounce Rate for Returning Visits</bounce_rate_returning>
+ <nb_actions_per_visit_returning>Avg. Actions per Returning Visit</nb_actions_per_visit_returning>
+ <nb_uniq_visitors_returning>Unique returning visitors</nb_uniq_visitors_returning>
</row>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getMetadata_day.xml b/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getMetadata_day.xml
index 799f4d89e4..c495e00070 100644
--- a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getMetadata_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getMetadata_day.xml
@@ -6,28 +6,22 @@
<module>UserCountry</module>
<action>getCountry</action>
<dimension>Country</dimension>
+ <documentation>This report shows which country your visitors were in when they accessed your website.</documentation>
<metrics>
<nb_visits>Visits</nb_visits>
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
- <processedMetrics>
- <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>
- </processedMetrics>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
<nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
<nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <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>
+ </processedMetrics>
<metricsGoal>
<nb_conversions>Conversions</nb_conversions>
<revenue>Revenue</revenue>
diff --git a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getProcessedReport_day.xml b/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getProcessedReport_day.xml
index 8673e95066..f08e134ae6 100644
--- a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getProcessedReport_day.xml
@@ -8,28 +8,22 @@
<module>UserCountry</module>
<action>getCountry</action>
<dimension>Country</dimension>
+ <documentation>This report shows which country your visitors were in when they accessed your website.</documentation>
<metrics>
<nb_visits>Visits</nb_visits>
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
- <processedMetrics>
- <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>
- </processedMetrics>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
<nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
<nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <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>
+ </processedMetrics>
<metricsGoal>
<nb_conversions>Conversions</nb_conversions>
<revenue>Revenue</revenue>
diff --git a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getReportMetadata_day.xml b/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getReportMetadata_day.xml
index 63e903114b..1c545dcbac 100644
--- a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getReportMetadata_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getReportMetadata_day.xml
@@ -24,15 +24,8 @@
</metrics>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
<nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
+ <nb_pageviews>The number of times this page was visited.</nb_pageviews>
</metricsDocumentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=MultiSites&amp;apiAction=getAll&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=MultiSites&amp;apiAction=getAll&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
@@ -62,15 +55,8 @@
</metrics>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
<nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
+ <nb_pageviews>The number of times this page was visited.</nb_pageviews>
</metricsDocumentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=MultiSites&amp;apiAction=getOne&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=MultiSites&amp;apiAction=getOne&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
@@ -91,16 +77,12 @@
<max_actions>Maximum actions in one visit</max_actions>
</metrics>
<metricsDocumentation>
- <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
<nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
+ <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
<nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
<nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
<bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
+ <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
</metricsDocumentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=VisitsSummary&amp;apiAction=get&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=VisitsSummary&amp;apiAction=get&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
@@ -113,29 +95,22 @@
<action>getVisitInformationPerServerTime</action>
<dimension>Server time</dimension>
<documentation>This graph shows what time it was in the &lt;strong&gt; server's time zone &lt;/strong&gt; during the visits.</documentation>
- <constantRowsCount>1</constantRowsCount>
<metrics>
<nb_visits>Visits</nb_visits>
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
- <processedMetrics>
- <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>
- </processedMetrics>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
<nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
<nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <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>
+ </processedMetrics>
+ <constantRowsCount>1</constantRowsCount>
<metricsGoal>
<nb_conversions>Conversions</nb_conversions>
<revenue>Revenue</revenue>
@@ -153,30 +128,23 @@
<action>getVisitInformationPerLocalTime</action>
<dimension>Local time</dimension>
<documentation>This graph shows what time it was in the &lt;strong&gt; visitors' time zones &lt;/strong&gt; during their visits.</documentation>
- <constantRowsCount>1</constantRowsCount>
<metrics>
<nb_visits>Visits</nb_visits>
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
+ <metricsDocumentation>
+ <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
+ <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
+ <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
+ </metricsDocumentation>
<processedMetrics>
<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>
<conversion_rate>Conversion Rate</conversion_rate>
</processedMetrics>
- <metricsDocumentation>
- <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
- <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
- </metricsDocumentation>
+ <constantRowsCount>1</constantRowsCount>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=VisitTime&amp;apiAction=getVisitInformationPerLocalTime&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<uniqueId>VisitTime_getVisitInformationPerLocalTime</uniqueId>
</row>
@@ -187,30 +155,23 @@
<action>getByDayOfWeek</action>
<dimension>Day of the week</dimension>
<documentation>This graph shows the number of visits your website received on each day of the week.</documentation>
- <constantRowsCount>1</constantRowsCount>
<metrics>
<nb_visits>Visits</nb_visits>
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
+ <metricsDocumentation>
+ <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
+ <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
+ <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
+ </metricsDocumentation>
<processedMetrics>
<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>
<conversion_rate>Conversion Rate</conversion_rate>
</processedMetrics>
- <metricsDocumentation>
- <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
- <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
- </metricsDocumentation>
+ <constantRowsCount>1</constantRowsCount>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=VisitTime&amp;apiAction=getByDayOfWeek&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<uniqueId>VisitTime_getByDayOfWeek</uniqueId>
</row>
@@ -225,24 +186,17 @@
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
+ <metricsDocumentation>
+ <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
+ <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
+ <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
+ </metricsDocumentation>
<processedMetrics>
<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>
<conversion_rate>Conversion Rate</conversion_rate>
</processedMetrics>
- <metricsDocumentation>
- <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
- <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
- </metricsDocumentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=UserSettings&amp;apiAction=getResolution&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=UserSettings&amp;apiAction=getResolution&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>UserSettings_getResolution</uniqueId>
@@ -259,24 +213,17 @@
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
+ <metricsDocumentation>
+ <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
+ <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
+ <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
+ </metricsDocumentation>
<processedMetrics>
<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>
<conversion_rate>Conversion Rate</conversion_rate>
</processedMetrics>
- <metricsDocumentation>
- <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
- <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
- </metricsDocumentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=UserSettings&amp;apiAction=getBrowser&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=UserSettings&amp;apiAction=getBrowser&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>UserSettings_getBrowser</uniqueId>
@@ -292,24 +239,17 @@
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
+ <metricsDocumentation>
+ <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
+ <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
+ <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
+ </metricsDocumentation>
<processedMetrics>
<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>
<conversion_rate>Conversion Rate</conversion_rate>
</processedMetrics>
- <metricsDocumentation>
- <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
- <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
- </metricsDocumentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=UserSettings&amp;apiAction=getBrowserVersion&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=UserSettings&amp;apiAction=getBrowserVersion&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>UserSettings_getBrowserVersion</uniqueId>
@@ -326,24 +266,17 @@
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
+ <metricsDocumentation>
+ <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
+ <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
+ <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
+ </metricsDocumentation>
<processedMetrics>
<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>
<conversion_rate>Conversion Rate</conversion_rate>
</processedMetrics>
- <metricsDocumentation>
- <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
- <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
- </metricsDocumentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=UserSettings&amp;apiAction=getBrowserType&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=UserSettings&amp;apiAction=getBrowserType&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>UserSettings_getBrowserType</uniqueId>
@@ -359,19 +292,10 @@
<nb_visits>Visits</nb_visits>
<nb_visits_percentage>% Visits</nb_visits_percentage>
</metrics>
- <constantRowsCount>1</constantRowsCount>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
- <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
</metricsDocumentation>
+ <constantRowsCount>1</constantRowsCount>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=UserSettings&amp;apiAction=getPlugin&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<uniqueId>UserSettings_getPlugin</uniqueId>
</row>
@@ -386,24 +310,17 @@
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
+ <metricsDocumentation>
+ <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
+ <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
+ <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
+ </metricsDocumentation>
<processedMetrics>
<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>
<conversion_rate>Conversion Rate</conversion_rate>
</processedMetrics>
- <metricsDocumentation>
- <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
- <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
- </metricsDocumentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=UserSettings&amp;apiAction=getWideScreen&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=UserSettings&amp;apiAction=getWideScreen&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>UserSettings_getWideScreen</uniqueId>
@@ -419,24 +336,17 @@
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
+ <metricsDocumentation>
+ <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
+ <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
+ <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
+ </metricsDocumentation>
<processedMetrics>
<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>
<conversion_rate>Conversion Rate</conversion_rate>
</processedMetrics>
- <metricsDocumentation>
- <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
- <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
- </metricsDocumentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=UserSettings&amp;apiAction=getOS&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=UserSettings&amp;apiAction=getOS&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>UserSettings_getOS</uniqueId>
@@ -453,24 +363,17 @@
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
+ <metricsDocumentation>
+ <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
+ <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
+ <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
+ </metricsDocumentation>
<processedMetrics>
<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>
<conversion_rate>Conversion Rate</conversion_rate>
</processedMetrics>
- <metricsDocumentation>
- <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
- <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
- </metricsDocumentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=UserSettings&amp;apiAction=getConfiguration&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=UserSettings&amp;apiAction=getConfiguration&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>UserSettings_getConfiguration</uniqueId>
@@ -486,24 +389,17 @@
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
+ <metricsDocumentation>
+ <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
+ <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
+ <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
+ </metricsDocumentation>
<processedMetrics>
<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>
<conversion_rate>Conversion Rate</conversion_rate>
</processedMetrics>
- <metricsDocumentation>
- <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
- <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
- </metricsDocumentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=UserSettings&amp;apiAction=getOSFamily&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=UserSettings&amp;apiAction=getOSFamily&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>UserSettings_getOSFamily</uniqueId>
@@ -514,30 +410,23 @@
<module>UserSettings</module>
<action>getMobileVsDesktop</action>
<dimension>Mobile vs Desktop</dimension>
- <constantRowsCount>1</constantRowsCount>
<metrics>
<nb_visits>Visits</nb_visits>
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
+ <metricsDocumentation>
+ <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
+ <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
+ <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
+ </metricsDocumentation>
<processedMetrics>
<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>
<conversion_rate>Conversion Rate</conversion_rate>
</processedMetrics>
- <metricsDocumentation>
- <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
- <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
- </metricsDocumentation>
+ <constantRowsCount>1</constantRowsCount>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=UserSettings&amp;apiAction=getMobileVsDesktop&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<uniqueId>UserSettings_getMobileVsDesktop</uniqueId>
</row>
@@ -552,24 +441,17 @@
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
+ <metricsDocumentation>
+ <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
+ <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
+ <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
+ </metricsDocumentation>
<processedMetrics>
<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>
<conversion_rate>Conversion Rate</conversion_rate>
</processedMetrics>
- <metricsDocumentation>
- <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
- <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
- </metricsDocumentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=UserSettings&amp;apiAction=getLanguage&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=UserSettings&amp;apiAction=getLanguage&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>UserSettings_getLanguage</uniqueId>
@@ -773,6 +655,7 @@
<module>Actions</module>
<action>getPageUrls</action>
<dimension>Page URL</dimension>
+ <documentation>This report contains information about the page URLs that have been visited. &lt;br /&gt; The table is organized hierarchically, the URLs are displayed as a folder structure.&lt;br /&gt;Use the plus and minus icons on the left to navigate.</documentation>
<metrics>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
@@ -789,7 +672,6 @@
<exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
<avg_time_generation>The average time it took to generate the page. This metric includes the time it took the server to generate the web page, plus the time it took for the visitor to download the response from the server. A lower 'Avg. generation time' means a faster website for your visitors!</avg_time_generation>
</metricsDocumentation>
- <documentation>This report contains information about the page URLs that have been visited. &lt;br /&gt; The table is organized hierarchically, the URLs are displayed as a folder structure.&lt;br /&gt;Use the plus and minus icons on the left to navigate.</documentation>
<actionToLoadSubTables>getPageUrls</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageUrls&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageUrls&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
@@ -800,7 +682,8 @@
<name>Entry pages</name>
<module>Actions</module>
<action>getEntryPageUrls</action>
- <dimension>Page URL</dimension>
+ <dimension>Entry Page URL</dimension>
+ <documentation>This report contains information about the entry pages that were used during the specified period. An entry page is the first page that a user views during his visit. &lt;br /&gt; The entry URLs are displayed as a folder structure.&lt;br /&gt;Use the plus and minus icons on the left to navigate.</documentation>
<metrics>
<entry_nb_visits>Entrances</entry_nb_visits>
<entry_bounce_count>Bounces</entry_bounce_count>
@@ -811,7 +694,6 @@
<entry_bounce_count>Number of visits that started and ended on this page. This means that the visitor left the website after viewing only this page.</entry_bounce_count>
<bounce_rate>Percentage of visits that started and ended on this page.</bounce_rate>
</metricsDocumentation>
- <documentation>This report contains information about the entry pages that were used during the specified period. An entry page is the first page that a user views during his visit. &lt;br /&gt; The entry URLs are displayed as a folder structure. Use the plus and minus icons on the left to navigate.</documentation>
<actionToLoadSubTables>getEntryPageUrls</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getEntryPageUrls&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getEntryPageUrls&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
@@ -822,7 +704,8 @@
<name>Exit pages</name>
<module>Actions</module>
<action>getExitPageUrls</action>
- <dimension>Page URL</dimension>
+ <dimension>Exit Page URL</dimension>
+ <documentation>This report contains information about the exit pages that occurred during the specified period. An exit page is the last page that a user views during his visit. &lt;br /&gt; The exit URLs are displayed as a folder structure.&lt;br /&gt;Use the plus and minus icons on the left to navigate.</documentation>
<metrics>
<exit_nb_visits>Exits</exit_nb_visits>
<nb_visits>Unique Pageviews</nb_visits>
@@ -833,7 +716,6 @@
<nb_visits>The number of visits that included this page. If a page was viewed multiple times during one visit, it is only counted once.</nb_visits>
<exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
</metricsDocumentation>
- <documentation>This report contains information about the exit pages that occurred during the specified period. An exit page is the last page that a user views during his visit. &lt;br /&gt; The exit URLs are displayed as a folder structure. Use the plus and minus icons on the left to navigate.</documentation>
<actionToLoadSubTables>getExitPageUrls</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getExitPageUrls&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getExitPageUrls&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
@@ -845,6 +727,7 @@
<module>Actions</module>
<action>getPageTitles</action>
<dimension>Page Name</dimension>
+ <documentation>This report contains information about the titles of the pages that have been visited. &lt;br /&gt; The page title is the HTML &lt;title&gt; Tag that most browsers show in their window title.</documentation>
<metrics>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
@@ -861,7 +744,6 @@
<exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
<avg_time_generation>The average time it took to generate the page. This metric includes the time it took the server to generate the web page, plus the time it took for the visitor to download the response from the server. A lower 'Avg. generation time' means a faster website for your visitors!</avg_time_generation>
</metricsDocumentation>
- <documentation>This report contains information about the titles of the pages that have been visited. &lt;br /&gt; The page title is the HTML &lt;title&gt; Tag that most browsers show in their window title.</documentation>
<actionToLoadSubTables>getPageTitles</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageTitles&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageTitles&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
@@ -872,7 +754,8 @@
<name>Entry page titles</name>
<module>Actions</module>
<action>getEntryPageTitles</action>
- <dimension>Page Name</dimension>
+ <dimension>Entry Page title</dimension>
+ <documentation>This report contains information about the titles of exit pages that occurred during the specified period. Use the plus and minus icons on the left to navigate.</documentation>
<metrics>
<entry_nb_visits>Entrances</entry_nb_visits>
<entry_bounce_count>Bounces</entry_bounce_count>
@@ -883,7 +766,6 @@
<entry_bounce_count>Number of visits that started and ended on this page. This means that the visitor left the website after viewing only this page.</entry_bounce_count>
<bounce_rate>Percentage of visits that started and ended on this page.</bounce_rate>
</metricsDocumentation>
- <documentation>This report contains information about the titles of exit pages that occurred during the specified period. Use the plus and minus icons on the left to navigate.</documentation>
<actionToLoadSubTables>getEntryPageTitles</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getEntryPageTitles&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getEntryPageTitles&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
@@ -894,7 +776,8 @@
<name>Exit page titles</name>
<module>Actions</module>
<action>getExitPageTitles</action>
- <dimension>Page Name</dimension>
+ <dimension>Exit Page Title</dimension>
+ <documentation>This report contains information about the titles of entry pages that were used during the specified period. Use the plus and minus icons on the left to navigate.</documentation>
<metrics>
<exit_nb_visits>Exits</exit_nb_visits>
<nb_visits>Unique Pageviews</nb_visits>
@@ -905,7 +788,6 @@
<nb_visits>The number of visits that included this page. If a page was viewed multiple times during one visit, it is only counted once.</nb_visits>
<exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
</metricsDocumentation>
- <documentation>This report contains information about the titles of entry pages that were used during the specified period. Use the plus and minus icons on the left to navigate.</documentation>
<actionToLoadSubTables>getExitPageTitles</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getExitPageTitles&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getExitPageTitles&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
@@ -917,6 +799,7 @@
<module>Actions</module>
<action>getOutlinks</action>
<dimension>Clicked URL</dimension>
+ <documentation>This report shows a hierarchical list of outlink URLs that were clicked by your visitors. An outlink is a link that leads the visitor away from your website (to another domain).&lt;br /&gt;Use the plus and minus icons on the left to navigate.</documentation>
<metrics>
<nb_visits>Unique Clicks</nb_visits>
<nb_hits>Clicks</nb_hits>
@@ -925,7 +808,6 @@
<nb_visits>The number of visits that involved a click on this link. If a link was clicked multiple times during one visit, it is only counted once.</nb_visits>
<nb_hits>The number of times this link was clicked.</nb_hits>
</metricsDocumentation>
- <documentation>This report shows a hierarchical list of outlink URLs that were clicked by your visitors. An outlink is a link that leads the visitor away from your website (to another domain).&lt;br /&gt;Use the plus and minus icons on the left to navigate.</documentation>
<actionToLoadSubTables>getOutlinks</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getOutlinks&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getOutlinks&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
@@ -937,6 +819,7 @@
<module>Actions</module>
<action>getDownloads</action>
<dimension>Download URL</dimension>
+ <documentation>In this report, you can see which files your visitors have downloaded. &lt;br /&gt; What Piwik counts as a download is the click on a download link. Whether the download was completed or not isn't known to Piwik.</documentation>
<metrics>
<nb_visits>Unique Downloads</nb_visits>
<nb_hits>Downloads</nb_hits>
@@ -945,7 +828,6 @@
<nb_visits>The number of visits that involved a click on this link. If a link was clicked multiple times during one visit, it is only counted once.</nb_visits>
<nb_hits>The number of times this link was clicked.</nb_hits>
</metricsDocumentation>
- <documentation>In this report, you can see which files your visitors have downloaded. &lt;br /&gt; What Piwik counts as a download is the click on a download link. Whether the download was completed or not isn't known to Piwik.</documentation>
<actionToLoadSubTables>getDownloads</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getDownloads&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getDownloads&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
@@ -1038,6 +920,7 @@
<module>Actions</module>
<action>getSiteSearchKeywords</action>
<dimension>Keyword</dimension>
+ <documentation>This report lists the Search Keywords that visitors searched for on your internal Search Engine.&lt;br/&gt;&lt;br/&gt;Tracking searches that visitors make on your website is a very effective way to learn more about what your audience is looking for, it can help find ideas for new content, new Ecommerce products that potential customers might be searching for, and generally improve the visitors' experience on your website.&lt;br/&gt;&lt;br/&gt;&lt;a href=&quot;http://piwik.org/docs/site-search/&quot; target=&quot;_blank&quot;&gt;Learn more about Tracking how your visitors use your Search engine.&lt;/a&gt;</documentation>
<metrics>
<nb_visits>Searches</nb_visits>
<nb_pages_per_search>Search Results pages</nb_pages_per_search>
@@ -1048,7 +931,6 @@
<nb_pages_per_search>Visitors will search on your website, and sometimes click &quot;next&quot; to view more results. This is the average number of search results pages viewed for this keyword.</nb_pages_per_search>
<exit_rate>The percentage of visits that left the website after searching for this Keyword on your Site Search engine.</exit_rate>
</metricsDocumentation>
- <documentation>This report lists the Search Keywords that visitors searched for on your internal Search Engine.&lt;br/&gt;&lt;br/&gt;Tracking searches that visitors make on your website is a very effective way to learn more about what your audience is looking for, it can help find ideas for new content, new Ecommerce products that potential customers might be searching for, and generally improve the visitors' experience on your website.&lt;br/&gt;&lt;br/&gt;&lt;a href=&quot;http://piwik.org/docs/site-search/&quot; target=&quot;_blank&quot;&gt;Learn more about Tracking how your visitors use your Search engine.&lt;/a&gt;</documentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getSiteSearchKeywords&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getSiteSearchKeywords&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>Actions_getSiteSearchKeywords</uniqueId>
@@ -1059,6 +941,7 @@
<module>Actions</module>
<action>getSiteSearchNoResultKeywords</action>
<dimension>Keyword with No Search Result</dimension>
+ <documentation>Tracking searches that visitors make on your website is a very effective way to learn more about what your audience is looking for, it can help find ideas for new content, new Ecommerce products that potential customers might be searching for, and generally improve the visitors' experience on your website.&lt;br /&gt;&lt;br /&gt;This report lists the Search Keywords that did not return any Search result: maybe the search engine algorithm can be improved, or maybe your visitors are looking for content that is not (yet) on your website?</documentation>
<metrics>
<nb_visits>Searches</nb_visits>
<exit_rate>% Search Exits</exit_rate>
@@ -1067,7 +950,6 @@
<nb_visits>The number of visits that searched for this keyword on your website's search engine.</nb_visits>
<exit_rate>The percentage of visits that left the website after searching for this Keyword on your Site Search engine.</exit_rate>
</metricsDocumentation>
- <documentation>Tracking searches that visitors make on your website is a very effective way to learn more about what your audience is looking for, it can help find ideas for new content, new Ecommerce products that potential customers might be searching for, and generally improve the visitors' experience on your website.&lt;br /&gt;&lt;br /&gt;This report lists the Search Keywords that did not return any Search result: maybe the search engine algorithm can be improved, or maybe your visitors are looking for content that is not (yet) on your website?</documentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getSiteSearchNoResultKeywords&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getSiteSearchNoResultKeywords&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>Actions_getSiteSearchNoResultKeywords</uniqueId>
@@ -1078,6 +960,7 @@
<module>Actions</module>
<action>getSiteSearchCategories</action>
<dimension>Search Category</dimension>
+ <documentation>This report lists the Categories that visitors selected when they made a Search on your website.&lt;br/&gt;For example, Ecommerce websites typically have a &quot;Category&quot; selector so that visitors can restrict their searches to all products in a specific Category.</documentation>
<metrics>
<nb_visits>Searches</nb_visits>
<nb_pages_per_search>Search Results pages</nb_pages_per_search>
@@ -1088,7 +971,6 @@
<nb_pages_per_search>Visitors will search on your website, and sometimes click &quot;next&quot; to view more results. This is the average number of search results pages viewed for this keyword.</nb_pages_per_search>
<exit_rate>The percentage of visits that left the website after searching for this Keyword on your Site Search engine.</exit_rate>
</metricsDocumentation>
- <documentation>This report lists the Categories that visitors selected when they made a Search on your website.&lt;br/&gt;For example, Ecommerce websites typically have a &quot;Category&quot; selector so that visitors can restrict their searches to all products in a specific Category.</documentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getSiteSearchCategories&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getSiteSearchCategories&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>Actions_getSiteSearchCategories</uniqueId>
@@ -1099,6 +981,7 @@
<module>Actions</module>
<action>getPageUrlsFollowingSiteSearch</action>
<dimension>Destination Page</dimension>
+ <documentation>When visitors search on your website, they are looking for a particular page, content, product, or service. This report lists the pages that were clicked the most after an internal search. In other words, the list of pages the most searched for by visitors already on your website.&lt;br/&gt;Use the plus and minus icons on the left to navigate.</documentation>
<metrics>
<nb_hits_following_search>Clicked in search results</nb_hits_following_search>
<nb_hits>Total Pageviews</nb_hits>
@@ -1107,7 +990,6 @@
<nb_hits_following_search>The number of times this Page was visited after a visitor did a search on your website, and clicked on this page in the search results.</nb_hits_following_search>
<nb_hits>The number of times this page was visited.</nb_hits>
</metricsDocumentation>
- <documentation>When visitors search on your website, they are looking for a particular page, content, product, or service. This report lists the pages that were clicked the most after an internal search. In other words, the list of pages the most searched for by visitors already on your website.&lt;br/&gt;Use the plus and minus icons on the left to navigate.</documentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageUrlsFollowingSiteSearch&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageUrlsFollowingSiteSearch&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>Actions_getPageUrlsFollowingSiteSearch</uniqueId>
@@ -1118,6 +1000,7 @@
<module>Actions</module>
<action>getPageTitlesFollowingSiteSearch</action>
<dimension>Destination Page</dimension>
+ <documentation>When visitors search on your website, they are looking for a particular page, content, product, or service. This report lists the pages that were clicked the most after an internal search. In other words, the list of pages the most searched for by visitors already on your website.&lt;br/&gt;Use the plus and minus icons on the left to navigate.</documentation>
<metrics>
<nb_hits_following_search>Clicked in search results</nb_hits_following_search>
<nb_hits>Total Pageviews</nb_hits>
@@ -1126,7 +1009,6 @@
<nb_hits_following_search>The number of times this Page was visited after a visitor did a search on your website, and clicked on this page in the search results.</nb_hits_following_search>
<nb_hits>The number of times this page was visited.</nb_hits>
</metricsDocumentation>
- <documentation>When visitors search on your website, they are looking for a particular page, content, product, or service. This report lists the pages that were clicked the most after an internal search. In other words, the list of pages the most searched for by visitors already on your website.&lt;br/&gt;Use the plus and minus icons on the left to navigate.</documentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageTitlesFollowingSiteSearch&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageTitlesFollowingSiteSearch&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>Actions_getPageTitlesFollowingSiteSearch</uniqueId>
@@ -1137,30 +1019,23 @@
<module>Referrers</module>
<action>getReferrerType</action>
<dimension>Referrer Type</dimension>
- <constantRowsCount>1</constantRowsCount>
<documentation>This table contains information about the distribution of the referrer types.&lt;br /&gt;&lt;b&gt;Direct Entry:&lt;/b&gt; A visitor has entered the URL in his browser and started browsing on your website - he entered the website directly.&lt;br /&gt;&lt;b&gt;Search Engines:&lt;/b&gt; A visitor was referred to your website by a search engine. &lt;br /&gt; See the &quot;Search Engines &amp; Keywords&quot; report for more details.&lt;br /&gt;&lt;b&gt;Websites:&lt;/b&gt; The visitor followed a link on antoher website that led to your site. &lt;br /&gt; See the &quot;Websites &amp; Social&quot; report for more details.&lt;br /&gt;&lt;b&gt;Campaigns:&lt;/b&gt; Visitors that came to your website as the result of a campaign. &lt;br /&gt; See the &quot;Campaigns&quot; report for more details.</documentation>
<metrics>
<nb_visits>Visits</nb_visits>
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
- <processedMetrics>
- <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>
- </processedMetrics>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
<nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
<nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <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>
+ </processedMetrics>
+ <constantRowsCount>1</constantRowsCount>
<metricsGoal>
<nb_conversions>Conversions</nb_conversions>
<revenue>Revenue</revenue>
@@ -1184,24 +1059,17 @@
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
+ <metricsDocumentation>
+ <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
+ <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
+ <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
+ </metricsDocumentation>
<processedMetrics>
<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>
<conversion_rate>Conversion Rate</conversion_rate>
</processedMetrics>
- <metricsDocumentation>
- <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
- <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
- </metricsDocumentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Referrers&amp;apiAction=getAll&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<uniqueId>Referrers_getAll</uniqueId>
</row>
@@ -1210,7 +1078,6 @@
<name>Keywords</name>
<module>Referrers</module>
<action>getKeywords</action>
- <actionToLoadSubTables>getSearchEnginesFromKeywordId</actionToLoadSubTables>
<dimension>Keyword</dimension>
<documentation>This report shows which keywords users were searching for before they were referred to your website. &lt;br /&gt; By clicking on a row in the table, you can see the distribution of search engines that were queried for the keyword.</documentation>
<metrics>
@@ -1218,23 +1085,17 @@
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
- <processedMetrics>
- <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>
- </processedMetrics>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
<nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
<nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <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>
+ </processedMetrics>
+ <actionToLoadSubTables>getSearchEnginesFromKeywordId</actionToLoadSubTables>
<metricsGoal>
<nb_conversions>Conversions</nb_conversions>
<revenue>Revenue</revenue>
@@ -1253,29 +1114,22 @@
<action>getWebsites</action>
<dimension>Website</dimension>
<documentation>In this table, you can see which websites referred visitors to your site. &lt;br /&gt; By clicking on a row in the table, you can see which URLs the links to your website were on.</documentation>
- <actionToLoadSubTables>getUrlsFromWebsiteId</actionToLoadSubTables>
<metrics>
<nb_visits>Visits</nb_visits>
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
- <processedMetrics>
- <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>
- </processedMetrics>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
<nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
<nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <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>
+ </processedMetrics>
+ <actionToLoadSubTables>getUrlsFromWebsiteId</actionToLoadSubTables>
<metricsGoal>
<nb_conversions>Conversions</nb_conversions>
<revenue>Revenue</revenue>
@@ -1294,29 +1148,22 @@
<action>getSearchEngines</action>
<dimension>Search Engine</dimension>
<documentation>This report shows which search engines referred users to your website. &lt;br /&gt; By clicking on a row in the table, you can see what users were searching for using a specific search engine.</documentation>
- <actionToLoadSubTables>getKeywordsFromSearchEngineId</actionToLoadSubTables>
<metrics>
<nb_visits>Visits</nb_visits>
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
- <processedMetrics>
- <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>
- </processedMetrics>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
<nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
<nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <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>
+ </processedMetrics>
+ <actionToLoadSubTables>getKeywordsFromSearchEngineId</actionToLoadSubTables>
<metricsGoal>
<nb_conversions>Conversions</nb_conversions>
<revenue>Revenue</revenue>
@@ -1335,29 +1182,22 @@
<action>getCampaigns</action>
<dimension>Campaign</dimension>
<documentation>This report shows which campaigns led visitors to your website. &lt;br /&gt; For more information about tracking campaigns, read the &lt;a href=&quot;http://piwik.org/docs/tracking-campaigns/&quot; target=&quot;_blank&quot;&gt;campaigns documentation on piwik.org&lt;/a&gt;</documentation>
- <actionToLoadSubTables>getKeywordsFromCampaignId</actionToLoadSubTables>
<metrics>
<nb_visits>Visits</nb_visits>
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
- <processedMetrics>
- <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>
- </processedMetrics>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
<nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
<nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <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>
+ </processedMetrics>
+ <actionToLoadSubTables>getKeywordsFromCampaignId</actionToLoadSubTables>
<metricsGoal>
<nb_conversions>Conversions</nb_conversions>
<revenue>Revenue</revenue>
@@ -1374,7 +1214,6 @@
<name>Social Networks</name>
<module>Referrers</module>
<action>getSocials</action>
- <actionToLoadSubTables>getUrlsForSocial</actionToLoadSubTables>
<dimension>Social network</dimension>
<documentation>In this table, you can see which websites referred visitors to your site. &lt;br /&gt; By clicking on a row in the table, you can see which URLs the links to your website were on.</documentation>
<metrics>
@@ -1382,24 +1221,18 @@
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
+ <metricsDocumentation>
+ <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
+ <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
+ <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
+ </metricsDocumentation>
<processedMetrics>
<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>
<conversion_rate>Conversion Rate</conversion_rate>
</processedMetrics>
- <metricsDocumentation>
- <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
- <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
- </metricsDocumentation>
+ <actionToLoadSubTables>getUrlsForSocial</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Referrers&amp;apiAction=getSocials&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Referrers&amp;apiAction=getSocials&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>Referrers_getSocials</uniqueId>
@@ -1615,28 +1448,22 @@
<module>UserCountry</module>
<action>getCountry</action>
<dimension>Country</dimension>
+ <documentation>This report shows which country your visitors were in when they accessed your website.</documentation>
<metrics>
<nb_visits>Visits</nb_visits>
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
- <processedMetrics>
- <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>
- </processedMetrics>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
<nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
<nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <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>
+ </processedMetrics>
<metricsGoal>
<nb_conversions>Conversions</nb_conversions>
<revenue>Revenue</revenue>
@@ -1654,28 +1481,22 @@
<module>UserCountry</module>
<action>getContinent</action>
<dimension>Continent</dimension>
+ <documentation>This report shows which continent your visitors were in when they accessed your website.</documentation>
<metrics>
<nb_visits>Visits</nb_visits>
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
- <processedMetrics>
- <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>
- </processedMetrics>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
<nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
<nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <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>
+ </processedMetrics>
<metricsGoal>
<nb_conversions>Conversions</nb_conversions>
<revenue>Revenue</revenue>
@@ -1693,28 +1514,22 @@
<module>UserCountry</module>
<action>getRegion</action>
<dimension>Region</dimension>
+ <documentation>This report shows which region your visitors were in when they accessed your website.&lt;br/&gt;In order to see data for this report, you must setup GeoIP in the Geolocation admin tab. The commercial &lt;a target=&quot;_blank&quot; href=&quot;http://www.maxmind.com/?rId=piwik&quot;&gt;Maxmind&lt;/a&gt; GeoIP databases are more accurate than the free ones. To see how accurate they are, click &lt;a target=&quot;_blank&quot; href=&quot;http://www.maxmind.com/en/city_accuracy?rId=piwik&quot;&gt;here&lt;/a&gt;.</documentation>
<metrics>
<nb_visits>Visits</nb_visits>
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
- <processedMetrics>
- <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>
- </processedMetrics>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
<nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
<nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <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>
+ </processedMetrics>
<metricsGoal>
<nb_conversions>Conversions</nb_conversions>
<revenue>Revenue</revenue>
@@ -1732,28 +1547,22 @@
<module>UserCountry</module>
<action>getCity</action>
<dimension>City</dimension>
+ <documentation>This report shows the cities your visitors were in when they accessed your website.&lt;br/&gt;In order to see data for this report, you must setup GeoIP in the Geolocation admin tab. The commercial &lt;a target=&quot;_blank&quot; href=&quot;http://www.maxmind.com/?rId=piwik&quot;&gt;Maxmind&lt;/a&gt; GeoIP databases are more accurate than the free ones. To see how accurate they are, click &lt;a target=&quot;_blank&quot; href=&quot;http://www.maxmind.com/en/city_accuracy?rId=piwik&quot;&gt;here&lt;/a&gt;.</documentation>
<metrics>
<nb_visits>Visits</nb_visits>
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
- <processedMetrics>
- <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>
- </processedMetrics>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
<nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
<nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <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>
+ </processedMetrics>
<metricsGoal>
<nb_conversions>Conversions</nb_conversions>
<revenue>Revenue</revenue>
@@ -1770,7 +1579,6 @@
<name>Custom Variables</name>
<module>CustomVariables</module>
<action>getCustomVariables</action>
- <actionToLoadSubTables>getCustomVariablesValuesFromNameId</actionToLoadSubTables>
<dimension>Custom Variable name</dimension>
<documentation>This report contains information about your Custom Variables. Click on a variable name to see the distribution of the values. &lt;br /&gt; For more information about Custom Variables in general, read the &lt;a href=&quot;http://piwik.org/docs/custom-variables/&quot; target=&quot;_blank&quot;&gt;Custom Variables documentation on piwik.org&lt;/a&gt;</documentation>
<metrics>
@@ -1778,23 +1586,17 @@
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
- <processedMetrics>
- <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>
- </processedMetrics>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
<nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
<nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <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>
+ </processedMetrics>
+ <actionToLoadSubTables>getCustomVariablesValuesFromNameId</actionToLoadSubTables>
<metricsGoal>
<nb_conversions>Conversions</nb_conversions>
<revenue>Revenue</revenue>
@@ -1812,23 +1614,14 @@
<module>VisitorInterest</module>
<action>getNumberOfVisitsPerVisitDuration</action>
<dimension>Visit duration</dimension>
+ <documentation>In this report, you can see how many visits had a certain total duration. Initially, the report is shown as a tag cloud, more common durations are displayed in a larger font.&lt;br /&gt;Please note, that you can view the report in other ways than as a tag cloud. Use the controls at the bottom of the report to do so.</documentation>
<metrics>
<nb_visits>Visits</nb_visits>
</metrics>
- <constantRowsCount>1</constantRowsCount>
- <documentation>In this report, you can see how many visits had a certain total duration. Initially, the report is shown as a tag cloud, more common durations are displayed in a larger font.&lt;br /&gt;Please note, that you can view the report in other ways than as a tag cloud. Use the controls at the bottom of the report to do so.</documentation>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
- <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
</metricsDocumentation>
+ <constantRowsCount>1</constantRowsCount>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=VisitorInterest&amp;apiAction=getNumberOfVisitsPerVisitDuration&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<uniqueId>VisitorInterest_getNumberOfVisitsPerVisitDuration</uniqueId>
</row>
@@ -1838,23 +1631,14 @@
<module>VisitorInterest</module>
<action>getNumberOfVisitsPerPage</action>
<dimension>Pages per visit</dimension>
+ <documentation>In this report, you can see how many visits involved a certain number of pageviews. Initially, the report is shown as a tag cloud, more common numbers of pages are displayed in a larger font.&lt;br /&gt;Please note, that you can view the report in other ways than as a tag cloud. Use the controls at the bottom of the report to do so.</documentation>
<metrics>
<nb_visits>Visits</nb_visits>
</metrics>
- <constantRowsCount>1</constantRowsCount>
- <documentation>In this report, you can see how many visits involved a certain number of pageviews. Initially, the report is shown as a tag cloud, more common numbers of pages are displayed in a larger font.&lt;br /&gt;Please note, that you can view the report in other ways than as a tag cloud. Use the controls at the bottom of the report to do so.</documentation>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
- <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
</metricsDocumentation>
+ <constantRowsCount>1</constantRowsCount>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=VisitorInterest&amp;apiAction=getNumberOfVisitsPerPage&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<uniqueId>VisitorInterest_getNumberOfVisitsPerPage</uniqueId>
</row>
@@ -1864,24 +1648,15 @@
<module>VisitorInterest</module>
<action>getNumberOfVisitsByVisitCount</action>
<dimension>Visits by Visit Number</dimension>
+ <documentation>In this report, you can see the number of visits who were the Nth visit, ie. visitors who visited your website at least N times.&lt;br /&gt;Please note, that you can view the report in other ways than as a tag cloud. Use the controls at the bottom of the report to do so.</documentation>
<metrics>
<nb_visits>Visits</nb_visits>
<nb_visits_percentage>% Visits</nb_visits_percentage>
</metrics>
- <constantRowsCount>1</constantRowsCount>
- <documentation>In this report, you can see the number of visits who were the Nth visit, ie. visitors who visited your website at least N times.&lt;br /&gt;Please note, that you can view the report in other ways than as a tag cloud. Use the controls at the bottom of the report to do so.</documentation>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
- <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
</metricsDocumentation>
+ <constantRowsCount>1</constantRowsCount>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=VisitorInterest&amp;apiAction=getNumberOfVisitsByVisitCount&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<uniqueId>VisitorInterest_getNumberOfVisitsByVisitCount</uniqueId>
</row>
@@ -1891,23 +1666,14 @@
<module>VisitorInterest</module>
<action>getNumberOfVisitsByDaysSinceLast</action>
<dimension>Visits by days since last visit</dimension>
+ <documentation>In this report, you can see how many visits were from visitors whose last visit was a certain number of days ago.</documentation>
<metrics>
<nb_visits>Visits</nb_visits>
</metrics>
- <constantRowsCount>1</constantRowsCount>
- <documentation>In this report, you can see how many visits were from visitors whose last visit was a certain number of days ago.</documentation>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
- <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
</metricsDocumentation>
+ <constantRowsCount>1</constantRowsCount>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=VisitorInterest&amp;apiAction=getNumberOfVisitsByDaysSinceLast&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<uniqueId>VisitorInterest_getNumberOfVisitsByDaysSinceLast</uniqueId>
</row>
@@ -1924,18 +1690,6 @@
<nb_actions_per_visit_returning>Avg. Actions per Returning Visit</nb_actions_per_visit_returning>
<nb_uniq_visitors_returning>Unique returning visitors</nb_uniq_visitors_returning>
</metrics>
- <metricsDocumentation>
- <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
- <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
- </metricsDocumentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=VisitFrequency&amp;apiAction=get&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=VisitFrequency&amp;apiAction=get&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>VisitFrequency_get</uniqueId>
@@ -1952,24 +1706,17 @@
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
+ <metricsDocumentation>
+ <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
+ <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
+ <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
+ </metricsDocumentation>
<processedMetrics>
<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>
<conversion_rate>Conversion Rate</conversion_rate>
</processedMetrics>
- <metricsDocumentation>
- <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
- <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
- </metricsDocumentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Provider&amp;apiAction=getProvider&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Provider&amp;apiAction=getProvider&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>Provider_getProvider</uniqueId>
@@ -1985,24 +1732,17 @@
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
+ <metricsDocumentation>
+ <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
+ <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
+ <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
+ </metricsDocumentation>
<processedMetrics>
<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>
<conversion_rate>Conversion Rate</conversion_rate>
</processedMetrics>
- <metricsDocumentation>
- <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
- <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
- </metricsDocumentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=DevicesDetection&amp;apiAction=getType&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=DevicesDetection&amp;apiAction=getType&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>DevicesDetection_getType</uniqueId>
@@ -2018,24 +1758,17 @@
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
+ <metricsDocumentation>
+ <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
+ <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
+ <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
+ </metricsDocumentation>
<processedMetrics>
<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>
<conversion_rate>Conversion Rate</conversion_rate>
</processedMetrics>
- <metricsDocumentation>
- <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
- <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
- </metricsDocumentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=DevicesDetection&amp;apiAction=getBrand&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=DevicesDetection&amp;apiAction=getBrand&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>DevicesDetection_getBrand</uniqueId>
@@ -2051,24 +1784,17 @@
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
+ <metricsDocumentation>
+ <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
+ <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
+ <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
+ </metricsDocumentation>
<processedMetrics>
<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>
<conversion_rate>Conversion Rate</conversion_rate>
</processedMetrics>
- <metricsDocumentation>
- <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
- <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
- </metricsDocumentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=DevicesDetection&amp;apiAction=getModel&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=DevicesDetection&amp;apiAction=getModel&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>DevicesDetection_getModel</uniqueId>
@@ -2084,24 +1810,17 @@
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
+ <metricsDocumentation>
+ <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
+ <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
+ <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
+ </metricsDocumentation>
<processedMetrics>
<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>
<conversion_rate>Conversion Rate</conversion_rate>
</processedMetrics>
- <metricsDocumentation>
- <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
- <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
- </metricsDocumentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=DevicesDetection&amp;apiAction=getOsFamilies&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=DevicesDetection&amp;apiAction=getOsFamilies&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>DevicesDetection_getOsFamilies</uniqueId>
@@ -2117,24 +1836,17 @@
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
+ <metricsDocumentation>
+ <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
+ <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
+ <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
+ </metricsDocumentation>
<processedMetrics>
<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>
<conversion_rate>Conversion Rate</conversion_rate>
</processedMetrics>
- <metricsDocumentation>
- <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
- <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
- </metricsDocumentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=DevicesDetection&amp;apiAction=getOsVersions&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=DevicesDetection&amp;apiAction=getOsVersions&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>DevicesDetection_getOsVersions</uniqueId>
@@ -2150,24 +1862,17 @@
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
+ <metricsDocumentation>
+ <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
+ <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
+ <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
+ </metricsDocumentation>
<processedMetrics>
<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>
<conversion_rate>Conversion Rate</conversion_rate>
</processedMetrics>
- <metricsDocumentation>
- <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
- <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
- </metricsDocumentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=DevicesDetection&amp;apiAction=getBrowserFamilies&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=DevicesDetection&amp;apiAction=getBrowserFamilies&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>DevicesDetection_getBrowserFamilies</uniqueId>
@@ -2183,24 +1888,17 @@
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
+ <metricsDocumentation>
+ <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
+ <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
+ <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
+ </metricsDocumentation>
<processedMetrics>
<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>
<conversion_rate>Conversion Rate</conversion_rate>
</processedMetrics>
- <metricsDocumentation>
- <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
- <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
- </metricsDocumentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=DevicesDetection&amp;apiAction=getBrowserVersions&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=DevicesDetection&amp;apiAction=getBrowserVersions&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>DevicesDetection_getBrowserVersions</uniqueId>
@@ -2245,16 +1943,12 @@
<nb_uniq_visitors_returning>Unique returning visitors</nb_uniq_visitors_returning>
</metrics>
<metricsDocumentation>
- <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
<nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
+ <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
<nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
<nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
<bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
+ <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
<nb_pageviews>The number of times this page was visited.</nb_pageviews>
<nb_uniq_pageviews>The number of visits that included this page. If a page was viewed multiple times during one visit, it is only counted once.</nb_uniq_pageviews>
<nb_downloads>The number of times this link was clicked.</nb_downloads>
diff --git a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getSegmentsMetadata.xml b/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getSegmentsMetadata.xml
index c3f602ca1e..19aefaace8 100644
--- a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getSegmentsMetadata.xml
+++ b/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getSegmentsMetadata.xml
@@ -225,8 +225,8 @@
<type>dimension</type>
<category>Referrers</category>
<name>Referrer URL</name>
- <acceptedValues>http%3A%2F%2Fwww.example.org%2Freferer-page.htm</acceptedValues>
<segment>referrerUrl</segment>
+ <acceptedValues>http%3A%2F%2Fwww.example.org%2Freferer-page.htm</acceptedValues>
</row>
<row>
<type>dimension</type>
diff --git a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_phpRenderer__API.getDefaultMetricTranslations.php b/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_phpRenderer__API.getDefaultMetricTranslations.php
index 0905e86f31..d1117d7e06 100644
--- a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_phpRenderer__API.getDefaultMetricTranslations.php
+++ b/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_phpRenderer__API.getDefaultMetricTranslations.php
@@ -1 +1 @@
-a:1:{i:0;a:40:{s:9:"nb_visits";s:6:"Visits";s:16:"nb_uniq_visitors";s:15:"Unique visitors";s:10:"nb_actions";s:7:"Actions";s:20:"nb_actions_per_visit";s:17:"Actions per Visit";s:16:"avg_time_on_site";s:20:"Avg. Time on Website";s:11:"bounce_rate";s:11:"Bounce Rate";s:15:"conversion_rate";s:15:"Conversion Rate";s:5:"label";s:5:"Label";s:4:"date";s:4:"Date";s:16:"avg_time_on_page";s:17:"Avg. time on page";s:14:"sum_time_spent";s:41:"Total time spent by visitors (in seconds)";s:16:"sum_visit_length";s:41:"Total time spent by visitors (in seconds)";s:12:"bounce_count";s:7:"Bounces";s:22:"bounce_count_returning";s:33:"Bounce Count for Returning Visits";s:11:"max_actions";s:28:"Maximum actions in one visit";s:21:"max_actions_returning";s:38:"Maximum actions in one returning visit";s:29:"nb_visits_converted_returning";s:36:"Number of converted returning visits";s:26:"sum_visit_length_returning";s:51:"Total time spent by returning visitors (in seconds)";s:19:"nb_visits_converted";s:23:"Visits with Conversions";s:14:"nb_conversions";s:11:"Conversions";s:7:"revenue";s:7:"Revenue";s:7:"nb_hits";s:9:"Pageviews";s:15:"entry_nb_visits";s:9:"Entrances";s:22:"entry_nb_uniq_visitors";s:16:"Unique entrances";s:14:"exit_nb_visits";s:5:"Exits";s:21:"exit_nb_uniq_visitors";s:12:"Unique exits";s:18:"entry_bounce_count";s:7:"Bounces";s:17:"exit_bounce_count";s:7:"Bounces";s:9:"exit_rate";s:9:"Exit rate";s:26:"sum_daily_nb_uniq_visitors";s:27:"Unique visitors (daily sum)";s:32:"sum_daily_entry_nb_uniq_visitors";s:28:"Unique entrances (daily sum)";s:31:"sum_daily_exit_nb_uniq_visitors";s:24:"Unique exits (daily sum)";s:16:"entry_nb_actions";s:27:"Actions after entering here";s:22:"entry_sum_visit_length";s:61:"Total time spent by visitors (in seconds) after entering here";s:9:"nb_events";s:12:"Total events";s:15:"sum_event_value";s:11:"Total value";s:15:"min_event_value";s:13:"Minimum value";s:15:"max_event_value";s:13:"Maximum value";s:15:"avg_event_value";s:13:"Average value";s:20:"nb_events_with_value";s:19:"Events with a value";}} \ No newline at end of file
+a:1:{i:0;a:67:{s:9:"nb_visits";s:6:"Visits";s:16:"nb_uniq_visitors";s:15:"Unique visitors";s:10:"nb_actions";s:7:"Actions";s:20:"nb_actions_per_visit";s:17:"Actions per Visit";s:16:"avg_time_on_site";s:20:"Avg. Time on Website";s:11:"bounce_rate";s:11:"Bounce Rate";s:15:"conversion_rate";s:15:"Conversion Rate";s:5:"label";s:5:"Label";s:4:"date";s:4:"Date";s:16:"avg_time_on_page";s:17:"Avg. time on page";s:14:"sum_time_spent";s:41:"Total time spent by visitors (in seconds)";s:16:"sum_visit_length";s:41:"Total time spent by visitors (in seconds)";s:12:"bounce_count";s:7:"Bounces";s:22:"bounce_count_returning";s:33:"Bounce Count for Returning Visits";s:11:"max_actions";s:28:"Maximum actions in one visit";s:21:"max_actions_returning";s:38:"Maximum actions in one returning visit";s:29:"nb_visits_converted_returning";s:36:"Number of converted returning visits";s:26:"sum_visit_length_returning";s:51:"Total time spent by returning visitors (in seconds)";s:19:"nb_visits_converted";s:23:"Visits with Conversions";s:14:"nb_conversions";s:11:"Conversions";s:7:"revenue";s:7:"Revenue";s:7:"nb_hits";s:9:"Pageviews";s:15:"entry_nb_visits";s:9:"Entrances";s:22:"entry_nb_uniq_visitors";s:16:"Unique entrances";s:14:"exit_nb_visits";s:5:"Exits";s:21:"exit_nb_uniq_visitors";s:12:"Unique exits";s:18:"entry_bounce_count";s:7:"Bounces";s:17:"exit_bounce_count";s:7:"Bounces";s:9:"exit_rate";s:9:"Exit rate";s:26:"sum_daily_nb_uniq_visitors";s:27:"Unique visitors (daily sum)";s:32:"sum_daily_entry_nb_uniq_visitors";s:28:"Unique entrances (daily sum)";s:31:"sum_daily_exit_nb_uniq_visitors";s:24:"Unique exits (daily sum)";s:16:"entry_nb_actions";s:27:"Actions after entering here";s:22:"entry_sum_visit_length";s:61:"Total time spent by visitors (in seconds) after entering here";s:12:"nb_pageviews";s:9:"Pageviews";s:17:"nb_uniq_pageviews";s:16:"Unique Pageviews";s:12:"nb_downloads";s:9:"Downloads";s:17:"nb_uniq_downloads";s:16:"Unique Downloads";s:11:"nb_outlinks";s:8:"Outlinks";s:16:"nb_uniq_outlinks";s:15:"Unique Outlinks";s:11:"nb_searches";s:8:"Searches";s:11:"nb_keywords";s:15:"Unique Keywords";s:19:"avg_time_generation";s:20:"Avg. generation time";s:19:"nb_pages_per_search";s:20:"Search Results pages";s:24:"nb_hits_following_search";s:25:"Clicked in search results";s:9:"nb_events";s:12:"Total events";s:15:"sum_event_value";s:11:"Total value";s:15:"min_event_value";s:13:"Minimum value";s:15:"max_event_value";s:13:"Maximum value";s:15:"avg_event_value";s:13:"Average value";s:20:"nb_events_with_value";s:19:"Events with a value";s:6:"orders";s:16:"Ecommerce Orders";s:17:"ecommerce_revenue";s:15:"Product Revenue";s:16:"visits_evolution";s:16:"Visits Evolution";s:17:"actions_evolution";s:17:"Actions Evolution";s:19:"pageviews_evolution";s:19:"Pageviews Evolution";s:17:"revenue_evolution";s:17:"Revenue Evolution";s:24:"nb_conversions_evolution";s:21:"Conversions Evolution";s:16:"orders_evolution";s:26:"Ecommerce Orders Evolution";s:27:"ecommerce_revenue_evolution";s:25:"Product Revenue Evolution";s:20:"nb_visits_percentage";s:8:"% Visits";s:19:"nb_visits_returning";s:16:"Returning Visits";s:20:"nb_actions_returning";s:27:"Actions by Returning Visits";s:26:"avg_time_on_site_returning";s:43:"Avg. Duration of a Returning Visit (in sec)";s:21:"bounce_rate_returning";s:32:"Bounce Rate for Returning Visits";s:30:"nb_actions_per_visit_returning";s:32:"Avg. Actions per Returning Visit";s:26:"nb_uniq_visitors_returning";s:25:"Unique returning visitors";}} \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_showRawMetrics__API.getProcessedReport_day.xml b/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_showRawMetrics__API.getProcessedReport_day.xml
index 6fdba43d1e..ec3e001105 100644
--- a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_showRawMetrics__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_showRawMetrics__API.getProcessedReport_day.xml
@@ -8,28 +8,22 @@
<module>UserCountry</module>
<action>getCountry</action>
<dimension>Country</dimension>
+ <documentation>This report shows which country your visitors were in when they accessed your website.</documentation>
<metrics>
<nb_visits>Visits</nb_visits>
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
- <processedMetrics>
- <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>
- </processedMetrics>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
<nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
<nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <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>
+ </processedMetrics>
<metricsGoal>
<nb_conversions>Conversions</nb_conversions>
<revenue>Revenue</revenue>
diff --git a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_year__API.getProcessedReport_year.xml b/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_year__API.getProcessedReport_year.xml
index 6713a65b92..f371029f1b 100644
--- a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_year__API.getProcessedReport_year.xml
+++ b/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_year__API.getProcessedReport_year.xml
@@ -8,27 +8,21 @@
<module>UserCountry</module>
<action>getCountry</action>
<dimension>Pays</dimension>
+ <documentation>Ce rapport montre dans quel pays vos visiteurs étaient quand ils ont accédé à votre site web.</documentation>
<metrics>
<nb_visits>Visites</nb_visits>
<nb_actions>Actions</nb_actions>
</metrics>
- <processedMetrics>
- <nb_actions_per_visit>Actions par visite</nb_actions_per_visit>
- <avg_time_on_site>Temps moyen sur le site</avg_time_on_site>
- <bounce_rate>Taux de rebond</bounce_rate>
- </processedMetrics>
<metricsDocumentation>
<nb_visits>Si un visiteur se rend sur votre site web pour la première fois ou s'il visite une page plus de 30 minutes après sa dernière page, il sera enregistré en tant que nouvelle visite.</nb_visits>
<nb_uniq_visitors>Nombre de visiteurs uniques visitant votre site web. Chaque utilisateur n'est compté qu'une seule fois, même s'il visite le site plusieurs fois dans la journée.</nb_uniq_visitors>
<nb_actions>Nombre d'actions effectuées par vos visiteurs. Les actions peuvent être des visites de pages, téléchargements, liens sortants.</nb_actions>
- <nb_actions_per_visit>Nombre moyen d'actions (affichages de page, téléchargements ou liens sortants) qui ont été effectuées durant les visites.</nb_actions_per_visit>
- <avg_time_on_site>Durée moyenne d'une visite</avg_time_on_site>
- <bounce_rate>Pourcentage de visites qui ont eu un affichage unique de page. Cela signifie que le visiteur a quitté le site directement depuis la page d'entrée.</bounce_rate>
- <conversion_rate>Pourcentage de visites qui ont déclenché une conversion en Objectif.</conversion_rate>
- <avg_time_on_page>Temps moyen que les visiteurs ont passé sur cette page (seulement la page, pas le site entier).</avg_time_on_page>
- <nb_hits>Le nombre de fois que cette page a été visitée.</nb_hits>
- <exit_rate>Pourcentage de visites qui ont quitté le site web après avoir visualisé cette page (affichages uniques divisés par sorties)</exit_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <nb_actions_per_visit>Actions par visite</nb_actions_per_visit>
+ <avg_time_on_site>Temps moyen sur le site</avg_time_on_site>
+ <bounce_rate>Taux de rebond</bounce_rate>
+ </processedMetrics>
<metricsGoal>
<nb_conversions>Conversions</nb_conversions>
<revenue>Revenu</revenue>
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Metadata_VisitTime.getVisitInformationPerServerTime__API.getProcessedReport_day.xml b/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Metadata_VisitTime.getVisitInformationPerServerTime__API.getProcessedReport_day.xml
index fb55b9b273..12740b0394 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Metadata_VisitTime.getVisitInformationPerServerTime__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Metadata_VisitTime.getVisitInformationPerServerTime__API.getProcessedReport_day.xml
@@ -9,29 +9,22 @@
<action>getVisitInformationPerServerTime</action>
<dimension>Server time</dimension>
<documentation>This graph shows what time it was in the &lt;strong&gt; server's time zone &lt;/strong&gt; during the visits.</documentation>
- <constantRowsCount>1</constantRowsCount>
<metrics>
<nb_visits>Visits</nb_visits>
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
- <processedMetrics>
- <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>
- </processedMetrics>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
<nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
<nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <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>
+ </processedMetrics>
+ <constantRowsCount>1</constantRowsCount>
<metricsGoal>
<nb_conversions>Conversions</nb_conversions>
<revenue>Revenue</revenue>
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__API.getProcessedReport_day.xml b/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__API.getProcessedReport_day.xml
index b41761c345..79289ce2d7 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__API.getProcessedReport_day.xml
@@ -8,28 +8,22 @@
<module>UserCountry</module>
<action>getCountry</action>
<dimension>Country</dimension>
+ <documentation>This report shows which country your visitors were in when they accessed your website.</documentation>
<metrics>
<nb_visits>Visits</nb_visits>
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
- <processedMetrics>
- <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>
- </processedMetrics>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
<nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
<nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <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>
+ </processedMetrics>
<metricsGoal>
<nb_conversions>Conversions</nb_conversions>
<revenue>Revenue</revenue>
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html b/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html
index 0ea0e0b3cd..78ca134267 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html
+++ b/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html
@@ -4170,7 +4170,7 @@
<table style="border-collapse:collapse; margin-left: 5px;">
<thead style="background-color: rgb(228,226,215); color: rgb(37,87,146); font-size: 11pt;">
<th style="padding: 6px 0;">
- &nbsp;Page URL&nbsp;&nbsp;
+ &nbsp;Entry Page URL&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
&nbsp;Entrances&nbsp;&nbsp;
@@ -4214,7 +4214,7 @@
<table style="border-collapse:collapse; margin-left: 5px;">
<thead style="background-color: rgb(228,226,215); color: rgb(37,87,146); font-size: 11pt;">
<th style="padding: 6px 0;">
- &nbsp;Page URL&nbsp;&nbsp;
+ &nbsp;Exit Page URL&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
&nbsp;Exits&nbsp;&nbsp;
@@ -4452,7 +4452,7 @@
<table style="border-collapse:collapse; margin-left: 5px;">
<thead style="background-color: rgb(228,226,215); color: rgb(37,87,146); font-size: 11pt;">
<th style="padding: 6px 0;">
- &nbsp;Page Name&nbsp;&nbsp;
+ &nbsp;Entry Page title&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
&nbsp;Entrances&nbsp;&nbsp;
@@ -4522,7 +4522,7 @@
<table style="border-collapse:collapse; margin-left: 5px;">
<thead style="background-color: rgb(228,226,215); color: rgb(37,87,146); font-size: 11pt;">
<th style="padding: 6px 0;">
- &nbsp;Page Name&nbsp;&nbsp;
+ &nbsp;Exit Page Title&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
&nbsp;Exits&nbsp;&nbsp;
diff --git a/tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__API.getProcessedReport_range.xml b/tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__API.getProcessedReport_range.xml
index 9c53a29fad..9efeb67c66 100644
--- a/tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__API.getProcessedReport_range.xml
+++ b/tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__API.getProcessedReport_range.xml
@@ -8,27 +8,21 @@
<module>UserCountry</module>
<action>getCountry</action>
<dimension>Country</dimension>
+ <documentation>This report shows which country your visitors were in when they accessed your website.</documentation>
<metrics>
<nb_visits>Visits</nb_visits>
<nb_actions>Actions</nb_actions>
</metrics>
- <processedMetrics>
- <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>
- </processedMetrics>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
<nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
<nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <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>
+ </processedMetrics>
<metricsGoal>
<nb_conversions>Conversions</nb_conversions>
<revenue>Revenue</revenue>
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables__subtable__API.getProcessedReport_day.xml b/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables__subtable__API.getProcessedReport_day.xml
index 4144bf99c5..9b072bf91e 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables__subtable__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables__subtable__API.getProcessedReport_day.xml
@@ -15,24 +15,17 @@
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
</metrics>
+ <metricsDocumentation>
+ <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
+ <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
+ <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
+ </metricsDocumentation>
<processedMetrics>
<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>
<conversion_rate>Conversion Rate</conversion_rate>
</processedMetrics>
- <metricsDocumentation>
- <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
- <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
- <nb_hits>The number of times this page was visited.</nb_hits>
- <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
- </metricsDocumentation>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=CustomVariables&amp;apiAction=getCustomVariablesValuesFromNameId&amp;period=day&amp;date=2010-01-03&amp;idSubtable=</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=CustomVariables&amp;apiAction=getCustomVariablesValuesFromNameId&amp;period=day&amp;date=2009-12-05,2010-01-03&amp;idSubtable=</imageGraphEvolutionUrl>
<uniqueId>CustomVariables_getCustomVariablesValuesFromNameId</uniqueId>
diff --git a/tests/PHPUnit/UI b/tests/PHPUnit/UI
-Subproject a29aec44747e85fd2e95aeefb5236db6561f01b
+Subproject 06b7215cfeda6fabd3acee2db22dd7805e14ad5
diff --git a/tests/PHPUnit/proxy/includes.php b/tests/PHPUnit/proxy/includes.php
index 0ffce4642b..905fbd0d13 100644
--- a/tests/PHPUnit/proxy/includes.php
+++ b/tests/PHPUnit/proxy/includes.php
@@ -14,6 +14,14 @@ require_once PIWIK_INCLUDE_PATH . '/core/EventDispatcher.php';
require_once PIWIK_INCLUDE_PATH . '/core/Piwik.php';
require_once PIWIK_INCLUDE_PATH . '/libs/upgradephp/upgrade.php';
require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/TestingEnvironment.php';
+if (file_exists(PIWIK_INCLUDE_PATH . '/vendor/autoload.php')) {
+ $vendorDirectory = PIWIK_INCLUDE_PATH . '/vendor';
+} else {
+ $vendorDirectory = PIWIK_INCLUDE_PATH . '/../..';
+}
+require_once $vendorDirectory . '/autoload.php';
+require_once $vendorDirectory . '/mustangostang/spyc/Spyc.php';
+require_once $vendorDirectory . '/piwik/device-detector/DeviceDetector.php';
\Piwik\SettingsServer::setMaxExecutionTime(0);