We want to serve a QuickSurvey to readers arriving on articles from Discord preview links, so that we can learn how Discord users perceive Wikipedia on that platform. Inbound links from Discord carry a provenance parameter (https://wikitech.wikimedia.org/wiki/Provenance) specific to this feature (wprov=diim1). Only a configurable sample of qualifying readers will see the survey, and it must impose no cost on readers who cannot see it.
Technical notes
The wprov param is stripped from the URL client-side by mediawiki.page.ready and is not visible to PHP (it is excluded from the CDN cache key by design). MediaWiki core now exports the stripped value from mediawiki.page.ready so dependent modules can read it (https://gerrit.wikimedia.org/r/1307856, merged).
No changes need to be made to QuickSurveys itself: the extension is in maintenance mode, and the earlier approach of adding an audience.wprov key there (https://gerrit.wikimedia.org/r/1307888) was reverted (https://gerrit.wikimedia.org/r/1308195). Instead, all Discord-specific logic lives downstream in WikimediaCustomizations (https://gerrit.wikimedia.org/r/1310639), alongside the code that generates the preview links and their wprov value (both read from $wgWMCDiscord).
Acceptance criteria
- A survey defined in WikimediaCustomizations displays to readers who land on an article with the configured Discord wprov value, sampled at $wgWMCDiscord['surveyCoverage'], and can be enabled/tuned per wiki via configuration alone (https://gerrit.wikimedia.org/r/1310639)
- Enabling the survey ships no QuickSurveys code to readers who are not eligible
- The client-side visibility of wprov and the diim1 value are documented at https://wikitech.wikimedia.org/wiki/Provenance