From f2775faa827f16630e5aba7b9efc7181271d1479 Mon Sep 17 00:00:00 2001 From: Joachim Nickel Date: Fri, 5 Mar 2021 13:08:25 +0100 Subject: [PATCH 1/4] Make mtm_cid case sensitive --- Campaign/CampaignDetector.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Campaign/CampaignDetector.php b/Campaign/CampaignDetector.php index a8bae7e..0003d9b 100644 --- a/Campaign/CampaignDetector.php +++ b/Campaign/CampaignDetector.php @@ -84,7 +84,11 @@ protected function getValueFromQueryString($param, $queryString) { $valueFromRequest = UrlHelper::getParameterFromQueryString($queryString, $param); $valueFromRequest = trim(urldecode($valueFromRequest)); - $valueFromRequest = Common::mb_strtolower($valueFromRequest); + if ($param == "mtm_cid") { + $valueFromRequest = $valueFromRequest; + } else { + $valueFromRequest = Common::mb_strtolower($valueFromRequest); + } $valueFromRequest = substr($valueFromRequest, 0, 250); if (!empty($valueFromRequest)) { return $valueFromRequest; From 1fc0924509c83ef12a48588e05747d986ce227a7 Mon Sep 17 00:00:00 2001 From: Joachim Nickel Date: Mon, 8 Mar 2021 10:47:24 +0100 Subject: [PATCH 2/4] Add mtm_gclid as new case-sensitive parameter --- Campaign/CampaignDetector.php | 4 +--- MarketingCampaignsReporting.php | 2 +- README.md | 4 ++-- tests/Unit/Campaign/CampaignDetectorTest.php | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Campaign/CampaignDetector.php b/Campaign/CampaignDetector.php index 0003d9b..56062f2 100644 --- a/Campaign/CampaignDetector.php +++ b/Campaign/CampaignDetector.php @@ -84,9 +84,7 @@ protected function getValueFromQueryString($param, $queryString) { $valueFromRequest = UrlHelper::getParameterFromQueryString($queryString, $param); $valueFromRequest = trim(urldecode($valueFromRequest)); - if ($param == "mtm_cid") { - $valueFromRequest = $valueFromRequest; - } else { + if ($param != "mtm_gclid") { $valueFromRequest = Common::mb_strtolower($valueFromRequest); } $valueFromRequest = substr($valueFromRequest, 0, 250); diff --git a/MarketingCampaignsReporting.php b/MarketingCampaignsReporting.php index b98a4b4..c492c06 100644 --- a/MarketingCampaignsReporting.php +++ b/MarketingCampaignsReporting.php @@ -28,7 +28,7 @@ class MarketingCampaignsReporting extends Plugin public static $CAMPAIGN_SOURCE_FIELD_DEFAULT_URL_PARAMS = array('mtm_source', 'pk_source', 'utm_source'); public static $CAMPAIGN_MEDIUM_FIELD_DEFAULT_URL_PARAMS = array('mtm_medium', 'pk_medium', 'utm_medium'); public static $CAMPAIGN_CONTENT_FIELD_DEFAULT_URL_PARAMS = array('mtm_content', 'pk_content', 'utm_content'); - public static $CAMPAIGN_ID_FIELD_DEFAULT_URL_PARAMS = array('mtm_cid', 'pk_cid', 'utm_id'); + public static $CAMPAIGN_ID_FIELD_DEFAULT_URL_PARAMS = array('mtm_cid', 'pk_cid', 'utm_id', 'mtm_gclid'); public static $CAMPAIGN_GROUP_FIELD_DEFAULT_URL_PARAMS = array('mtm_group', 'pk_group'); public static $CAMPAIGN_PLACEMENT_FIELD_DEFAULT_URL_PARAMS = array('mtm_placement', 'pk_placement'); diff --git a/README.md b/README.md index e92fc84..3e292b3 100644 --- a/README.md +++ b/README.md @@ -81,13 +81,13 @@ campaign_keyword = "mtm_keyword,matomo_kwd,mtm_kwd,utm_term" campaign_source = "mtm_source,utm_source" campaign_medium = "mtm_medium,utm_medium" campaign_content = "mtm_content,utm_content" -campaign_id = "mtm_cid,utm_id" +campaign_id = "mtm_cid,utm_id,mtm_gclid" campaign_group = "mtm_group" campaign_placement = "mtm_placement" ``` For example, by default parameter `campaign_name` track following parameters if they are found in URL: `'mtm_campaign', 'matomo_campaign', 'mtm_cpn', 'utm_campaign'`. If you configure `campaign_name` like this `campaign_name="mtm_campaign,custom_name_parameter"`, then parameter `campaign_name` will detect only presence of `mtm_campaign` and `custom_name_parameter` in URL. `matomo_campaign`, `mtm_cpn`, `utm_campaign` will be ignored until they are present in config. - +All parameter are case-insensitiv except optional mtm_gclid. ## Changelog diff --git a/tests/Unit/Campaign/CampaignDetectorTest.php b/tests/Unit/Campaign/CampaignDetectorTest.php index 81445f8..8e7531b 100644 --- a/tests/Unit/Campaign/CampaignDetectorTest.php +++ b/tests/Unit/Campaign/CampaignDetectorTest.php @@ -135,7 +135,7 @@ public function getCampaignParameters() (new CampaignSource())->getColumnName() => ['mtm_source', 'utm_source'], (new CampaignMedium())->getColumnName() => ['mtm_medium', 'utm_medium'], (new CampaignContent())->getColumnName() => ['mtm_content', 'utm_content'], - (new CampaignId())->getColumnName() => ['mtm_cid', 'utm_id'], + (new CampaignId())->getColumnName() => ['mtm_cid', 'utm_id', 'mtm_gclid'], ]; } From 4e851787f0c9c98187dc08a590468085f20cf435 Mon Sep 17 00:00:00 2001 From: Joachim Nickel Date: Mon, 15 Mar 2021 09:21:59 +0100 Subject: [PATCH 3/4] Change mtm_gclid to mtm_clid --- Campaign/CampaignDetector.php | 2 +- MarketingCampaignsReporting.php | 2 +- README.md | 4 ++-- tests/Unit/Campaign/CampaignDetectorTest.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Campaign/CampaignDetector.php b/Campaign/CampaignDetector.php index 56062f2..e9afae4 100644 --- a/Campaign/CampaignDetector.php +++ b/Campaign/CampaignDetector.php @@ -84,7 +84,7 @@ protected function getValueFromQueryString($param, $queryString) { $valueFromRequest = UrlHelper::getParameterFromQueryString($queryString, $param); $valueFromRequest = trim(urldecode($valueFromRequest)); - if ($param != "mtm_gclid") { + if ($param != "mtm_clid") { $valueFromRequest = Common::mb_strtolower($valueFromRequest); } $valueFromRequest = substr($valueFromRequest, 0, 250); diff --git a/MarketingCampaignsReporting.php b/MarketingCampaignsReporting.php index c492c06..60acaab 100644 --- a/MarketingCampaignsReporting.php +++ b/MarketingCampaignsReporting.php @@ -28,7 +28,7 @@ class MarketingCampaignsReporting extends Plugin public static $CAMPAIGN_SOURCE_FIELD_DEFAULT_URL_PARAMS = array('mtm_source', 'pk_source', 'utm_source'); public static $CAMPAIGN_MEDIUM_FIELD_DEFAULT_URL_PARAMS = array('mtm_medium', 'pk_medium', 'utm_medium'); public static $CAMPAIGN_CONTENT_FIELD_DEFAULT_URL_PARAMS = array('mtm_content', 'pk_content', 'utm_content'); - public static $CAMPAIGN_ID_FIELD_DEFAULT_URL_PARAMS = array('mtm_cid', 'pk_cid', 'utm_id', 'mtm_gclid'); + public static $CAMPAIGN_ID_FIELD_DEFAULT_URL_PARAMS = array('mtm_cid', 'pk_cid', 'utm_id', 'mtm_clid'); public static $CAMPAIGN_GROUP_FIELD_DEFAULT_URL_PARAMS = array('mtm_group', 'pk_group'); public static $CAMPAIGN_PLACEMENT_FIELD_DEFAULT_URL_PARAMS = array('mtm_placement', 'pk_placement'); diff --git a/README.md b/README.md index 3e292b3..2ac4c64 100644 --- a/README.md +++ b/README.md @@ -81,13 +81,13 @@ campaign_keyword = "mtm_keyword,matomo_kwd,mtm_kwd,utm_term" campaign_source = "mtm_source,utm_source" campaign_medium = "mtm_medium,utm_medium" campaign_content = "mtm_content,utm_content" -campaign_id = "mtm_cid,utm_id,mtm_gclid" +campaign_id = "mtm_cid,utm_id,mtm_clid" campaign_group = "mtm_group" campaign_placement = "mtm_placement" ``` For example, by default parameter `campaign_name` track following parameters if they are found in URL: `'mtm_campaign', 'matomo_campaign', 'mtm_cpn', 'utm_campaign'`. If you configure `campaign_name` like this `campaign_name="mtm_campaign,custom_name_parameter"`, then parameter `campaign_name` will detect only presence of `mtm_campaign` and `custom_name_parameter` in URL. `matomo_campaign`, `mtm_cpn`, `utm_campaign` will be ignored until they are present in config. -All parameter are case-insensitiv except optional mtm_gclid. +All parameter are case-insensitiv except optional mtm_clid. ## Changelog diff --git a/tests/Unit/Campaign/CampaignDetectorTest.php b/tests/Unit/Campaign/CampaignDetectorTest.php index 8e7531b..7139b73 100644 --- a/tests/Unit/Campaign/CampaignDetectorTest.php +++ b/tests/Unit/Campaign/CampaignDetectorTest.php @@ -135,7 +135,7 @@ public function getCampaignParameters() (new CampaignSource())->getColumnName() => ['mtm_source', 'utm_source'], (new CampaignMedium())->getColumnName() => ['mtm_medium', 'utm_medium'], (new CampaignContent())->getColumnName() => ['mtm_content', 'utm_content'], - (new CampaignId())->getColumnName() => ['mtm_cid', 'utm_id', 'mtm_gclid'], + (new CampaignId())->getColumnName() => ['mtm_cid', 'utm_id', 'mtm_clid'], ]; } From f184ff8495fc02d5ba41dc866f6f532bc41a3ba7 Mon Sep 17 00:00:00 2001 From: Stefan Giehl Date: Tue, 5 Jul 2022 14:09:57 +0200 Subject: [PATCH 4/4] ws --- Campaign/CampaignDetector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Campaign/CampaignDetector.php b/Campaign/CampaignDetector.php index e9afae4..34d63dd 100644 --- a/Campaign/CampaignDetector.php +++ b/Campaign/CampaignDetector.php @@ -85,7 +85,7 @@ protected function getValueFromQueryString($param, $queryString) $valueFromRequest = UrlHelper::getParameterFromQueryString($queryString, $param); $valueFromRequest = trim(urldecode($valueFromRequest)); if ($param != "mtm_clid") { - $valueFromRequest = Common::mb_strtolower($valueFromRequest); + $valueFromRequest = Common::mb_strtolower($valueFromRequest); } $valueFromRequest = substr($valueFromRequest, 0, 250); if (!empty($valueFromRequest)) {