diff --git a/Campaign/CampaignDetector.php b/Campaign/CampaignDetector.php index b231171..438220e 100644 --- a/Campaign/CampaignDetector.php +++ b/Campaign/CampaignDetector.php @@ -12,7 +12,6 @@ namespace Piwik\Plugins\MarketingCampaignsReporting\Campaign; -use Piwik\Common; use Piwik\Plugins\MarketingCampaignsReporting\MarketingCampaignsReporting; use Piwik\Tracker\PageUrl; use Piwik\Tracker\Request; @@ -86,9 +85,6 @@ protected function getValueFromQueryString($param, $queryString) { $valueFromRequest = UrlHelper::getParameterFromQueryString($queryString, $param) ?? ''; $valueFromRequest = trim(urldecode($valueFromRequest)); - if ($param != "mtm_clid") { - $valueFromRequest = Common::mb_strtolower($valueFromRequest); - } $valueFromRequest = substr($valueFromRequest, 0, 250); if (!empty($valueFromRequest)) { return $valueFromRequest; diff --git a/RecordBuilders/CampaignReporting.php b/RecordBuilders/CampaignReporting.php index 992ec99..f6d8dd4 100644 --- a/RecordBuilders/CampaignReporting.php +++ b/RecordBuilders/CampaignReporting.php @@ -17,10 +17,12 @@ use Piwik\ArchiveProcessor\RecordBuilder; use Piwik\Common; use Piwik\Config; +use Piwik\Container\StaticContainer; use Piwik\DataAccess\LogAggregator; use Piwik\DataTable; use Piwik\Metrics; use Piwik\Plugins\MarketingCampaignsReporting\Archiver; +use Piwik\Plugins\MarketingCampaignsReporting\SystemSettings; use Piwik\Version; class CampaignReporting extends RecordBuilder @@ -132,6 +134,7 @@ protected function aggregateFromLogs(LogAggregator $logAggregator, array $record protected function getLabelFromRowDimensions(array $dimensionsAsLabel, array $row): string { + $systemSettings = StaticContainer::get(SystemSettings::class); $labels = []; foreach ($dimensionsAsLabel as $dimensionLabelPart) { if ( @@ -142,6 +145,10 @@ protected function getLabelFromRowDimensions(array $dimensionsAsLabel, array $ro } } $label = implode(Archiver::SEPARATOR_COMBINED_DIMENSIONS, $labels); + if ($label && !$systemSettings->doNotChangeCaseOfUtmParameters->getValue()) { + $label = Common::mb_strtolower($label); + } + return $label; } diff --git a/SystemSettings.php b/SystemSettings.php new file mode 100644 index 0000000..9435cf4 --- /dev/null +++ b/SystemSettings.php @@ -0,0 +1,30 @@ +doNotChangeCaseOfUtmParameters = $this->makeSetting('doNotChangeCaseOfUtmParameters', true, FieldConfig::TYPE_BOOL, function (FieldConfig $field) { + $field->title = Piwik::translate('MarketingCampaignsReporting_DoNotChangeCaseOfUtmParametersTitle'); + $field->description = Piwik::translate('MarketingCampaignsReporting_DoNotChangeCaseOfUtmParametersDescription'); + $field->uiControl = FieldConfig::UI_CONTROL_CHECKBOX; + }); + } +} diff --git a/Updates/5.1.0.php b/Updates/5.1.0.php new file mode 100644 index 0000000..2e456f4 --- /dev/null +++ b/Updates/5.1.0.php @@ -0,0 +1,38 @@ +migration = $factory; + } + + public function doUpdate(Updater $updater) + { + // set the SystemSetting to false for existing installs as it will be true by default + $systemSettings = StaticContainer::get(SystemSettings::class); + $systemSettings->doNotChangeCaseOfUtmParameters->setIsWritableByCurrentUser(true); + $systemSettings->doNotChangeCaseOfUtmParameters->setValue(false); + $systemSettings->save(); + } +} diff --git a/lang/en.json b/lang/en.json index 113df44..1ac7ab8 100644 --- a/lang/en.json +++ b/lang/en.json @@ -18,6 +18,8 @@ "Groups": "Campaign Groups", "Placements": "Campaign Placements", "CampaignIds": "Campaign Ids", - "CombinedSourcesMediums": "Campaign Source - Medium" + "CombinedSourcesMediums": "Campaign Source - Medium", + "DoNotChangeCaseOfUtmParametersTitle": "Keep campaign parameter capitalisation", + "DoNotChangeCaseOfUtmParametersDescription": "When enabled, Matomo will keep the original capitalisation of campaign parameters to ensure compatibility with third-party services like Google. If disabled, all campaign parameters will be converted to lowercase." } } \ No newline at end of file diff --git a/plugin.json b/plugin.json index f6c2f6f..95ea756 100644 --- a/plugin.json +++ b/plugin.json @@ -1,7 +1,7 @@ { "name": "MarketingCampaignsReporting", "description": "Measure the effectiveness of your marketing campaigns. New reports, segments & track up to five channels: campaign, source, medium, keyword, content.", - "version": "5.0.4", + "version": "5.1.0", "keywords": ["Campaign", "Marketing", "Channels", "UTM tags"], "license": "GPL v3+", "homepage": "https://matomo.org", diff --git a/tests/Fixtures/TrackAdvancedCampaigns.php b/tests/Fixtures/TrackAdvancedCampaigns.php index 214d4ce..e1d4147 100644 --- a/tests/Fixtures/TrackAdvancedCampaigns.php +++ b/tests/Fixtures/TrackAdvancedCampaigns.php @@ -13,8 +13,10 @@ namespace Piwik\Plugins\MarketingCampaignsReporting\tests\Fixtures; use Piwik; +use Piwik\Container\StaticContainer; use Piwik\Date; use Piwik\Tests\Framework\Fixture; +use Piwik\Plugins\MarketingCampaignsReporting\SystemSettings; class TrackAdvancedCampaigns extends Fixture { @@ -39,6 +41,11 @@ public function setUp(): void { Piwik\Plugin\Manager::getInstance()->activatePlugin('MarketingCampaignsReporting'); + $systemSettings = StaticContainer::get(SystemSettings::class); + $systemSettings->doNotChangeCaseOfUtmParameters->setIsWritableByCurrentUser(true); + $systemSettings->doNotChangeCaseOfUtmParameters->setValue(false); + $systemSettings->save(); + $this->orderIndex = 0; $this->setUpWebsite(); diff --git a/tests/Integration/SystemSettingsTest.php b/tests/Integration/SystemSettingsTest.php new file mode 100644 index 0000000..556b112 --- /dev/null +++ b/tests/Integration/SystemSettingsTest.php @@ -0,0 +1,80 @@ +settings = new SystemSettings(); + } + + public function tearDown(): void + { + parent::tearDown(); + + Fixture::resetTranslations(); + } + + public function test_doNotChangeCaseOfUtmParameters_default() + { + $this->assertTrue($this->settings->doNotChangeCaseOfUtmParameters->getValue()); + } + + public function test_doNotChangeCaseOfUtmParameters_shouldThrowException() + { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('The value for the "Keep campaign parameter capitalisation" field in the "MarketingCampaignsReporting" plugin is not allowed'); + $this->settings->doNotChangeCaseOfUtmParameters->setValue('aa'); + } + + public function test_doNotChangeCaseOfUtmParameters_updateSuccess() + { + $this->settings->doNotChangeCaseOfUtmParameters->setValue(true); + $this->settings->save(); + $this->assertTrue($this->settings->doNotChangeCaseOfUtmParameters->getValue()); + + $this->settings->doNotChangeCaseOfUtmParameters->setValue(1); + $this->settings->save(); + $this->assertTrue($this->settings->doNotChangeCaseOfUtmParameters->getValue()); + + $this->settings->doNotChangeCaseOfUtmParameters->setValue(0); + $this->settings->save(); + $this->assertFalse($this->settings->doNotChangeCaseOfUtmParameters->getValue()); + + $this->settings->doNotChangeCaseOfUtmParameters->setValue('1'); + $this->settings->save(); + $this->assertTrue($this->settings->doNotChangeCaseOfUtmParameters->getValue()); + + $this->settings->doNotChangeCaseOfUtmParameters->setValue('0'); + $this->settings->save(); + $this->assertFalse($this->settings->doNotChangeCaseOfUtmParameters->getValue()); + } +} diff --git a/tests/System/TrackSeveralCampaignsTest.php b/tests/System/TrackSeveralCampaignsTest.php index 259f0e5..31f5971 100644 --- a/tests/System/TrackSeveralCampaignsTest.php +++ b/tests/System/TrackSeveralCampaignsTest.php @@ -70,6 +70,7 @@ public function getApiForTesting() { $dateWithPluginEnabled = self::$fixture->dateTimeWithPluginEnabled; $dateTime = self::$fixture->dateTime; + $phpVersionPrefix = version_compare(PHP_VERSION, 8.3, '<') ? 'min_php_' : ''; $apiToTest[] = [ 'API.get', @@ -77,7 +78,7 @@ public function getApiForTesting() 'idSite' => self::$fixture->idSite, 'date' => $dateWithPluginEnabled, 'periods' => ['day'], - 'testSuffix' => version_compare(Version::VERSION, '5.2.0-b6', '<') ? 'old' : '', + 'testSuffix' => (!empty($phpVersionPrefix) ? $phpVersionPrefix : 'max_php_') . (version_compare(Version::VERSION, '5.2.0-b6', '<') ? 'old' : ''), ] ]; @@ -95,6 +96,7 @@ public function getApiForTesting() 'date' => $dateWithPluginEnabled, 'periods' => ['day'], 'xmlFieldsToRemove' => $columnsToHide, + 'testSuffix' => $phpVersionPrefix, ] ]; @@ -214,13 +216,15 @@ public function getReferrerApiForTesting() 'Referrers.getCampaigns', ]; + $phpVersionPrefix = version_compare(PHP_VERSION, 8.3, '<') ? 'min_php_' : ''; + $apiToTest[] = [ $api, [ 'idSite' => self::$fixture->idSite, 'date' => $dateWithPluginEnabled, 'periods' => ['day'], - 'testSuffix' => 'expanded', + 'testSuffix' => $phpVersionPrefix . 'expanded', 'otherRequestParameters' => ['expanded' => 1], ] ]; @@ -230,7 +234,7 @@ public function getReferrerApiForTesting() 'idSite' => self::$fixture->idSite, 'date' => $dateWithPluginEnabled, 'periods' => ['day'], - 'testSuffix' => 'flat', + 'testSuffix' => $phpVersionPrefix . 'flat', 'otherRequestParameters' => ['flat' => 1, 'expanded' => 0], ] ]; diff --git a/tests/System/expected/test___API.get_day.xml b/tests/System/expected/test___API.get_day.xml index 8852ca9..80a1a01 100644 --- a/tests/System/expected/test___API.get_day.xml +++ b/tests/System/expected/test___API.get_day.xml @@ -33,7 +33,7 @@ 0 0 0 - 17 + 18 0 0 0 @@ -87,4 +87,4 @@ 100% 1 121 - \ No newline at end of file + diff --git a/tests/System/expected/test___Live.getLastVisitsDetails_day.xml b/tests/System/expected/test___Live.getLastVisitsDetails_day.xml index dfeaacc..0d7a6ca 100644 --- a/tests/System/expected/test___Live.getLastVisitsDetails_day.xml +++ b/tests/System/expected/test___Live.getLastVisitsDetails_day.xml @@ -92,8 +92,8 @@ 1 campaign Campaigns - ecommerce_campaign - ecommerce_keyword + Ecommerce_campaign + Ecommerce_keyword @@ -158,14 +158,14 @@ - ecommmerce_campaignid - ecommerce_content - ecommerce_keyword - ecommerce_medium - ecommerce_campaign - ecommerce_source - ecommmerce_campaigngroup - ecommmerce_campaignplacement + Ecommmerce_CampaignId + Ecommerce_content + Ecommerce_keyword + Ecommerce_medium + Ecommerce_campaign + Ecommerce_source + Ecommmerce_CampaignGroup + Ecommmerce_CampaignPlacement 1 @@ -254,8 +254,8 @@ 1 campaign Campaigns - ecommerce_campaign - ecommerce_keyword + Ecommerce_campaign + Ecommerce_keyword @@ -320,14 +320,14 @@ - ecommmerce_campaignid - ecommerce_content - ecommerce_keyword - ecommerce_medium - ecommerce_campaign - ecommerce_source - ecommmerce_campaigngroup - ecommmerce_campaignplacement + Ecommmerce_CampaignId + Ecommerce_content + Ecommerce_keyword + Ecommerce_medium + Ecommerce_campaign + Ecommerce_source + Ecommmerce_CampaignGroup + Ecommmerce_CampaignPlacement 1 @@ -443,7 +443,7 @@ 1 campaign Campaigns - campaign_with_two_goals_conversions + Campaign_with_two_goals_conversions @@ -513,7 +513,7 @@ - campaign_with_two_goals_conversions + Campaign_with_two_goals_conversions @@ -578,8 +578,8 @@ 1 campaign Campaigns - lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "nam - lenghty "keyword"...lenghty "keyword"...lenghty "keyword"...lenghty "keyword"...lenghty "keyword"...lenghty "keyword"...lenghty "keyword"...lenghty "keyword"...lenghty "keyword"...lenghty "keyword"...lenghty "keyword"...lenghty "keyword"...lenghty "k + Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAM + Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "K @@ -646,10 +646,10 @@ - lenghty "keyword"...lenghty "keyword"...lenghty "keyword"...lenghty "keyword"...lenghty "keyword"...lenghty "keyword"...lenghty "keyword"...lenghty "keyword"...lenghty "keyword"...lenghty "keyword"...lenghty "keyword"...lenghty "keyword"...lenghty "k + Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "K - lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "nam - lenghty "source"...lenghty "source"...lenghty "source"... + Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAM + Lenghty "SOURCE"...Lenghty "SOURCE"...Lenghty "SOURCE"... @@ -713,7 +713,7 @@ 1 campaign Campaigns - campaignnamedimension - no other dimension for this visit + CampaignNameDimension - No Other Dimension for this visit @@ -783,7 +783,7 @@ - campaignnamedimension - no other dimension for this visit + CampaignNameDimension - No Other Dimension for this visit @@ -848,8 +848,8 @@ 1 campaign Campaigns - campaign_hashed - keyword from #hash tag parameter + Campaign_Hashed + Keyword from #hash tag parameter @@ -916,9 +916,9 @@ - keyword from #hash tag parameter + Keyword from #hash tag parameter - campaign_hashed + Campaign_Hashed @@ -983,8 +983,8 @@ 1 campaign Campaigns - default_offer - not_an_advanced_campaign_at_first + Default_Offer + Not_An_Advanced_Campaign_At_first @@ -1051,9 +1051,9 @@ - not_an_advanced_campaign_at_first + Not_An_Advanced_Campaign_At_first - default_offer + Default_Offer diff --git a/tests/System/expected/test___MarketingCampaignsReporting.getKeywordContentFromNameId_month.xml b/tests/System/expected/test___MarketingCampaignsReporting.getKeywordContentFromNameId_month.xml index c234bed..0fe4a08 100644 --- a/tests/System/expected/test___MarketingCampaignsReporting.getKeywordContentFromNameId_month.xml +++ b/tests/System/expected/test___MarketingCampaignsReporting.getKeywordContentFromNameId_month.xml @@ -1,2 +1,15 @@ - \ No newline at end of file + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + referrerName==October_Offer;referrerType==campaign;referrerKeyword==Mot_cl%C3%A9_P%C3%89P%C3%88RE + + \ No newline at end of file diff --git a/tests/System/expected/test_expanded__Referrers.getCampaigns_day.xml b/tests/System/expected/test_expanded__Referrers.getCampaigns_day.xml index 349c65e..50f7220 100644 --- a/tests/System/expected/test_expanded__Referrers.getCampaigns_day.xml +++ b/tests/System/expected/test_expanded__Referrers.getCampaigns_day.xml @@ -1,7 +1,7 @@ - + 1 2 2 @@ -10,30 +10,10 @@ 1444 2 1 - - - 1 - 1 - 555 - 5 - - - 1 - 1 - 555 - 0 - 0 - 0 - 0 - 5 - - - 1 - 555 - referrerType==campaign;referrerName==ecommerce_campaign + referrerType==campaign;referrerName==Ecommerce_campaign - + 1 2 2 @@ -42,26 +22,6 @@ 1444 2 1 - - - 1 - 1 - 555 - 5 - - - 1 - 1 - 555 - 0 - 0 - 0 - 0 - 5 - - - 1 - 555 @@ -266,7 +226,7 @@ - + 1 1 1 @@ -275,10 +235,10 @@ 0 1 0 - referrerType==campaign;referrerName==campaignnamedimension+-+no+other+dimension+for+this+visit + referrerType==campaign;referrerName==CampaignNameDimension+-+No+Other+Dimension+for+this+visit - + 1 1 1 @@ -287,10 +247,10 @@ 0 1 0 - referrerType==campaign;referrerName==campaign_hashed + referrerType==campaign;referrerName==Campaign_Hashed - + 1 1 1 @@ -303,7 +263,7 @@ - + 1 1 1 @@ -312,24 +272,10 @@ 725 1 1 - - - 2 - 1 - 1111 - - - 1 - 1 - 3333 - - - 3 - 4444 - referrerType==campaign;referrerName==campaign_with_two_goals_conversions + referrerType==campaign;referrerName==Campaign_with_two_goals_conversions - + 1 1 1 @@ -338,10 +284,10 @@ 0 1 0 - referrerType==campaign;referrerName==default_offer + referrerType==campaign;referrerName==Default_Offer - + 1 1 1 @@ -354,7 +300,7 @@ - + 1 1 1 @@ -363,10 +309,10 @@ 0 1 0 - referrerType==campaign;referrerName==lenghty+%22name%22...lenghty+%22name%22...lenghty+%22name%22...lenghty+%22name%22...lenghty+%22name%22...lenghty+%22name%22...lenghty+%22name%22...lenghty+%22name%22...lenghty+%22name%22...lenghty+%22name%22...lenghty+%22name%22...lenghty+%22name%22...lenghty+%22name%22...lenghty+%22name%22...lenghty+%22nam + referrerType==campaign;referrerName==Lenghty+%22NAME%22...Lenghty+%22NAME%22...Lenghty+%22NAME%22...Lenghty+%22NAME%22...Lenghty+%22NAME%22...Lenghty+%22NAME%22...Lenghty+%22NAME%22...Lenghty+%22NAME%22...Lenghty+%22NAME%22...Lenghty+%22NAME%22...Lenghty+%22NAME%22...Lenghty+%22NAME%22...Lenghty+%22NAME%22...Lenghty+%22NAME%22...Lenghty+%22NAM - + 1 1 1 @@ -379,7 +325,7 @@ - + 1 1 1 @@ -388,10 +334,10 @@ 0 1 0 - referrerType==campaign;referrerName==november_offer + referrerType==campaign;referrerName==November_Offer - + 1 1 1 @@ -404,7 +350,7 @@ - + 1 1 1 @@ -413,10 +359,10 @@ 0 1 0 - referrerType==campaign;referrerName==october_offer + referrerType==campaign;referrerName==October_Offer - + 1 1 1 @@ -429,7 +375,7 @@ - + 1 1 1 @@ -438,6 +384,76 @@ 0 1 0 - referrerType==campaign;referrerName==should_be_new_visit + referrerType==campaign;referrerName==SHOULD_BE_NEW_VISIT + + + + + + 2 + 1 + 1111 + + + 1 + 1 + 3333 + + + 3 + 4444 + 0 + referrerType==campaign;referrerName==campaign_with_two_goals_conversions + + + + + + 1 + 1 + 555 + 5 + + + 1 + 1 + 555 + 0 + 0 + 0 + 0 + 5 + + + 1 + 555 + 0 + referrerType==campaign;referrerName==ecommerce_campaign + + + + + + 1 + 1 + 555 + 5 + + + 1 + 1 + 555 + 0 + 0 + 0 + 0 + 5 + + + 1 + 555 + 0 + + \ No newline at end of file diff --git a/tests/System/expected/test_flat__Referrers.getCampaigns_day.xml b/tests/System/expected/test_flat__Referrers.getCampaigns_day.xml index 73b7ead..6ad77af 100644 --- a/tests/System/expected/test_flat__Referrers.getCampaigns_day.xml +++ b/tests/System/expected/test_flat__Referrers.getCampaigns_day.xml @@ -1,7 +1,7 @@ - + 1 2 2 @@ -10,29 +10,9 @@ 1444 2 1 - - - 1 - 1 - 555 - 5 - - - 1 - 1 - 555 - 0 - 0 - 0 - 0 - 5 - - - 1 - 555 - referrerType==campaign;referrerName==ecommerce_campaign;referrerType==campaign;referrerKeyword==ecommerce_keyword - ecommerce_campaign - ecommerce_keyword + referrerType==campaign;referrerName==Ecommerce_campaign;referrerType==campaign;referrerKeyword==Ecommerce_keyword + Ecommerce_campaign + Ecommerce_keyword @@ -147,7 +127,7 @@ keyword h - + 1 1 1 @@ -156,11 +136,11 @@ 0 1 0 - referrerType==campaign;referrerName==campaignnamedimension+-+no+other+dimension+for+this+visit - campaignnamedimension - no other dimension for this visit + referrerType==campaign;referrerName==CampaignNameDimension+-+No+Other+Dimension+for+this+visit + CampaignNameDimension - No Other Dimension for this visit - + 1 1 1 @@ -169,12 +149,12 @@ 0 1 0 - referrerType==campaign;referrerName==campaign_hashed;referrerType==campaign;referrerKeyword==keyword+from+%23hash+tag+parameter - campaign_hashed - keyword from #hash tag parameter + referrerType==campaign;referrerName==Campaign_Hashed;referrerType==campaign;referrerKeyword==Keyword+from+%23hash+tag+parameter + Campaign_Hashed + Keyword from #hash tag parameter - + 1 1 1 @@ -183,25 +163,11 @@ 725 1 1 - - - 2 - 1 - 1111 - - - 1 - 1 - 3333 - - - 3 - 4444 - referrerType==campaign;referrerName==campaign_with_two_goals_conversions - campaign_with_two_goals_conversions + referrerType==campaign;referrerName==Campaign_with_two_goals_conversions + Campaign_with_two_goals_conversions - + 1 1 1 @@ -210,12 +176,12 @@ 0 1 0 - referrerType==campaign;referrerName==default_offer;referrerType==campaign;referrerKeyword==not_an_advanced_campaign_at_first - default_offer - not_an_advanced_campaign_at_first + referrerType==campaign;referrerName==Default_Offer;referrerType==campaign;referrerKeyword==Not_An_Advanced_Campaign_At_first + Default_Offer + Not_An_Advanced_Campaign_At_first - + 1 1 1 @@ -224,12 +190,12 @@ 0 1 0 - referrerType==campaign;referrerName==lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "nam;referrerType==campaign;referrerKeyword==lenghty+%22keyword%22...lenghty+%22keyword%22...lenghty+%22keyword%22...lenghty+%22keyword%22...lenghty+%22keyword%22...lenghty+%22keyword%22...lenghty+%22keyword%22...lenghty+%22keyword%22...lenghty+%22keyword%22...lenghty+%22keyword%22...lenghty+%22keyword%22...lenghty+%22keyword%22...lenghty+%22k - lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "name"...lenghty "nam - lenghty "keyword"...lenghty "keyword"...lenghty "keyword"...lenghty "keyword"...lenghty "keyword"...lenghty "keyword"...lenghty "keyword"...lenghty "keyword"...lenghty "keyword"...lenghty "keyword"...lenghty "keyword"...lenghty "keyword"...lenghty "k + referrerType==campaign;referrerName==Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAM;referrerType==campaign;referrerKeyword==Lenghty+%22KEYWORD%22...Lenghty+%22KEYWORD%22...Lenghty+%22KEYWORD%22...Lenghty+%22KEYWORD%22...Lenghty+%22KEYWORD%22...Lenghty+%22KEYWORD%22...Lenghty+%22KEYWORD%22...Lenghty+%22KEYWORD%22...Lenghty+%22KEYWORD%22...Lenghty+%22KEYWORD%22...Lenghty+%22KEYWORD%22...Lenghty+%22KEYWORD%22...Lenghty+%22K + Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAM + Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "K - + 1 1 1 @@ -238,12 +204,12 @@ 0 1 0 - referrerType==campaign;referrerName==november_offer;referrerType==campaign;referrerKeyword==mot_cl%C3%A9_p%C3%A9p%C3%A8re - november_offer - mot_clé_pépère + referrerType==campaign;referrerName==November_Offer;referrerType==campaign;referrerKeyword==Mot_cl%C3%A9_P%C3%89P%C3%88RE + November_Offer + Mot_clé_PÉPÈRE - + 1 1 1 @@ -252,12 +218,12 @@ 0 1 0 - referrerType==campaign;referrerName==october_offer;referrerType==campaign;referrerKeyword==mot_cl%C3%A9_p%C3%A9p%C3%A8re - october_offer - mot_clé_pépère + referrerType==campaign;referrerName==October_Offer;referrerType==campaign;referrerKeyword==Mot_cl%C3%A9_P%C3%89P%C3%88RE + October_Offer + Mot_clé_PÉPÈRE - + 1 1 1 @@ -266,7 +232,54 @@ 0 1 0 - referrerType==campaign;referrerName==should_be_new_visit - should_be_new_visit + referrerType==campaign;referrerName==SHOULD_BE_NEW_VISIT + SHOULD_BE_NEW_VISIT + + + + + + 2 + 1 + 1111 + + + 1 + 1 + 3333 + + + 3 + 4444 + 0 + referrerType==campaign;referrerName==campaign_with_two_goals_conversions + campaign_with_two_goals_conversions + + + + + + 1 + 1 + 555 + 5 + + + 1 + 1 + 555 + 0 + 0 + 0 + 0 + 5 + + + 1 + 555 + 0 + referrerType==campaign;referrerName==ecommerce_campaign;referrerType==campaign;referrerKeyword==ecommerce_keyword + ecommerce_campaign + ecommerce_keyword \ No newline at end of file diff --git a/tests/System/expected/test_max_php___API.get_day.xml b/tests/System/expected/test_max_php___API.get_day.xml new file mode 100644 index 0000000..d27cbbd --- /dev/null +++ b/tests/System/expected/test_max_php___API.get_day.xml @@ -0,0 +1,90 @@ + + + 1 + 18 + 0 + 18 + 1 + 18 + 2169 + 1 + 1 + 1 + 0 + 1 + 100% + 1 + 0 + 17 + 17 + 1 + 0 + 1 + 100% + 1 + 128 + 0 + 0 + 0 + 0 + 18 + 0 + 0 + 0 + 0 + 0 + 19 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 4 + 2 + 4999 + 11.11% + 0 + 0 + 0 + 0% + 4 + 2 + 4999 + 11.76% + 0 + 0 + 0 + 18 + 18 + 0 + 0 + 0 + 0 + 0 + 0 + 18 + 0% + 0% + 100% + 0% + 0% + 100% + 1 + 121 + \ No newline at end of file diff --git a/tests/System/expected/test_max_php_old__API.get_day.xml b/tests/System/expected/test_max_php_old__API.get_day.xml new file mode 100644 index 0000000..5ff2310 --- /dev/null +++ b/tests/System/expected/test_max_php_old__API.get_day.xml @@ -0,0 +1,89 @@ + + + 1 + 18 + 0 + 18 + 1 + 18 + 2169 + 1 + 1 + 1 + 0 + 1 + 100% + 1 + 0 + 17 + 17 + 1 + 0 + 1 + 100% + 1 + 128 + 0 + 0 + 0 + 0 + 18 + 0 + 0 + 0 + 0 + 0 + 19 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 4 + 2 + 4999 + 11.11% + 0 + 0 + 0 + 0% + 4 + 2 + 4999 + 11.76% + 0 + 0 + 0 + 18 + 18 + 0 + 0 + 0 + 0 + 0 + 0 + 0% + 0% + 100% + 0% + 0% + 100% + 1 + 121 + diff --git a/tests/System/expected/test_min_php___API.get_day.xml b/tests/System/expected/test_min_php___API.get_day.xml new file mode 100644 index 0000000..80a1a01 --- /dev/null +++ b/tests/System/expected/test_min_php___API.get_day.xml @@ -0,0 +1,90 @@ + + + 1 + 18 + 0 + 18 + 1 + 18 + 2169 + 1 + 1 + 1 + 0 + 1 + 100% + 1 + 0 + 17 + 17 + 1 + 0 + 1 + 100% + 1 + 128 + 0 + 0 + 0 + 0 + 18 + 0 + 0 + 0 + 0 + 0 + 18 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 4 + 2 + 4999 + 11.11% + 0 + 0 + 0 + 0% + 4 + 2 + 4999 + 11.76% + 0 + 0 + 0 + 18 + 18 + 0 + 0 + 0 + 0 + 0 + 0 + 18 + 0% + 0% + 100% + 0% + 0% + 100% + 1 + 121 + diff --git a/tests/System/expected/test_min_php___Live.getLastVisitsDetails_day.xml b/tests/System/expected/test_min_php___Live.getLastVisitsDetails_day.xml new file mode 100644 index 0000000..a752a77 --- /dev/null +++ b/tests/System/expected/test_min_php___Live.getLastVisitsDetails_day.xml @@ -0,0 +1,1466 @@ + + + + 1 + 27 + 156.5.3.2 + + e16cf2bbaeea2c88 + + + action + http://example.com/ + Homepage + 8 + + + 28 + + 1083 + 18 min 3s + 1 + Homepage + http://example.com/ + + plugins/Morpheus/images/action.svg + + 0 M + + + ecommerceOrder + Ecommerce_ORDER_ID_1 + 555 + 0 + 0 + 0 + 0 + 5 + + + campaign + Ecommerce_campaign + Ecommerce_keyword + + + item SKU + item name + item category + 111 + 5 + + item category + + + + plugins/Morpheus/images/ecommerceOrder.png + plugins/Morpheus/images/ecommerceOrder.svg + Ordered (Ecommerce_ORDER_ID_1) + $555 revenue - 5 items: item name) + + + + 0 + USD + $ + + + + + Piwik test + + + + + + + + returning + plugins/Live/images/returningVisitor.png + 1 + plugins/Morpheus/images/goal.svg + 10 + ordered + plugins/Morpheus/images/ecommerceOrder.svg + 0 + 35640 + 0 + 0 + 1083 + 18 min 3s + 0 + 1 + 1 + campaign + Campaigns + Ecommerce_campaign + Ecommerce_keyword + + + + + + + fr + French + Desktop + plugins/Morpheus/icons/dist/devices/desktop.png + Unknown + Generic Desktop + Windows XP + Windows + plugins/Morpheus/icons/dist/os/WIN.png + WIN + XP + Gecko + Gecko (Firefox) + Firefox 3.6 + Firefox + plugins/Morpheus/icons/dist/browsers/FF.png + FF + 3.6 + 555 + 1 + 5 + 555 + 1 + 5 + 0 + Europe + eur + France + fr + plugins/Morpheus/icons/dist/flags/fr.png + + + + France + + + 12:34:06 + 12 + 0 + 3600 + 1024x768 + cookie, flash, java + + + plugins/Morpheus/icons/dist/plugins/cookie.png + cookie + + + plugins/Morpheus/icons/dist/plugins/flash.png + flash + + + plugins/Morpheus/icons/dist/plugins/java.png + java + + + + + Ecommmerce_CampaignId + Ecommerce_content + Ecommerce_keyword + Ecommerce_medium + Ecommerce_campaign + Ecommerce_source + Ecommmerce_CampaignGroup + Ecommmerce_CampaignPlacement + + + 1 + 26 + 156.5.3.2 + + e16cf2bbaeea2c88 + + + action + http://example.com/ + Homepage + 8 + + + 27 + + 361 + 6 min 1s + 1 + Homepage + http://example.com/ + + plugins/Morpheus/images/action.svg + + 0 M + + + ecommerceAbandonedCart + 555 + 5 + + + campaign + Ecommerce_campaign + Ecommerce_keyword + + + item SKU + item name + item category + 111 + 5 + + item category + + + + plugins/Morpheus/images/ecommerceAbandonedCart.png + plugins/Morpheus/images/ecommerceAbandonedCart.svg + Abandoned Cart + $555 revenue - 5 items: item name) + + + + 0 + USD + $ + + + + + Piwik test + + + + + + + + returning + plugins/Live/images/returningVisitor.png + 0 + + 9 + abandonedCart + plugins/Morpheus/images/ecommerceAbandonedCart.svg + 0 + 32040 + 0 + + 361 + 6 min 1s + 0 + 1 + 1 + campaign + Campaigns + Ecommerce_campaign + Ecommerce_keyword + + + + + + + fr + French + Desktop + plugins/Morpheus/icons/dist/devices/desktop.png + Unknown + Generic Desktop + Windows XP + Windows + plugins/Morpheus/icons/dist/os/WIN.png + WIN + XP + Gecko + Gecko (Firefox) + Firefox 3.6 + Firefox + plugins/Morpheus/icons/dist/browsers/FF.png + FF + 3.6 + 555 + 1 + 5 + 555 + 1 + 5 + 0 + Europe + eur + France + fr + plugins/Morpheus/icons/dist/flags/fr.png + + + + France + + + 12:34:06 + 12 + 0 + 3600 + 1024x768 + cookie, flash, java + + + plugins/Morpheus/icons/dist/plugins/cookie.png + cookie + + + plugins/Morpheus/icons/dist/plugins/flash.png + flash + + + plugins/Morpheus/icons/dist/plugins/java.png + java + + + + + Ecommmerce_CampaignId + Ecommerce_content + Ecommerce_keyword + Ecommerce_medium + Ecommerce_campaign + Ecommerce_source + Ecommmerce_CampaignGroup + Ecommmerce_CampaignPlacement + + + 1 + 25 + 156.5.3.2 + + e16cf2bbaeea2c88 + + + action + http://example.com/homepage + this is a goal conversion <-- goal conversion + 11 + + + 26 + + 725 + 12 min 5s + 1 + this is a goal conversion <-- goal conversion + http://example.com/homepage + + plugins/Morpheus/images/action.svg + + 0 M + + + goal + title match + 1 + + 10 + 26 + + http://example.com/homepage + campaign + campaign_with_two_goals_conversions + + plugins/Morpheus/images/goal.png + plugins/Morpheus/images/goal.svg + Goal conversion + title match ($10 revenue) + + + + goal + title match + 1 + + 1101 + + + http://example.com/anotherpage + campaign + Campaign_with_two_goals_conversions + + plugins/Morpheus/images/goal.png + plugins/Morpheus/images/goal.svg + Goal conversion + title match ($1,101 revenue) + + + + goal + title match + 2 + + 3333 + + + http://example.com/anotherpage + campaign + Campaign_with_two_goals_conversions + + plugins/Morpheus/images/goal.png + plugins/Morpheus/images/goal.svg + Goal conversion + title match ($3,333 revenue) + + + + 3 + USD + $ + + + + + Piwik test + + + + + + + + returning + plugins/Live/images/returningVisitor.png + 1 + plugins/Morpheus/images/goal.svg + 8 + none + + 0 + 28440 + 0 + + 725 + 12 min 5s + 0 + 1 + 1 + campaign + Campaigns + Campaign_with_two_goals_conversions + + + + + + + + fr + French + Desktop + plugins/Morpheus/icons/dist/devices/desktop.png + Unknown + Generic Desktop + Windows XP + Windows + plugins/Morpheus/icons/dist/os/WIN.png + WIN + XP + Gecko + Gecko (Firefox) + Firefox 3.6 + Firefox + plugins/Morpheus/icons/dist/browsers/FF.png + FF + 3.6 + 555 + 1 + 5 + 555 + 1 + 5 + 0 + Europe + eur + France + fr + plugins/Morpheus/icons/dist/flags/fr.png + + + + France + + + 12:34:06 + 12 + 0 + 3600 + 1024x768 + cookie, flash, java + + + plugins/Morpheus/icons/dist/plugins/cookie.png + cookie + + + plugins/Morpheus/icons/dist/plugins/flash.png + flash + + + plugins/Morpheus/icons/dist/plugins/java.png + java + + + + + + + + + Campaign_with_two_goals_conversions + + + + + + 1 + 24 + 156.5.3.2 + + e16cf2bbaeea2c88 + + + action + http://example.com/ + Verrrrry long Campaign Dimensions, check they are truncated + 8 + + + 25 + + 0 + 0s + 1 + Verrrrry long Campaign Dimensions, check they are truncated + http://example.com/ + + plugins/Morpheus/images/action.svg + + 0 M + + + 0 + USD + $ + + + + + Piwik test + + + + + + + + returning + plugins/Live/images/returningVisitor.png + 0 + + 7 + none + + 0 + 24840 + 0 + + 0 + 0s + 0 + 1 + 1 + campaign + Campaigns + Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAM + Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "K + + + + + + + fr + French + Desktop + plugins/Morpheus/icons/dist/devices/desktop.png + Unknown + Generic Desktop + Windows XP + Windows + plugins/Morpheus/icons/dist/os/WIN.png + WIN + XP + Gecko + Gecko (Firefox) + Firefox 3.6 + Firefox + plugins/Morpheus/icons/dist/browsers/FF.png + FF + 3.6 + 555 + 1 + 5 + 555 + 1 + 5 + 0 + Europe + eur + France + fr + plugins/Morpheus/icons/dist/flags/fr.png + + + + France + + + 12:34:06 + 12 + 0 + 3600 + 1024x768 + cookie, flash, java + + + plugins/Morpheus/icons/dist/plugins/cookie.png + cookie + + + plugins/Morpheus/icons/dist/plugins/flash.png + flash + + + plugins/Morpheus/icons/dist/plugins/java.png + java + + + + + + + Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "K + + Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAM + Lenghty "SOURCE"...Lenghty "SOURCE"...Lenghty "SOURCE"... + + + + + 1 + 23 + 156.5.3.2 + + e16cf2bbaeea2c88 + + + action + http://example.com/homepage + Campaign dimensions are found in the landing page #hash tag + 11 + + + 24 + + 0 + 0s + 1 + Campaign dimensions are found in the landing page #hash tag + http://example.com/homepage + + plugins/Morpheus/images/action.svg + + 0 M + + + 0 + USD + $ + + + + + Piwik test + + + + + + + + returning + plugins/Live/images/returningVisitor.png + 0 + + 6 + none + + 0 + 21240 + 0 + + 0 + 0s + 0 + 1 + 1 + campaign + Campaigns + CampaignNameDimension - No Other Dimension for this visit + + + + + + + + fr + French + Desktop + plugins/Morpheus/icons/dist/devices/desktop.png + Unknown + Generic Desktop + Windows XP + Windows + plugins/Morpheus/icons/dist/os/WIN.png + WIN + XP + Gecko + Gecko (Firefox) + Firefox 3.6 + Firefox + plugins/Morpheus/icons/dist/browsers/FF.png + FF + 3.6 + 555 + 1 + 5 + 555 + 1 + 5 + 0 + Europe + eur + France + fr + plugins/Morpheus/icons/dist/flags/fr.png + + + + France + + + 12:34:06 + 12 + 0 + 3600 + 1024x768 + cookie, flash, java + + + plugins/Morpheus/icons/dist/plugins/cookie.png + cookie + + + plugins/Morpheus/icons/dist/plugins/flash.png + flash + + + plugins/Morpheus/icons/dist/plugins/java.png + java + + + + + + + + + CampaignNameDimension - No Other Dimension for this visit + + + + + + 1 + 22 + 156.5.3.2 + + e16cf2bbaeea2c88 + + + action + http://example.com/homepage + Campaign dimensions are found in the landing page #hash tag + 11 + + + 23 + + 0 + 0s + 1 + Campaign dimensions are found in the landing page #hash tag + http://example.com/homepage + + plugins/Morpheus/images/action.svg + + 0 M + + + 0 + USD + $ + + + + + Piwik test + + + + + + + + returning + plugins/Live/images/returningVisitor.png + 0 + + 5 + none + + 0 + 17640 + 0 + + 0 + 0s + 0 + 1 + 1 + campaign + Campaigns + Campaign_Hashed + Keyword from #hash tag parameter + + + + + + + fr + French + Desktop + plugins/Morpheus/icons/dist/devices/desktop.png + Unknown + Generic Desktop + Windows XP + Windows + plugins/Morpheus/icons/dist/os/WIN.png + WIN + XP + Gecko + Gecko (Firefox) + Firefox 3.6 + Firefox + plugins/Morpheus/icons/dist/browsers/FF.png + FF + 3.6 + 555 + 1 + 5 + 555 + 1 + 5 + 0 + Europe + eur + France + fr + plugins/Morpheus/icons/dist/flags/fr.png + + + + France + + + 12:34:06 + 12 + 0 + 3600 + 1024x768 + cookie, flash, java + + + plugins/Morpheus/icons/dist/plugins/cookie.png + cookie + + + plugins/Morpheus/icons/dist/plugins/flash.png + flash + + + plugins/Morpheus/icons/dist/plugins/java.png + java + + + + + + + Keyword from #hash tag parameter + + Campaign_Hashed + + + + + + 1 + 21 + 156.5.3.2 + + e16cf2bbaeea2c88 + + + action + http://example.com/ + Coming back with a basic non advanced campaign which will be counted as advanced anyway. Kaboom. + 8 + + + 22 + + 0 + 0s + 1 + Coming back with a basic non advanced campaign which will be counted as advanced anyway. Kaboom. + http://example.com/ + + plugins/Morpheus/images/action.svg + + 0 M + + + 0 + USD + $ + + + + + Piwik test + + + + + + + + returning + plugins/Live/images/returningVisitor.png + 0 + + 4 + none + + 0 + 14040 + 0 + + 0 + 0s + 0 + 1 + 1 + campaign + Campaigns + Default_Offer + Not_An_Advanced_Campaign_At_first + + + + + + + fr + French + Desktop + plugins/Morpheus/icons/dist/devices/desktop.png + Unknown + Generic Desktop + Windows XP + Windows + plugins/Morpheus/icons/dist/os/WIN.png + WIN + XP + Gecko + Gecko (Firefox) + Firefox 3.6 + Firefox + plugins/Morpheus/icons/dist/browsers/FF.png + FF + 3.6 + 555 + 1 + 5 + 555 + 1 + 5 + 0 + Europe + eur + France + fr + plugins/Morpheus/icons/dist/flags/fr.png + + + + France + + + 12:34:06 + 12 + 0 + 7200 + 1024x768 + cookie, flash, java + + + plugins/Morpheus/icons/dist/plugins/cookie.png + cookie + + + plugins/Morpheus/icons/dist/plugins/flash.png + flash + + + plugins/Morpheus/icons/dist/plugins/java.png + java + + + + + + + Not_An_Advanced_Campaign_At_first + + Default_Offer + + + + + + 1 + 35 + 156.5.3.2 + + e16cf2bbaeea2c88 + + + action + http://example.com/ + Coming back with another campaign 17th + 8 + + + 36 + + 0 + 0s + 1 + Coming back with another campaign 17th + http://example.com/ + + plugins/Morpheus/images/action.svg + + 0 M + + + 0 + USD + $ + + + + + Piwik test + + + + + + + + returning + plugins/Live/images/returningVisitor.png + 0 + + 11 + none + + 0 + 6848 + 0 + + 0 + 0s + 0 + 1 + 1 + campaign + Campaigns + 17th + keyword h + + + + + + + fr + French + Desktop + plugins/Morpheus/icons/dist/devices/desktop.png + Unknown + Generic Desktop + Windows XP + Windows + plugins/Morpheus/icons/dist/os/WIN.png + WIN + XP + Gecko + Gecko (Firefox) + Firefox 3.6 + Firefox + plugins/Morpheus/icons/dist/browsers/FF.png + FF + 3.6 + 555 + 1 + 5 + 555 + 1 + 5 + 0 + Europe + eur + France + fr + plugins/Morpheus/icons/dist/flags/fr.png + + + + France + + + 12:34:06 + 12 + 0 + 1 + 1024x768 + cookie, flash, java + + + plugins/Morpheus/icons/dist/plugins/cookie.png + cookie + + + plugins/Morpheus/icons/dist/plugins/flash.png + flash + + + plugins/Morpheus/icons/dist/plugins/java.png + java + + + + + cid8 + none + keyword h + email + 17th + newsletter_17 + cg8 + top-right + + + 1 + 34 + 156.5.3.2 + + e16cf2bbaeea2c88 + + + action + http://example.com/ + Coming back with another campaign 16th + 8 + + + 35 + + 0 + 0s + 1 + Coming back with another campaign 16th + http://example.com/ + + plugins/Morpheus/images/action.svg + + 0 M + + + 0 + USD + $ + + + + + Piwik test + + + + + + + + returning + plugins/Live/images/returningVisitor.png + 0 + + 10 + none + + 0 + 6847 + 0 + + 0 + 0s + 0 + 1 + 1 + campaign + Campaigns + 16th + keyword g + + + + + + + fr + French + Desktop + plugins/Morpheus/icons/dist/devices/desktop.png + Unknown + Generic Desktop + Windows XP + Windows + plugins/Morpheus/icons/dist/os/WIN.png + WIN + XP + Gecko + Gecko (Firefox) + Firefox 3.6 + Firefox + plugins/Morpheus/icons/dist/browsers/FF.png + FF + 3.6 + 555 + 1 + 5 + 555 + 1 + 5 + 0 + Europe + eur + France + fr + plugins/Morpheus/icons/dist/flags/fr.png + + + + France + + + 12:34:06 + 12 + 0 + 1 + 1024x768 + cookie, flash, java + + + plugins/Morpheus/icons/dist/plugins/cookie.png + cookie + + + plugins/Morpheus/icons/dist/plugins/flash.png + flash + + + plugins/Morpheus/icons/dist/plugins/java.png + java + + + + + cid7 + none + keyword g + email + 16th + newsletter_16 + cg7 + bottom-left + + + 1 + 33 + 156.5.3.2 + + e16cf2bbaeea2c88 + + + action + http://example.com/ + Coming back with another campaign 15th + 8 + + + 34 + + 0 + 0s + 1 + Coming back with another campaign 15th + http://example.com/ + + plugins/Morpheus/images/action.svg + + 0 M + + + 0 + USD + $ + + + + + Piwik test + + + + + + + + returning + plugins/Live/images/returningVisitor.png + 0 + + 9 + none + + 0 + 6846 + 0 + + 0 + 0s + 0 + 1 + 1 + campaign + Campaigns + 15th + keyword f + + + + + + + fr + French + Desktop + plugins/Morpheus/icons/dist/devices/desktop.png + Unknown + Generic Desktop + Windows XP + Windows + plugins/Morpheus/icons/dist/os/WIN.png + WIN + XP + Gecko + Gecko (Firefox) + Firefox 3.6 + Firefox + plugins/Morpheus/icons/dist/browsers/FF.png + FF + 3.6 + 555 + 1 + 5 + 555 + 1 + 5 + 0 + Europe + eur + France + fr + plugins/Morpheus/icons/dist/flags/fr.png + + + + France + + + 12:34:06 + 12 + 0 + 1 + 1024x768 + cookie, flash, java + + + plugins/Morpheus/icons/dist/plugins/cookie.png + cookie + + + plugins/Morpheus/icons/dist/plugins/flash.png + flash + + + plugins/Morpheus/icons/dist/plugins/java.png + java + + + + + cid6 + none + keyword f + email + 15th + newsletter_15 + cg6 + right + + \ No newline at end of file diff --git a/tests/System/expected/test_min_php_expanded__Referrers.getCampaigns_day.xml b/tests/System/expected/test_min_php_expanded__Referrers.getCampaigns_day.xml new file mode 100644 index 0000000..a6468b9 --- /dev/null +++ b/tests/System/expected/test_min_php_expanded__Referrers.getCampaigns_day.xml @@ -0,0 +1,452 @@ + + + + + 1 + 2 + 2 + 0 + 1 + 1444 + 2 + 1 + + + 1 + 1 + 555 + 5 + + + 1 + 1 + 555 + 0 + 0 + 0 + 0 + 5 + + + 1 + 555 + referrerType==campaign;referrerName==Ecommerce_campaign + + + + 1 + 2 + 2 + 0 + 1 + 1444 + 2 + 1 + + + 1 + 1 + 555 + 5 + + + 1 + 1 + 555 + 0 + 0 + 0 + 0 + 5 + + + 1 + 555 + + + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + referrerType==campaign;referrerName==10th + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + + + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + referrerType==campaign;referrerName==11th + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + + + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + referrerType==campaign;referrerName==12th + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + + + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + referrerType==campaign;referrerName==13th + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + + + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + referrerType==campaign;referrerName==14th + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + + + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + referrerType==campaign;referrerName==15th + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + + + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + referrerType==campaign;referrerName==16th + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + + + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + referrerType==campaign;referrerName==17th + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + + + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + referrerType==campaign;referrerName==CampaignNameDimension+-+No+Other+Dimension+for+this+visit + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + referrerType==campaign;referrerName==Campaign_Hashed + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + + + + + + 1 + 1 + 1 + 0 + 1 + 725 + 1 + 1 + + + 1 + 1 + 3333 + + + 1 + 3333 + referrerType==campaign;referrerName==Campaign_with_two_goals_conversions + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + referrerType==campaign;referrerName==Default_Offer + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + + + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + referrerType==campaign;referrerName==Lenghty+%22NAME%22...Lenghty+%22NAME%22...Lenghty+%22NAME%22...Lenghty+%22NAME%22...Lenghty+%22NAME%22...Lenghty+%22NAME%22...Lenghty+%22NAME%22...Lenghty+%22NAME%22...Lenghty+%22NAME%22...Lenghty+%22NAME%22...Lenghty+%22NAME%22...Lenghty+%22NAME%22...Lenghty+%22NAME%22...Lenghty+%22NAME%22...Lenghty+%22NAM + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + + + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + referrerType==campaign;referrerName==November_Offer + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + + + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + referrerType==campaign;referrerName==October_Offer + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + + + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + referrerType==campaign;referrerName==SHOULD_BE_NEW_VISIT + + + + + + 2 + 1 + 1111 + + + 2 + 1111 + 0 + referrerType==campaign;referrerName==campaign_with_two_goals_conversions + + \ No newline at end of file diff --git a/tests/System/expected/test_min_php_flat__Referrers.getCampaigns_day.xml b/tests/System/expected/test_min_php_flat__Referrers.getCampaigns_day.xml new file mode 100644 index 0000000..044d813 --- /dev/null +++ b/tests/System/expected/test_min_php_flat__Referrers.getCampaigns_day.xml @@ -0,0 +1,282 @@ + + + + + 1 + 2 + 2 + 0 + 1 + 1444 + 2 + 1 + + + 1 + 1 + 555 + 5 + + + 1 + 1 + 555 + 0 + 0 + 0 + 0 + 5 + + + 1 + 555 + referrerType==campaign;referrerName==Ecommerce_campaign;referrerType==campaign;referrerKeyword==Ecommerce_keyword + Ecommerce_campaign + Ecommerce_keyword + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + referrerType==campaign;referrerName==10th;referrerType==campaign;referrerKeyword==keyword+a + 10th + keyword a + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + referrerType==campaign;referrerName==11th;referrerType==campaign;referrerKeyword==keyword+b + 11th + keyword b + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + referrerType==campaign;referrerName==12th;referrerType==campaign;referrerKeyword==keyword+c + 12th + keyword c + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + referrerType==campaign;referrerName==13th;referrerType==campaign;referrerKeyword==keyword+d + 13th + keyword d + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + referrerType==campaign;referrerName==14th;referrerType==campaign;referrerKeyword==keyword+e + 14th + keyword e + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + referrerType==campaign;referrerName==15th;referrerType==campaign;referrerKeyword==keyword+f + 15th + keyword f + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + referrerType==campaign;referrerName==16th;referrerType==campaign;referrerKeyword==keyword+g + 16th + keyword g + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + referrerType==campaign;referrerName==17th;referrerType==campaign;referrerKeyword==keyword+h + 17th + keyword h + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + referrerType==campaign;referrerName==CampaignNameDimension+-+No+Other+Dimension+for+this+visit + CampaignNameDimension - No Other Dimension for this visit + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + referrerType==campaign;referrerName==Campaign_Hashed;referrerType==campaign;referrerKeyword==Keyword+from+%23hash+tag+parameter + Campaign_Hashed + Keyword from #hash tag parameter + + + + 1 + 1 + 1 + 0 + 1 + 725 + 1 + 1 + + + 1 + 1 + 3333 + + + 1 + 3333 + referrerType==campaign;referrerName==Campaign_with_two_goals_conversions + Campaign_with_two_goals_conversions + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + referrerType==campaign;referrerName==Default_Offer;referrerType==campaign;referrerKeyword==Not_An_Advanced_Campaign_At_first + Default_Offer + Not_An_Advanced_Campaign_At_first + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + referrerType==campaign;referrerName==Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAM;referrerType==campaign;referrerKeyword==Lenghty+%22KEYWORD%22...Lenghty+%22KEYWORD%22...Lenghty+%22KEYWORD%22...Lenghty+%22KEYWORD%22...Lenghty+%22KEYWORD%22...Lenghty+%22KEYWORD%22...Lenghty+%22KEYWORD%22...Lenghty+%22KEYWORD%22...Lenghty+%22KEYWORD%22...Lenghty+%22KEYWORD%22...Lenghty+%22KEYWORD%22...Lenghty+%22KEYWORD%22...Lenghty+%22K + Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAME"...Lenghty "NAM + Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "KEYWORD"...Lenghty "K + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + referrerType==campaign;referrerName==November_Offer;referrerType==campaign;referrerKeyword==Mot_cl%C3%A9_P%C3%89P%C3%88RE + November_Offer + Mot_clé_PÉPÈRE + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + referrerType==campaign;referrerName==October_Offer;referrerType==campaign;referrerKeyword==Mot_cl%C3%A9_P%C3%89P%C3%88RE + October_Offer + Mot_clé_PÉPÈRE + + + + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + referrerType==campaign;referrerName==SHOULD_BE_NEW_VISIT + SHOULD_BE_NEW_VISIT + + + + + + 2 + 1 + 1111 + + + 2 + 1111 + 0 + referrerType==campaign;referrerName==campaign_with_two_goals_conversions + campaign_with_two_goals_conversions + + \ No newline at end of file diff --git a/tests/System/expected/test_min_php_old__API.get_day.xml b/tests/System/expected/test_min_php_old__API.get_day.xml new file mode 100644 index 0000000..32404d2 --- /dev/null +++ b/tests/System/expected/test_min_php_old__API.get_day.xml @@ -0,0 +1,89 @@ + + + 1 + 18 + 0 + 18 + 1 + 18 + 2169 + 1 + 1 + 1 + 0 + 1 + 100% + 1 + 0 + 17 + 17 + 1 + 0 + 1 + 100% + 1 + 128 + 0 + 0 + 0 + 0 + 18 + 0 + 0 + 0 + 0 + 0 + 18 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 4 + 2 + 4999 + 11.11% + 0 + 0 + 0 + 0% + 4 + 2 + 4999 + 11.76% + 0 + 0 + 0 + 18 + 18 + 0 + 0 + 0 + 0 + 0 + 0 + 0% + 0% + 100% + 0% + 0% + 100% + 1 + 121 + diff --git a/tests/System/expected/test_old__API.get_day.xml b/tests/System/expected/test_old__API.get_day.xml index 8541ca9..736c646 100644 --- a/tests/System/expected/test_old__API.get_day.xml +++ b/tests/System/expected/test_old__API.get_day.xml @@ -33,7 +33,7 @@ 0 0 0 - 17 + 18 0 0 0 @@ -78,6 +78,7 @@ 0 0 0 + 18 0% 0% 100% diff --git a/tests/UI/Reports_spec.js b/tests/UI/Reports_spec.js index aa0e49c..14820ec 100644 --- a/tests/UI/Reports_spec.js +++ b/tests/UI/Reports_spec.js @@ -65,4 +65,12 @@ describe("MarketingCampaignsReporting_Reports", function () { var report = await page.$('.reporting-page'); expect(await report.screenshot()).to.matchImage('visitor_log'); }); + + it('should display the settings page', async () => { + var selector = '.card-content:contains(MarketingCampaignsReporting)'; + await page.goto('?module=CoreAdminHome&action=generalSettings&idSite=1&period=day&date=yesterday'); + await page.waitForTimeout(1000); + await page.waitForNetworkIdle(); + expect(await page.screenshotSelector(selector)).to.matchImage('settings_page'); + }); }); diff --git a/tests/UI/expected-ui-screenshots/MarketingCampaignsReporting_Reports_settings_page.png b/tests/UI/expected-ui-screenshots/MarketingCampaignsReporting_Reports_settings_page.png new file mode 100644 index 0000000..3bd8cb8 Binary files /dev/null and b/tests/UI/expected-ui-screenshots/MarketingCampaignsReporting_Reports_settings_page.png differ diff --git a/tests/UI/expected-ui-screenshots/MarketingCampaignsReporting_Reports_visitor_log.png b/tests/UI/expected-ui-screenshots/MarketingCampaignsReporting_Reports_visitor_log.png index b411b7a..9b2d2a7 100644 Binary files a/tests/UI/expected-ui-screenshots/MarketingCampaignsReporting_Reports_visitor_log.png and b/tests/UI/expected-ui-screenshots/MarketingCampaignsReporting_Reports_visitor_log.png differ diff --git a/tests/Unit/Campaign/CampaignDetectorTest.php b/tests/Unit/Campaign/CampaignDetectorTest.php index 3e48e70..0756fca 100644 --- a/tests/Unit/Campaign/CampaignDetectorTest.php +++ b/tests/Unit/Campaign/CampaignDetectorTest.php @@ -38,10 +38,10 @@ public function testDetectCampaignFromRequest(Request $request, array $campaignP $detector = new CampaignDetector(); $dimensions = $detector->detectCampaignFromRequest($request, $campaignParams); - $this->assertEquals($expectedOutput, $dimensions); + $this->assertSame($expectedOutput, $dimensions); } - /** + /** * @dataProvider provideVisitData * @param array $visitorInfo * @param array $campaignParams @@ -60,11 +60,11 @@ public function provideRequestData() return [ 'normal query string' => [ 'request' => $this->createRequestMock( - 'http://example.com/?mtm_campaign=campName&mtm_kwd=sdf1' + 'http://example.com/?mtm_campaign=CAmpName&mtm_kwd=sdf1' ), 'campaignParams' => $this->getCampaignParameters(), 'expectedOutput' => [ - 'campaign_name' => 'campname', + 'campaign_name' => 'CAmpName', 'campaign_keyword' => 'sdf1' ] ], @@ -74,7 +74,7 @@ public function provideRequestData() ), 'campaignParams' => $this->getCampaignParameters(), 'expectedOutput' => [ - 'campaign_name' => 'campname2', + 'campaign_name' => 'campName2', 'campaign_keyword' => 'sdf2' ] ], @@ -84,7 +84,7 @@ public function provideRequestData() ), 'campaignParams' => $this->getCampaignParameters(), 'expectedOutput' => [ - 'campaign_name' => 'campname', + 'campaign_name' => 'campName', 'campaign_keyword' => 'sdf1' ] ], @@ -94,7 +94,7 @@ public function provideRequestData() ), 'campaignParams' => $this->getCampaignParameters(), 'expectedOutput' => [ - 'campaign_name' => 'campname2', + 'campaign_name' => 'campName2', 'campaign_keyword' => 'sdf2' ] ],