Introduction
The Discovery team wants to run a few quicksurveys on article pages, when coming from search.
We want to have a qualitative estimate of search satisfaction, in addition to the quantitative data we collect.
Related Phab tickets: T118800, T113240 (the big one)
Context
- User types "a search" on wiki
- User lands on https://en.wikipedia.org/wiki/Special:Search?search=a+search&go=Go
- User clicks on the second search result https://en.wikipedia.org/wiki/Web_search_engine
- We catch the click in JavaScript, and append ?quicksurvey={QuickSurveyId} https://en.wikipedia.org/wiki/Web_search_engine?quicksurvey={QuickSurveyId}
- On page load, the QuickSurvey extension code reads the query parameter and shows the quick survey
- On page load, the URL is cleaned and the query parameter is removed from the URL so people can share the article page without the extra parameter.
Option 1: Cache busting is not an issue considering the number of page views containing a quicksurvey parameter:
But a valid question is: wouldn't performance impact the user satisfaction, thus the answer given to the survey?
Option 2: Add an exception in varnish for quicksurvey query param:
Duplicates the wprov subroutine here https://github.com/wikimedia/operations-puppet/blob/028fc711bc37cde42c4e475e56afeb15321f9508/templates/varnish/analytics.inc.vcl.erb#L92-L118
Option 3: Add an exception in varnish for quicksurvey query param:
Refactor the wprov subroutine here https://github.com/wikimedia/operations-puppet/blob/028fc711bc37cde42c4e475e56afeb15321f9508/templates/varnish/analytics.inc.vcl.erb#L92-L118
So that it becomes an identified and structured place for sharing information between pages without impacting varnish.
There would be client-side read&write API methods to deal with this kind of parameter, hosted in wprov.
Option 4: Use localStorage to store the [article id, quicksurvey id]
But this solution does not work well when sharing cross-domain information.
Hacks available online may work, but at first sound scary and definitely need more research before adopting.
Option5: Set a cookie to store the [article id, quicksurvey id]
Would solve sharing cross-domain information.
Is this option clean and scalable? Does it have page load drawbacks?
Option 6: Set a URI fragment instead of a query parameter
Wrong use of a URI fragment.
Conflicts? Changing the quicksurvey extension code to officially support URI fragments may be a quick and short enough solution for now but shoot in the foot later.
Sign-Off required
Option 1 would provide us misleading results. We want to reject it.
Discovery team wants to run a quicksurvey. The team is composed of front-end engineers that are fine with any of the 2-6 options above.
QuickSurveys team develops the Extension code. The team seems to be fine with any of the 2-6 options above (in favor of option 2 and 3 that do not require any code change).
We need a sign-off from Operations/Performance in order to move one option forward. From this sign off we should know how we will be able to scale running specific, contextual surveys on Wikipedia.