Prevent Top Pages analytics visualization URLs from extra segmenting
Summary
As noted in an internal customer feedback session (internal slack link) our Top Pages visualization appears to return the same page path multiple times.
This is due to the change introduced in Deeplink URLs presented as Top Pages in the Beh... (#406815 - closed) where the visualization was modified to have an additional pageUrl
dimension, in order to be able to create clickable links from the report. This had the unintended side effect of segmenting results based on the full URL, instead of just the path.
E.g.
Would have all previously been counted as a single page (grouped by path) but now show as separate pages (grouped by full url), with counts split among them.
Possible solution
A workaround for this might be to instead rely on the pageUrlhosts
dimension for creating clickable links, as this will be the same value in most cases and will prevent pages being segmented. We would then need to manually construct the link href
from host + path.
One complication with this approach is that pageUrlhosts
does not include protocol or port. I see the value localhost
whereas pageUrl
shows https://locaclhost:3000/*
. This won't impact most customers if we assume https
and no port, but could be a problem in some situations.
So we should modify our schema to have a siteUrl
or some such which extracts the protocol+host+port from the pageUrl. We can then use this as a dimension and safely construct links from it.