-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Update html page title to have both the current active Segment as well as Menu Category and Subcategory #23815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 5.x-dev
Are you sure you want to change the base?
Conversation
d9a7b85 to
04abd00
Compare
…much except to remove the call to function that actually changes the html title. We transferred them to its own function
…tle once we 'mark' the segment as current
… Matomo.ts. Its more readable than the previous solution (inline declarations)
… also cleaned up code a bit
…tly undefined; also made window.CoreHome return undefined if it does not exist before using
…oad or page refresh
…full refresh and when redirected from login
…g to reloadMenuItems
| segmentationTitle.text(title); | ||
| this.setTooltip(title); | ||
| } | ||
| window.CoreHome.MatomoUrl.updatePageTitle(); |
There was a problem hiding this comment.
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
…nd importing from another plugin by path
# Conflicts: # plugins/CoreHome/vue/dist/CoreHome.umd.min.js
…ync' keyword to getReportingMenuStore as its not really needed now
tzi
left a comment
There was a problem hiding this 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.
|
Feature feedback for @mattab:
I you agree, it also could be done in a future ticket/PR. |
|
@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" |
|
@mattab I have a usecase! |

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 adis 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
Review