Page MenuHomePhabricator

TSS2 doesn't track pagination & back button
Open, LowPublic

Description

While working on T143589 I came across something I've vaguely noticed before but never really investigated in depth. The essence of the problem is multiple SERPs that have the exact same query and searchSessionId, but different pageViewId's. After talking to @EBernhardson on IRC, we think that the 2 most likely causes of this are:

  • Pagination: user going to different pages of results, so when the next set of results loads that's a new SERP event
  • Back button usage: user clicking on a result, then going back to the SERP

(Rather than the user opening up multiple tabs of the same search.)

Erik said it should be relatively simple to track pagination. The harder problem is the back button. Currently, when the user goes back to the SERP, the browser makes a new search request to the servers, which results in a new search. When the user goes back initially, we still have the old searchToken from the original SERP in the URL, but when the page finishes loading and the JS is run, it replaces the value of the searchToken in the URL with the new one.

Some potential solutions include:

  • Recording the original searchToken and including it as an extraParam in the SERP events so that even different loads of essentially the same page can be linked together
  • Doing something with the caching headers so that we don't perform the exact same search again and actually do give the user the original page again so we end up with same searchTokens that we can use to link multiple loads

(I really like Erik's caching idea {this would be done locally with the caching headers} because click-back-click is a totally normal user behavior, so presumably that'd take some load off our servers if they're not just re-running the same searches.)

Event Timeline

debt triaged this task as Medium priority.EditedSep 22 2016, 8:18 PM
debt removed a project: Discovery-Analysis.
debt added a subscriber: Jdrewniak.

This looks like it could be done in two parts - front end work and backend - but we'll get into that more when we start on this work.

debt added a project: Discovery.
debt moved this task from needs triage to This Quarter on the Discovery-Search board.

Ideally, this would be awesome to get done, but it'll be a bit of work to do.

Let's see if we can look at this issue, this quarter, @Jdrewniak, when you have spare time from the Portal automation tasks.

Gehel lowered the priority of this task from Medium to Low.Aug 28 2020, 9:37 AM
Gehel moved this task from elastic / cirrus to UI tickets on the Discovery-Search board.