-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[EBT] Add the page's title and the URL's path to the events' context #149249
Comments
Pinging @elastic/kibana-core (Team:Core) |
@afharo any chance we can get an ETA on this? It's going to be crucial for our information architecture revamp project. |
@alexmarhaba, let me work out with the team the prioritization. |
Some implementation notes: Reacting to it looks like we can react to title changes using the We then need to register a context provider via Reacting to We can listen to the Here's a small snippet testing those 2 observers: <html>
<header>
<title>Test</title>
</header>
<body>
<a href="#" onclick="document.title = `Title ${Date.now()}`">Click here!</a>
<script>
// React to title changes
const observer = new MutationObserver((change) => {
console.info(`Title changed: ${change[0].target.textContent}`);
});
observer.observe(
document.querySelector('title'),
{ childList: true }
);
// React to URL changes
window.addEventListener('popstate', (ev) => {
console.info(ev);
})
</script>
</body>
</html> |
notes from grooming:
|
I noticed #150357... it might help with the react-router item 😇 |
In #150461 we have added the routeTitle to the announcement as the routeTitle. Could this help in terms of telemetry? |
just want to add a ++ on this if we can get this bumped in priority as it would add significant value for path reporting. thanks |
Hi @elastic/kibana-core I believe this issue might fall into your teams domains of telemetry? The page title is setup in packages/core/chrome/core-chrome-browser-internal/src/ui/header/screen_reader_a11y.tsx from the issue linked above and I spent some space time last week trying to figure out how to add that to the analytics client's context without much luck. If this is a high urgency issue, would your team be able to help? Thank you! |
No, I don't think it is. This component is adding a live region for the content of the Kibana breadcrumb, not for the title of the page (unless the breadcrumb is what you call the 'page title' here?).
Have you tried the approach @afharo described in #149249 (comment)? It seems that using these to add the info to an analytic context provider should do the trick?
Probably, yes. Is it? |
From a previous comment in this issue:
@vadimkibana agreed that the team would give it a go. Happy to help deliver this through. |
Yes, please do. I'll be un-assigning SharedUx from this, as Rachel gave it a go during her Space Time with no success. I'm not sure it is clear what needs to be done here and that the proposed methods of retrieving analytics insights are sound.
|
@vadimkibana, your comments make sense to me. |
Yeah, I think that's a fair assumption. In theory
Yeah, creating an observable based from listening our global history seems the correct way to do this. Note that some applications are still using the hash-based router, therefor internal navigation from within those apps will not be detected with that approach, but it's still probably fine. It probably means that the associated EBT context providers should be registered from within Core, given none of those two info are available externally atm (and that we likely don't want something like |
## Summary Part of #149249 Add a new EBT context providing the `page_url` field to events. `page_url` is based on the current url's `pathname` and `hash` exclusively (no domain, port, query param...) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary Part of #149249 Add a new EBT context providing the page_title field to events. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Both PRs have been merged, closing |
Adding the title of the page and the URL's pathname (without the host and the query params but with the hash) would help us identify in which view the event was generated.
This is needed by @alexmarhaba
The text was updated successfully, but these errors were encountered: