Deeplink URLs presented as Top Pages in the Behavior dashboard
In the Behavior dashboard, we present the top pages for a project instrumented with Product Analytics.
Being able to directly click through to these URLs would improve out the UX experience in addition to simply being a quality-of-life improvement.
We have the information in Cube to be able to fill out the full URL path, so it would likely require an additional Cube request to be able to piece the document host and path together, and then modify the visualization to be able to link to the pages that are being reported on.
Implementation plan
Modify the visualization
- Modify
product_analytics/visualizations/top_pages.json:- Add a second dimension
"TrackedEvents.url"to return the full page URL - Add a new
optionsconfig to this visualization, and update the schema JSON to document this option.
- Add a second dimension
"links": [
{
"text": "TrackedEvents.docPath",
"href": "TrackedEvents.url"
}
]
This allows visualizations to group pairs of dimensions together as links.
Update the data_source
- in
panels_base.vuepass throughthis.visualization.optionsto the data sourcefetchcall - in
cube_analytics.jsuse the options inconvertToTableFormatinside the mapping code.- omit any row with a key that is contained in
linksas ahref
This means we will not displayTrackedEvents.urlas its own column - any rows with a key contained in
linksas atextwill be mapped to return an object as a value, instead of a string
The object will containtextandhref, where text is the value forTrackedEvents.docPathandhrefis the value forTrackedEvents.url
- omit any row with a key that is contained in
Update the visualization
- in
visualizations/data_table.vueadd a newisLinkmethod which returns true if the value is a{ text, href }object instead of a string - modify the
<gl-table>and specify a slot to customise the content rendering - render a link if isLink, else render the raw value
Tests
- yes
Edited by Elwyn Benson
