Skip to content

Commit 0d8576b

Browse files
committed
Move AI Agents reports into their own overview category
1 parent f0bea77 commit 0d8576b

12 files changed

Lines changed: 100 additions & 100 deletions

ā€Žlang/en.jsonā€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"General": {
33
"12HourClock": "12-hour clock",
44
"24HourClock": "24-hour clock",
5+
"AIAssistants": "AI Assistants",
56
"API": "API",
67
"AbandonedCarts": "Abandoned Carts",
78
"AboutPiwikX": "About Matomo %s",
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
/**
4+
* Matomo - free/libre analytics platform
5+
*
6+
* @link https://matomo.org
7+
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
8+
*/
9+
10+
declare(strict_types=1);
11+
12+
namespace Piwik\Plugins\AIAgents\Categories;
13+
14+
use Piwik\Category\Subcategory;
15+
use Piwik\Piwik;
16+
17+
class AIAgentsOverviewSubcategory extends Subcategory
18+
{
19+
protected $categoryId = 'General_AIAssistants';
20+
protected $id = 'AIAgents_AIAgentsOverview';
21+
protected $order = 10;
22+
23+
public function getHelp()
24+
{
25+
return sprintf(
26+
'<p>%1$s</p>',
27+
Piwik::translate('AIAgents_AIAgentsOverviewSubcategoryDescription')
28+
);
29+
}
30+
}

ā€Žplugins/AIAgents/Categories/AIAssistantsOverviewSubcategory.phpā€Ž

Lines changed: 0 additions & 32 deletions
This file was deleted.

ā€Žplugins/AIAgents/Reports/Get.phpā€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ protected function init()
3131
parent::init();
3232

3333
$this->name = Piwik::translate('AIAgents_AIAgentVisits');
34-
$this->categoryId = 'AIAgents_AIAssistants';
35-
$this->subcategoryId = 'General_Overview';
34+
$this->categoryId = 'General_AIAssistants';
35+
$this->subcategoryId = 'AIAgents_AIAgentsOverview';
3636
$this->order = 10;
3737

3838
$this->processedMetrics = [

ā€Žplugins/AIAgents/lang/en.jsonā€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"AIAgents": {
33
"AIAgentName": "AI Agent Name",
4+
"AIAgentsOverview": "AI Agents Overview",
45
"AIAgentVisits": "AI Agent Visits",
56
"AIAgentVisitsDocumentation": "This is an overview of AI Agent visits. AI agent traffic only includes visits where an AI opens your site in a real browser and behaves like a human visitor. It does not include background requests from ChatGPT or other AI tools that fetch your pages without using a browser.",
6-
"AIAssistants": "AI Assistants",
7+
"AIAgentsOverviewSubcategoryDescription": "Review how AI agents and human visitors engage with your site at a glance. This overview surfaces combined metrics and trends so you can quickly spot changes before exploring detailed reports.",
78
"AIAssistantsOverviewHelp1": "The AI Assistant Overview page provide insights into website traffic originating from AI Assistants such as ChatGPT and other large language model–based assistants. These reports track key metrics including the number of requests made by these bots, the pages and documents they access, and any errors encountered. They also offer detailed breakdowns showing which bots visit specific page URLs, helping you understand how AI assistants interact with your content and identify opportunities to improve visibility and accessibility for AI-driven users.",
89
"AIAssistantsOverviewHelp2": "It’s important to note that none of these pages were actually viewed by humans in the traditional way — all requests originate from AI assistants fetching content automatically.",
910
"AIAssistantsOverviewHelp3": "Currently, these reports exclusively include requests from AI bots that do not execute JavaScript. They do not include traffic from AI crawlers used for training AI models or from AI agents capable of executing JavaScript.",

ā€Žplugins/AIAgents/tests/UI/AIAgents_spec.jsā€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
describe('AIAgents', function () {
1111
this.fixture = 'Piwik\\Plugins\\AIAgents\\tests\\Fixtures\\AIAgents';
1212

13-
const url = '?module=CoreHome&action=index&category=AIAgents_AIAssistants&subcategory=General_Overview&idSite=1&period=day&date=2025-07-20';
13+
const url = '?module=CoreHome&action=index&category=General_AIAssistants&subcategory=AIAgents_AIAgentsOverview&idSite=1&period=day&date=2025-07-20';
1414

1515
it('should display the AI agents overview', async function () {
1616
await page.goto(url);

plugins/AIAgents/Categories/AIAssistantsCategory.php renamed to plugins/CoreHome/Categories/AIAssistantsCategory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99

1010
declare(strict_types=1);
1111

12-
namespace Piwik\Plugins\AIAgents\Categories;
12+
namespace Piwik\Plugins\CoreHome\Categories;
1313

1414
use Piwik\Category\Category;
1515

1616
class AIAssistantsCategory extends Category
1717
{
18-
protected $id = 'AIAgents_AIAssistants';
18+
protected $id = 'General_AIAssistants';
1919
protected $order = 80;
2020
protected $icon = 'icon-admin-platform';
2121
}

ā€Žtests/PHPUnit/Integration/Category/CategoryListTest.phpā€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public function testGetAllCategoriesWithSubcategoriesShouldFindCategories()
3535
$list = CategoryList::get();
3636

3737
$this->assertSame(array(
38+
'General_AIAssistants',
3839
'General_Actions',
3940
'General_KpiMetric',
4041
'General_Visitors',
@@ -55,7 +56,6 @@ public function testGetAllCategoriesWithSubcategoriesShouldFindCategories()
5556
'ProfessionalServices_PromoHeatmaps',
5657
'ProfessionalServices_PromoMediaAnalytics',
5758
'ProfessionalServices_PromoSessionRecording',
58-
'AIAgents_AIAssistants',
5959
'ExampleUI_UiFramework',
6060
'CustomVariables_CustomVariables',
6161
), array_keys($list->getCategories()));

ā€Žtests/PHPUnit/Integration/WidgetsListTest.phpā€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function testGet()
5252
'Referrers_Referrers' => 11,
5353
'About Matomo' => 11,
5454
'Marketplace_Marketplace' => 3,
55-
'AIAgents_AIAssistants' => 2,
55+
'General_AIAssistants' => 2,
5656

5757
// widgets provided by Professional Services plugin for plugin promos
5858
'ProfessionalServices_PromoAbTesting' => 1,

ā€Žtests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getReportMetadata_day.xmlā€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3546,7 +3546,7 @@
35463546
</row>
35473547
<row>
35483548
<category>AI Assistants</category>
3549-
<subcategory>Overview</subcategory>
3549+
<subcategory>AI Agents Overview</subcategory>
35503550
<name>AI Agent Visits</name>
35513551
<module>AIAgents</module>
35523552
<action>get</action>

0 commit comments

Comments
Ā (0)
⚔