Skip to content

Conversation

@chippison
Copy link
Contributor

Description

UX-341
We need to update the page title everytime active Segment is changed as well as changes in the Menu Category and Subcategory

CHANGE #1 SEGMENT in Page title

Currently, the Browser Page title,
<title>Demo Site - 2025-10-14 - Web Analytics Reports - Matomo</title>
But because a segment called Click liveaboard.com ad is selected in the UI at this URL,
we expect instead the Segment name to be displayed, AFTER the date in the title, like this:

CHANGE #2 Current Menu Category and Subcategory in Page title

So for example when viewing the goal My Goal Name which is inside the “Goals” menu,
We concatenate the Menu category and the Menu sub-category together with > character as separator

With both the Segment and Menu Category and Subcategory:

<title>Demo Site - 2025-10-14 - Goals > My Goal Name - Click liveaboard.com ad - Web Analytics Reports - Matomo</title>

The default title will be (after login):

<title>Demo Site - 2025-11-23 - Dashboard - All visits - Web Analytics Reports - Matomo</title>

Checklist

  • [NA] I have understood, reviewed, and tested all AI outputs before use
  • [NA] All AI instructions respect security, IP, and privacy rules

Review

@chippison chippison force-pushed the ux-341 branch 2 times, most recently from d9a7b85 to 04abd00 Compare November 25, 2025 21:11
…much except to remove the call to function that actually changes the html title. We transferred them to its own function
… Matomo.ts. Its more readable than the previous solution (inline declarations)
…tly undefined;

also made window.CoreHome return undefined if it does not exist before using
@chippison chippison marked this pull request as ready for review November 27, 2025 04:37
segmentationTitle.text(title);
this.setTooltip(title);
}
window.CoreHome.MatomoUrl.updatePageTitle();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed to add this here because of a bug when clicking segments, the initial click returns the previous segment and the function gets run again after the hash has updated and its the second run of the function that gets the correct 'clicked' value.
The bug should be fixed in a different PR and is out of scope here

@chippison chippison requested a review from a team November 28, 2025 04:20
@tzi
Copy link
Contributor

tzi commented Nov 28, 2025

I do not know why, but there is a falling test that I do not see on other PRs:

Screenshot 2025-11-28 at 16 06 23

@chippison chippison requested review from a team and tzi December 1, 2025 00:40
tzi
tzi previously approved these changes Dec 1, 2025
Copy link
Contributor

@tzi tzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small feedbacks left, but nothing critical.

@tzi
Copy link
Contributor

tzi commented Dec 1, 2025

Feature feedback for @mattab:
It would be great in the future to remove a bit of noise in the title. For example:

  • Remove the date if it is the default one: "yesterday"
  • Remove the segment label if it is all visits.

I you agree, it also could be done in a future ticket/PR.

@mattab
Copy link
Member

mattab commented Dec 1, 2025

@tzi Thanks for your feedback, very good points! I don't think we need to create the tiket ourselves in this specific case so let's see if people ask for it. I guess it's fine to show date/segments always. It doesn't hurt to "push back" the "web analytics" static text by "All visits"

@chippison chippison requested review from a team and tzi December 1, 2025 20:35
@tzi
Copy link
Contributor

tzi commented Dec 2, 2025

@mattab I have a usecase!
If I open Matomo and bookmark the Dashboard, the link name will be 2025-11-25 even if I click it it will display yestarday data and not the ones from the specify date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants