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:
authorStefan Giehl <stefan@matomo.org>2022-07-08 12:34:16 +0300
committerGitHub <noreply@github.com>2022-07-08 12:34:16 +0300
commit89a44abd03df0102f860306628bd0d75987c3626 (patch)
treeac02d4cd384ee467618e4188e5d5bdada23c6b36 /plugins
parent7885267b684c6b836b76b95a764fe792fafffbe1 (diff)
Implement url parameter to ignore referrer (#19420)
* Implement url parameter to ignore referrer * rebuilt js files * apply some fixes
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Referrers/Columns/Base.php22
1 files changed, 20 insertions, 2 deletions
diff --git a/plugins/Referrers/Columns/Base.php b/plugins/Referrers/Columns/Base.php
index 0d9a658f79..2273ea56f2 100644
--- a/plugins/Referrers/Columns/Base.php
+++ b/plugins/Referrers/Columns/Base.php
@@ -72,6 +72,26 @@ abstract class Base extends VisitDimension
{
$this->idsite = $idSite;
+ $currentUrl = PageUrl::cleanupUrl($currentUrl);
+ $this->currentUrlParse = @parse_url($currentUrl);
+
+ // skip any referrer detection if parameter to exclude the referrer is found
+ if (
+ !empty($this->currentUrlParse['query'])
+ && (
+ UrlHelper::getParameterFromQueryString($this->currentUrlParse['query'], 'ignore_referrer') === '1'
+ || UrlHelper::getParameterFromQueryString($this->currentUrlParse['query'], 'ignore_referer') === '1'
+ )
+ ) {
+ return [
+ 'referer_type' => Common::REFERRER_TYPE_DIRECT_ENTRY,
+ 'referer_name' => '',
+ 'referer_keyword' => '',
+ 'referer_url' => '',
+ ];
+ }
+
+
$referrerUrl = Common::unsanitizeInputValue($referrerUrl);
// Ignore referrer url if it doesn't look like a URL or is excluded in settings
@@ -85,12 +105,10 @@ abstract class Base extends VisitDimension
$referrerUrl = '';
}
- $currentUrl = PageUrl::cleanupUrl($currentUrl);
// default values for the referer_* fields
$this->referrerUrl = $referrerUrl;
$this->referrerUrlParse = @parse_url($this->referrerUrl);
- $this->currentUrlParse = @parse_url($currentUrl);
$this->typeReferrerAnalyzed = Common::REFERRER_TYPE_DIRECT_ENTRY;
$this->nameReferrerAnalyzed = '';
$this->keywordReferrerAnalyzed = '';