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:
authorsgiehl <stefan@matomo.org>2022-08-26 11:13:33 +0300
committersgiehl <stefan@matomo.org>2022-08-26 11:13:33 +0300
commitb8eb330fb10f71982f1f6ed943953d7c5ef42f51 (patch)
tree93c3d838cb45a4b2428cfbb28ffdfd895322ef66 /tests/PHPUnit/Integration
parente33e09422561e507c7440a9afdd3f0b9827f72eb (diff)
parent05b46e26e630b2ee8fd498f2077ceb9758c14a2c (diff)
Merge branch '4.x-dev' into 5.x-dev
Diffstat (limited to 'tests/PHPUnit/Integration')
-rw-r--r--tests/PHPUnit/Integration/Tracker/ActionTest.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/PHPUnit/Integration/Tracker/ActionTest.php b/tests/PHPUnit/Integration/Tracker/ActionTest.php
index afb43e806e..5031d91597 100644
--- a/tests/PHPUnit/Integration/Tracker/ActionTest.php
+++ b/tests/PHPUnit/Integration/Tracker/ActionTest.php
@@ -170,6 +170,37 @@ class ActionTest extends IntegrationTestCase
$this->assertEquals($filteredUrl[0], PageUrl::excludeQueryParametersFromUrl($url, $idSite));
}
+ public function getTestAdvertisingClickIdUrls()
+ {
+ return [
+ ['https://www.example.com?gclid=1234', 'https://www.example.com'],
+ ['https://www.example.com?fbclid=1234', 'https://www.example.com'],
+ ['https://www.example.com?msclkid=1234', 'https://www.example.com'],
+ ['https://www.example.com?yclid=1234', 'https://www.example.com'],
+ ['https://www.example.com/path1?gclid=1234', 'https://www.example.com/path1'],
+ ['https://www.example.com/path2?fbclid=1234', 'https://www.example.com/path2'],
+ ['https://www.example.com/path3?msclkid=1234', 'https://www.example.com/path3'],
+ ['https://www.example.com/path4?yclid=1234', 'https://www.example.com/path4'],
+ ['https://www.example.com?random=1234', 'https://www.example.com?random=1234'],
+ ['https://www.example.com?random=1234&yclid=qwerty', 'https://www.example.com?random=1234'],
+ ];
+ }
+
+ /**
+ * No excluded query parameters specified, apart from the standard "session" parameters, always excluded
+ *
+ * @dataProvider getTestAdvertisingClickIdUrls
+ */
+ public function testExcludeQueryParametersAdvertisingClickIds($url, $filteredUrl)
+ {
+ $this->setUpRootAccess();
+ $idSite = API::getInstance()->addSite("site1", array('http://example.org'), $ecommerce = 0,
+ $siteSearch = 1, $searchKeywordParameters = null, $searchCategoryParameters = null,
+ $excludedIps = '', $excludedQueryParameters = '', $timezone = null, $currency = null,
+ $group = null, $startDate = null, $excludedUserAgents = null, $keepURLFragments = 1);
+ $this->assertEquals($filteredUrl, PageUrl::excludeQueryParametersFromUrl($url, $idSite));
+ }
+
public function getTestUrlsHashtag()
{
$urls = array(