A major part of my web app is a rich search functionality with about 7 different facets to filter on. All the search parameters are fully represented in the page URL; this means that a user might remain on what is conceptually the search page (i.e. URL always has the same path, /search
) but with varying combinations of query params (?q=holiday&fa=200&fb=3&...
) as she tweaks the filters.
My goal is twofold:
- To be able to capture every combination of search filters issued in a user session, for a deeper understanding of how people find what they're looking for. In particular I'd love to see full query params for each pageview hit in our export to BigQuery
- At a higher level, our product manager requires Google Analytics's Behavior Flow chart to collapse consecutive searches into a single interaction step (as long as user didn't navigate away from search to some item detail, then back). To my mind this means that I want Behavior Flow to ignore everything in the page path after the
?
.
When I let gtag.js record pageviews on its own, I seem to fail goal 2, as I do see query params—even session tracking from referrers!—in the interaction steps. When I disable send_page_view
and instead explicitly send a pageview by setting on the gtag config {page_path: '/search'}
, which omits the query params, then I achieve goal 2 but have lost the rich data required for goal 1.
Does Google Analytics offer a compromise? I read about content groupings, but the docs made it seem to me like this might be intended for static pages rather than unlimited dynamic search results.