Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
5d11a73
Add plugin category
michalkleiner Mar 4, 2024
d4db44c
Merge pull request #148 from matomo-org/PG-3258-flat-not-working
AltamashShaikh Mar 28, 2024
e08ec8d
Translated using Weblate (Gujarati)
weblate Dec 29, 2023
63d9fa9
Translated using Weblate (Basque)
weblate Dec 29, 2023
516e0fc
Merge pull request #141 from weblate/weblate-matomo-plugin-marketingc…
AltamashShaikh Apr 1, 2024
e226635
Bumped version to 5.0.3 and created CHANGELOG.md
AltamashShaikh Apr 8, 2024
7a43615
Merge pull request #149 from matomo-org/bump-version-5.0.3
AltamashShaikh Apr 8, 2024
70d781b
Fixes formatting
AltamashShaikh Apr 8, 2024
fd45e68
Merge pull request #150 from matomo-org/bump-version-5.0.3
AltamashShaikh Apr 8, 2024
f0cb832
Merge pull request #146 from matomo-org/category
AltamashShaikh Apr 15, 2024
49ca93b
Bumped version to 5.0.4
AltamashShaikh Apr 22, 2024
4bea4b4
Merge pull request #151 from matomo-org/bump-version-5.0.4
AltamashShaikh Apr 22, 2024
76c92a7
Ensure visits atre not all tracked at the same time
sgiehl May 7, 2024
4a30b3c
Merge pull request #152 from matomo-org/improvetest
AltamashShaikh May 8, 2024
4c54ca0
Updates expected test files (#155)
sgiehl Jul 2, 2024
b869675
Translated using Weblate (Irish)
weblate Jul 11, 2024
acac394
Merge pull request #156 from weblate/weblate-matomo-plugin-marketingc…
AltamashShaikh Jul 18, 2024
4f00fb0
updates expected UI tests after icon updates
sgiehl Jul 25, 2024
46e964a
Updated the conversion query to force index
snake14 Sep 5, 2024
05f0ab1
Adding check for core version to avoid requiring minimum version incr…
snake14 Sep 9, 2024
19c742f
Switching to checking for core method instead of version
snake14 Sep 10, 2024
ca97f7d
Translated using Weblate (Czech)
weblate Sep 13, 2024
35efed4
Merge pull request #161 from weblate/weblate-matomo-plugin-marketingc…
snake14 Sep 15, 2024
6d9c38c
Removing unused import statement
snake14 Oct 7, 2024
972fa33
Adds test for PHPCS
AltamashShaikh Oct 11, 2024
0397499
Fixes PSR test
AltamashShaikh Oct 17, 2024
1626319
Merge pull request #163 from matomo-org/spice-psr
AltamashShaikh Oct 17, 2024
ff55722
Revert "Removing unused import statement"
snake14 Oct 18, 2024
696b8e9
Revert "Switching to checking for core method instead of version"
snake14 Oct 18, 2024
ea75dd6
Increasing Matomo version
snake14 Oct 18, 2024
0443e66
Merge branch '5.x-dev' into PG-3720-allow-force-index
snake14 Oct 18, 2024
745db61
Merge pull request #160 from matomo-org/PG-3720-allow-force-index
snake14 Oct 23, 2024
5a836aa
Updated tests to run on php 8.4 from 8.3, #PG-3957
AltamashShaikh Oct 30, 2024
5392860
Merge pull request #164 from matomo-org/PG-3957-php-8.4-upgrade
snake14 Oct 31, 2024
1482511
Adjust tests for new hits metric (#165)
sgiehl Nov 11, 2024
b079964
Added an option to retain the case of campaign paramter values via Sy…
AltamashShaikh Dec 4, 2024
5c4ea4c
Fixes for tests
AltamashShaikh Dec 4, 2024
1070dfd
Fixes Unit test case
AltamashShaikh Dec 4, 2024
54afff7
Fixes for test
AltamashShaikh Dec 4, 2024
f237488
Fixes for tests
AltamashShaikh Dec 4, 2024
5d0f547
UI test fixes
AltamashShaikh Dec 4, 2024
5a7a02c
Fixes UI test
AltamashShaikh Dec 4, 2024
812243f
Reverted the setting to be disabled
AltamashShaikh Dec 4, 2024
23ba5d4
Fixes error
AltamashShaikh Dec 4, 2024
637da9a
Reverted expected files update
AltamashShaikh Dec 4, 2024
1065a06
Changed the logic to change case during archiving
AltamashShaikh Dec 5, 2024
00141d2
Fixes test
AltamashShaikh Dec 5, 2024
46b9e75
Fixes for max php version
AltamashShaikh Dec 5, 2024
4ccb7c6
Fixes test fir min php version
AltamashShaikh Dec 5, 2024
600ae07
test fixes
AltamashShaikh Dec 5, 2024
319e067
version fixes
AltamashShaikh Dec 5, 2024
f42c091
updated system test expected files
AltamashShaikh Dec 5, 2024
cc0f060
Fixes for test
AltamashShaikh Dec 5, 2024
9f3a4c8
Added new XML
AltamashShaikh Dec 5, 2024
70938fc
Applied PR feedbacks
AltamashShaikh Dec 6, 2024
a7475fc
Fixes for tests
AltamashShaikh Dec 6, 2024
2adeb49
Merge pull request #166 from matomo-org/PG-2343-retain-case-option
AltamashShaikh Dec 6, 2024
4475b8a
Translated using Weblate (Irish)
weblate Dec 7, 2024
405f618
Translated using Weblate (Greek)
weblate Dec 7, 2024
69c40e7
Translated using Weblate (Albanian)
weblate Dec 7, 2024
29d3edf
Merge pull request #167 from weblate/weblate-matomo-plugin-marketingc…
snake14 Dec 8, 2024
a5c9daf
Fixes tests for MariaDB
AltamashShaikh Dec 12, 2024
86da903
Fixes PSR test
AltamashShaikh Dec 12, 2024
9c3c298
Changes to run tests on MariaDB
AltamashShaikh Dec 12, 2024
8f536c9
Fixes for tests to run
AltamashShaikh Dec 12, 2024
9a9ccea
Specified driver and engine
AltamashShaikh Dec 12, 2024
267f4e1
run tests for php 8.2
AltamashShaikh Dec 12, 2024
0e50a83
reverted run github actions on mariadb
AltamashShaikh Dec 12, 2024
513cde7
Merge pull request #168 from matomo-org/fix-tests-on-mariadb
AltamashShaikh Dec 12, 2024
62cd970
Bumped version 5.1.0
AltamashShaikh Dec 16, 2024
de57551
Merge pull request #169 from matomo-org/bump-version-5.1.0
AltamashShaikh Dec 16, 2024
c80a284
updates expected UI test files
sgiehl Dec 17, 2024
f575379
Translated using Weblate (Russian)
weblate Dec 20, 2024
d205d4b
Merge pull request #171 from weblate/weblate-matomo-plugin-marketingc…
AltamashShaikh Dec 20, 2024
30fb6c6
Translated using Weblate (German)
weblate Jan 6, 2025
f6a2868
Merge pull request #173 from weblate/weblate-matomo-plugin-marketingc…
snake14 Jan 6, 2025
6966f0f
Changes lower case logic to DB, #PG-4087, #174
AltamashShaikh Jan 10, 2025
64638af
PHPCS fixes
AltamashShaikh Jan 10, 2025
5c43380
added event to determine if case should be lower for other plugins
AltamashShaikh Jan 14, 2025
0c3df01
Merge pull request #175 from matomo-org/PG-4087-fix-retain-case-logic
AltamashShaikh Jan 15, 2025
b1c5b20
Bumped version to 5.1.1
AltamashShaikh Jan 15, 2025
614334a
Updates UI screenshot due to recent change
AltamashShaikh Jan 15, 2025
2d4e265
Merge pull request #176 from matomo-org/bump-version-5.1.1
AltamashShaikh Jan 15, 2025
6d71484
Translated using Weblate (Tamil)
weblate Jan 17, 2025
39794d4
Merge pull request #177 from weblate/weblate-matomo-plugin-marketingc…
AltamashShaikh Jan 17, 2025
776492b
Translated using Weblate (Turkish)
weblate Jan 20, 2025
2bd3c98
Translated using Weblate (Catalan)
weblate Jan 20, 2025
3d01016
Merge pull request #178 from weblate/weblate-matomo-plugin-marketingc…
AltamashShaikh Jan 21, 2025
f3995dc
Translated using Weblate (French)
weblate Feb 8, 2025
7e7d360
Merge pull request #179 from weblate/weblate-matomo-plugin-marketingc…
snake14 Feb 9, 2025
eb329db
Translated using Weblate (Dutch)
weblate Feb 26, 2025
3d6407f
Merge pull request #180 from weblate/weblate-matomo-plugin-marketingc…
snake14 Feb 26, 2025
ad77258
Run github actions with Ubuntu 24.04
sgiehl Mar 5, 2025
2abea93
Updates expected UI test files
sgiehl Mar 5, 2025
13751f4
Merge pull request #181 from matomo-org/ubuntu-24.04
AltamashShaikh Mar 6, 2025
4b76887
Adds pull request template to stop bouncing review questions
AltamashShaikh Mar 18, 2025
2522a0e
Merge pull request #182 from matomo-org/add-pr-template
snake14 Mar 21, 2025
2c544bb
updates expected test files
sgiehl May 7, 2025
04107eb
Merge pull request #183 from matomo-org/dev-17533
AltamashShaikh May 8, 2025
03585ea
Updated README.md to correctly state that paramter values are case-se…
AltamashShaikh Jul 18, 2025
4b14b2e
Updated text
AltamashShaikh Jul 18, 2025
3ebb16d
Merge pull request #184 from matomo-org/PG-4454-update-readme
snake14 Jul 18, 2025
28a3eea
Applied product suggestions
AltamashShaikh Jul 18, 2025
66bd323
Merge pull request #185 from matomo-org/PG-4454-update-readme
AltamashShaikh Jul 18, 2025
f807352
Updates expected test files after core change (#186)
sgiehl Sep 2, 2025
06f6d3f
Translated using Weblate (French) (#187)
weblate Sep 24, 2025
37ffaa8
Translated using Weblate (Swedish)
weblate Oct 9, 2025
86f1617
Merge pull request #188 from weblate/weblate-matomo-plugin-marketingc…
AltamashShaikh Oct 9, 2025
d41c69b
Don't try to detect a campaign if core detected an AI agent
sgiehl Oct 9, 2025
7c6a043
bump version and adjust changelog
sgiehl Oct 9, 2025
b5913e8
add another test
sgiehl Oct 9, 2025
cba8cec
Update CHANGELOG.md
AltamashShaikh Oct 10, 2025
5f2f2b6
Merge pull request #189 from matomo-org/dev-19575
AltamashShaikh Oct 10, 2025
85b47c0
Update translation files
weblate Oct 14, 2025
4345d82
Update translation files
weblate Oct 14, 2025
2830e44
Update translation files
weblate Oct 14, 2025
3bcbc48
Update translation files
weblate Oct 14, 2025
c203839
Update translation files
weblate Oct 14, 2025
c724ed2
Update translation files
weblate Oct 14, 2025
bd3d820
Update translation files
weblate Oct 14, 2025
2e81fac
Update translation files
weblate Oct 14, 2025
cef85b6
Update translation files
weblate Oct 14, 2025
c666be4
Update translation files
weblate Oct 14, 2025
37dfd65
Update translation files
weblate Oct 14, 2025
f03e486
Update translation files
weblate Oct 14, 2025
6fc7d50
Update translation files
weblate Oct 14, 2025
84e90ba
Update translation files
weblate Oct 14, 2025
ab1cc39
Update translation files
weblate Oct 14, 2025
546caa0
Update translation files
weblate Oct 14, 2025
76a7fb7
Update translation files
weblate Oct 14, 2025
d74326d
Merge pull request #190 from weblate/weblate-matomo-plugin-marketingc…
AltamashShaikh Oct 15, 2025
a65af34
Translated using Weblate (French) (#191)
weblate Oct 20, 2025
1c7c686
Translations update from Hosted Weblate (#195)
weblate Nov 2, 2025
45deda1
PG-4669 test with matomo5_[max|min]_php [ignore_release] (#194)
snake14 Nov 3, 2025
5e83c02
Updates expected test files after core changes (#193)
mneudert Nov 3, 2025
a6b28c1
Avoid incorrectly forcing new visit when AI Assistants provide utm_so…
sgiehl Nov 7, 2025
b523cb9
bump version
sgiehl Nov 7, 2025
71bab3d
Merge pull request #196 from matomo-org/dev-19639
AltamashShaikh Nov 7, 2025
7cfe4eb
Fixes fatal error, #198
AltamashShaikh Nov 11, 2025
8f7daa8
Fixes changelog
AltamashShaikh Nov 11, 2025
f68dd92
Merge pull request #199 from matomo-org/198-fix-regression
AltamashShaikh Nov 11, 2025
5e23731
Update UI screenshots after Profil modal fix
tzi Nov 10, 2025
48f8865
Merge pull request #197 from matomo-org/ux-287
AltamashShaikh Nov 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions .github/workflows/matomo-tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Action for running tests
# This file has been automatically created.
# To recreate it you can run this command
# ./console generate:test-action --plugin="MarketingCampaignsReporting" --php-versions="7.2,8.3" --schedule-cron="55 2 * * 6"
# ./console generate:test-action --plugin="MarketingCampaignsReporting" --php-versions="matomo5_min_php,matomo5_max_php" --schedule-cron="55 2 * * 6"

name: Plugin MarketingCampaignsReporting Tests

Expand Down Expand Up @@ -33,19 +33,17 @@ concurrency:

jobs:
PluginTests:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
php: [ '7.2', '8.3' ]
php: [ 'matomo5_min_php', 'matomo5_max_php' ]
target: ['minimum_required_matomo', 'maximum_supported_matomo']
steps:
- uses: actions/checkout@v3
with:
lfs: true
persist-credentials: false
- name: Install package ripgrep
run: sudo apt-get install ripgrep
- name: Run tests
uses: matomo-org/github-action-tests@main
with:
Expand All @@ -54,9 +52,9 @@ jobs:
test-type: 'PluginTests'
matomo-test-branch: ${{ matrix.target }}
artifacts-pass: ${{ secrets.ARTIFACTS_PASS }}
upload-artifacts: ${{ matrix.php == '7.2' && matrix.target == 'maximum_supported_matomo' }}
upload-artifacts: ${{ matrix.php == 'matomo5_min_php' && matrix.target == 'maximum_supported_matomo' }}
UI:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -68,7 +66,7 @@ jobs:
plugin-name: 'MarketingCampaignsReporting'
matomo-test-branch: 'maximum_supported_matomo'
test-type: 'UI'
php-version: '7.2'
php-version: 'matomo5_min_php'
node-version: '16'
artifacts-pass: ${{ secrets.ARTIFACTS_PASS }}
upload-artifacts: true
43 changes: 43 additions & 0 deletions .github/workflows/phpcs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: PHPCS check

on: pull_request

permissions:
actions: read
checks: read
contents: read
deployments: none
issues: read
packages: none
pull-requests: read
repository-projects: none
security-events: none
statuses: read

jobs:
phpcs:
name: PHPCS
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
lfs: false
persist-credentials: false
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: cs2pr
- name: Install dependencies
run:
composer init --name=matomo/marketingcampaignsreporting --quiet;
composer --no-plugins config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true -n;
composer config repositories.matomo-coding-standards vcs https://github.com/matomo-org/matomo-coding-standards -n;
composer require matomo-org/matomo-coding-standards:dev-master;
composer install --dev --prefer-dist --no-progress --no-suggest
- name: Check PHP code styles
id: phpcs
run: ./vendor/bin/phpcs --report-full --standard=phpcs.xml --report-checkstyle=./phpcs-report.xml
- name: Show PHPCS results in PR
if: ${{ always() && steps.phpcs.outcome == 'failure' }}
run: cs2pr ./phpcs-report.xml --prepend-filename
13 changes: 7 additions & 6 deletions API.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand Down Expand Up @@ -156,7 +157,7 @@ private function isTableEmpty(DataTable\DataTableInterface $dataTable)
{
if ($dataTable instanceof DataTable) {
return $dataTable->getRowsCount() == 0;
} else if ($dataTable instanceof DataTable\Map) {
} elseif ($dataTable instanceof DataTable\Map) {
foreach ($dataTable->getDataTables() as $label => $childTable) {
if ($this->isTableEmpty($childTable)) {
return true;
Expand All @@ -168,17 +169,18 @@ private function isTableEmpty(DataTable\DataTableInterface $dataTable)
}
}

private function mergeDataTableMaps(DataTable\DataTableInterface $dataTable,
DataTable\DataTableInterface $referrersDataTable)
{
private function mergeDataTableMaps(
DataTable\DataTableInterface $dataTable,
DataTable\DataTableInterface $referrersDataTable
) {
if ($dataTable instanceof DataTable) {
if ($this->isTableEmpty($dataTable)) {
$referrersDataTable->setAllTableMetadata($dataTable->getAllTableMetadata());
return $referrersDataTable;
} else {
return $dataTable;
}
} else if ($dataTable instanceof DataTable\Map) {
} elseif ($dataTable instanceof DataTable\Map) {
foreach ($dataTable->getDataTables() as $label => $childTable) {
$newTable = $this->mergeDataTableMaps($childTable, $referrersDataTable->getTable($label));
$dataTable->addTable($newTable, $label);
Expand All @@ -188,5 +190,4 @@ private function mergeDataTableMaps(DataTable\DataTableInterface $dataTable,
throw new \Exception("Sanity check: unknown datatable type '" . get_class($dataTable) . "'.");
}
}

}
21 changes: 11 additions & 10 deletions Archiver.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand All @@ -13,15 +14,15 @@

class Archiver extends \Piwik\Plugin\Archiver
{
const CAMPAIGN_ID_RECORD_NAME = 'MarketingCampaignsReporting_Id';
const CAMPAIGN_NAME_RECORD_NAME = 'MarketingCampaignsReporting_Name';
const CAMPAIGN_KEYWORD_RECORD_NAME = 'MarketingCampaignsReporting_Keyword';
const CAMPAIGN_SOURCE_RECORD_NAME = 'MarketingCampaignsReporting_Source';
const CAMPAIGN_MEDIUM_RECORD_NAME = 'MarketingCampaignsReporting_Medium';
const CAMPAIGN_CONTENT_RECORD_NAME = 'MarketingCampaignsReporting_Content';
const CAMPAIGN_GROUP_RECORD_NAME = 'MarketingCampaignsReporting_Group';
const CAMPAIGN_PLACEMENT_RECORD_NAME = 'MarketingCampaignsReporting_Placement';
const HIERARCHICAL_SOURCE_MEDIUM_RECORD_NAME = 'MarketingCampaignsReporting_SourceMedium_Name';
public const CAMPAIGN_ID_RECORD_NAME = 'MarketingCampaignsReporting_Id';
public const CAMPAIGN_NAME_RECORD_NAME = 'MarketingCampaignsReporting_Name';
public const CAMPAIGN_KEYWORD_RECORD_NAME = 'MarketingCampaignsReporting_Keyword';
public const CAMPAIGN_SOURCE_RECORD_NAME = 'MarketingCampaignsReporting_Source';
public const CAMPAIGN_MEDIUM_RECORD_NAME = 'MarketingCampaignsReporting_Medium';
public const CAMPAIGN_CONTENT_RECORD_NAME = 'MarketingCampaignsReporting_Content';
public const CAMPAIGN_GROUP_RECORD_NAME = 'MarketingCampaignsReporting_Group';
public const CAMPAIGN_PLACEMENT_RECORD_NAME = 'MarketingCampaignsReporting_Placement';
public const HIERARCHICAL_SOURCE_MEDIUM_RECORD_NAME = 'MarketingCampaignsReporting_SourceMedium_Name';

const SEPARATOR_COMBINED_DIMENSIONS = " - ";
public const SEPARATOR_COMBINED_DIMENSIONS = " - ";
}
93 changes: 93 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
## Changelog

#### 5.1.5 - 2025-11-11
- Fixed fatal error due to new code to track AI referrer visit

#### 5.1.4 - 2025-11-10
- Fixed incorrectly forcing a new visit for visits referred by AI referrers

#### 5.1.3 - 2025-10-13
- Fix for handling AI referrers correctly, providing utm_source parameter

#### 5.1.2 - 2025-07-21
- README.md updated

#### 5.1.1 - 2025-01-15
- Changed to logic to lower the campaign values in database query instead of serverside

#### 5.1.0
- Added an option to retain the case of campaign parameter values via SystemSetting

#### 5.0.4
- Added plugin category for Marketplace

#### 5.0.3
- Fixed flat report not working for campaign_name and campaign_source-medium report

#### 5.0.2
- Archiving: Ensure parameter is provided in correct type

#### 5.0.1
- Compatability with Matomo 5

#### 5.0.0-b1
- Compatability with Matomo 5

#### 4.1.3
- Translation changes

#### 4.1.2
- Allowed creating new visit when campaign changes to be different per site if necessary

#### 4.1.1
- Fixed deprecation warnings for PHP 8.1

#### 4.1.0
- Additional dimensions for campaign group and placement

#### 4.0.0
- Compatibility with Matomo 4 and translation updates

#### 3.1.1
- Rebrand and translation updates

#### 3.1.0
- Show campaign information in visitor log and profile

#### 3.0.1
- Enables segmented visitorlog for campaign reports

#### 3.0.0
- Plugin forked by Piwik team + Renamed + Compatibility with Piwik 3

#### 1.4.0
- Added possibility to configure custom campaign parameters names

#### 1.3.1
- Better support for campaign parameters behind hash tag (#)

#### 1.3.0
- Compatibility with Piwik 2.16.0

#### 1.2.0
- Plugin comaptibility with Piwik 2.15.0

#### 1.1.1
- Campaign reports now display your campaign report data even for campaign data before you activated AdvancedCampaignReporting

#### 1.1.0

#### 1.0.8
- Exclude Google Analytics campaign parameters from the Page URLs

#### 1.0.6
- Documentation

#### 1.0.5
- Detect new URL parameters: piwik_campaign, pk_cpn and for Keywords: pk_kwd, piwik_keyword

#### 1.0.4
- View Goals by Campaign Dimension in the Goals & Ecommerce reports

#### 1.0.3
- Released for free on the [Piwik Marketplace](http://plugins.piwik.org/)
8 changes: 3 additions & 5 deletions Campaign/CampaignDetector.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand All @@ -11,7 +12,6 @@

namespace Piwik\Plugins\MarketingCampaignsReporting\Campaign;

use Piwik\Common;
use Piwik\Plugins\MarketingCampaignsReporting\MarketingCampaignsReporting;
use Piwik\Tracker\PageUrl;
use Piwik\Tracker\Request;
Expand All @@ -29,7 +29,8 @@ public function detectCampaignFromRequest(Request $request, $campaignParameters)
$landingUrl = PageUrl::cleanupUrl($landingUrl);
$landingUrlParsed = parse_url($landingUrl);

if (!isset($landingUrlParsed['query'])
if (
!isset($landingUrlParsed['query'])
&& !isset($landingUrlParsed['fragment'])
) {
return false;
Expand Down Expand Up @@ -84,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;
Expand Down
1 change: 1 addition & 0 deletions Campaign/CampaignDetectorInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand Down
12 changes: 11 additions & 1 deletion Columns/Base.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand Down Expand Up @@ -43,6 +44,11 @@ public function onNewVisit(Request $request, Visitor $visitor, $action)

$visitProperties = $visitor->visitProperties->getProperties();

// @todo Not using Common::REFERRER_TYPE_AI_ASSISTANT for BC reasons. Can be changed with Matomo 6
if ($visitProperties['referer_type'] === 8) {
return null; // skip campaign detection when a AI assistant was detected as referrer by core
}

$campaignDimensions = $campaignDetector->detectCampaignFromRequest(
$request,
$campaignParameters
Expand All @@ -52,7 +58,6 @@ public function onNewVisit(Request $request, Visitor $visitor, $action)
// If for some reason a campaign was detected in Core Tracker
// but not here, copy that campaign to the Advanced Campaign
if ($visitProperties['referer_type'] == Common::REFERRER_TYPE_CAMPAIGN) {

$campaignDimensions = array(
(new CampaignName())->getColumnName() => $visitProperties['referer_name']
);
Expand Down Expand Up @@ -82,6 +87,11 @@ public function onAnyGoalConversion(Request $request, Visitor $visitor, $action)

$visitProperties = $visitor->visitProperties->getProperties();

// @todo Not using Common::REFERRER_TYPE_AI_ASSISTANT for BC reasons. Can be changed with Matomo 6
if ($visitProperties['referer_type'] === 8) {
return null; // skip campaign detection when a AI assistant was detected as referrer by core
}

$campaignDimensions = $campaignDetector->detectCampaignFromVisit(
$visitProperties,
$campaignParameters
Expand Down
1 change: 1 addition & 0 deletions Columns/CampaignContent.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand Down
1 change: 1 addition & 0 deletions Columns/CampaignGroup.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand Down
1 change: 1 addition & 0 deletions Columns/CampaignId.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand Down
1 change: 1 addition & 0 deletions Columns/CampaignKeyword.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand Down
1 change: 1 addition & 0 deletions Columns/CampaignMedium.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand Down
Loading