Page MenuHomePhabricator

Add URL Parameter to Survey
Closed, ResolvedPublic2 Story Points

Description

As a research team member
I want to link eventlogging data with survey data, by passing the surveyInstanceToken to the third party survey tool by appending a url parameter to the survey link. The survey software will handle recording the surveyInstanceToken along with each response.

Acceptance criteria

  • An optional query string parameter can be passed to the URL of an external
  • External urls which already have a query string parameter can have a new query string parameter added.

For example, the base url for a sample Google survey is:

https://docs.google.com/forms/d/1qY5mxyArG8sOQsrwYz9Aa2z6VCAPcMqT4VnB3mo3W-k/viewform

To pre-fill the form with a surveyInstanceToken, the url is modified to be:

https://docs.google.com/forms/d/1qY5mxyArG8sOQsrwYz9Aa2z6VCAPcMqT4VnB3mo3W-k/viewform?entry.1206522024=547576563876

The base url for a sample Qualtrics survey is
https://qtrial2016q1az1.az1.qualtrics.com/jfe/form/SV_e8uKUubtLfMxGyF

To pre-fill the form with a surveyInstanceToken, the url is modified to be:

https://qtrial2016q1az1.az1.qualtrics.com/jfe/form/SV_e8uKUubtLfMxGyF
?token =354564765788

Details

Related Gerrit Patches:
mediawiki/extensions/QuickSurveys : masterAdd URL parameter for external surveys
mediawiki/extensions/QuickSurveys : devAdd URL parameter for external surveys

Event Timeline

ellery assigned this task to schana.
ellery raised the priority of this task from to Needs Triage.
ellery updated the task description. (Show Details)
ellery added projects: Research, QuickSurveys.
ellery added a subscriber: ellery.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptJan 23 2016, 12:55 AM
ellery updated the task description. (Show Details)Jan 23 2016, 12:56 AM
ellery set Security to None.
ellery updated the task description. (Show Details)Jan 23 2016, 12:59 AM
leila added a subscriber: leila.Jan 25 2016, 5:13 PM

@schana I have turned the priority of this task to High as the Reading team is finishing up their tasks for running a survey for Research and it's important for us to run the survey as soon as everything is ready, including this task. If you are working on other tasks, please ping me and I'm happy to help you reprioritize.

Re the current task: do you have all the information you need to start working on it?

Jdlrobson updated the task description. (Show Details)Jan 25 2016, 5:28 PM

This story is currently not estimable as I need the following questions answered:

  • The examples are unclear as they use a user id. Can you clarify what the query string parameter would look like?
  • Would every survey use the same query string parameter or are some surveys expected to have more than one parameter?
leila added a comment.Jan 25 2016, 6:22 PM

@ellery in the description we say "To pre-fill the form with a users id, the url is modified to be". I /think/ what you mean by "user id" is "funnel token" or "page token", correct? We don't have other ways to identifying user.

ellery added a comment.EditedJan 25 2016, 6:59 PM

@Jdlrobson

  1. the query string parameter name should be configurable. The value of the parameter will always be the surveyInstanceToken.
  2. there will only ever be one query string parameter that we need to add (i.e. surveyInstanceToken). I am not sure if the survey url will already have some query parameters set.
ellery updated the task description. (Show Details)Jan 25 2016, 7:05 PM

@Jdlrobson I also updated the description. Let me know if it needs more clarification.

Change 266797 had a related patch set uploaded (by Nschaaf):
Add URL parameter for external surveys

https://gerrit.wikimedia.org/r/266797

schana moved this task from Staged to In Progress on the Research board.Jan 27 2016, 7:46 PM

For the record: What I hear from @dr0ptp4kt is that this task is complete, but the code will not be merged until our ongoing discussion with Legal and Security are finalized.

Update - I think the code is still under review. Present advice is it's okay for engineers to +1 it if it is technically correct (i.e., an optional name-value pair can be appended => also means I think a query path separator [the ? mark] comes before it when this optional configuration is part of a given third party survey). Once the verbiage is solidified, though, the +2 can be applied if the +1s are there.

It's not optional as currently implemented. I'll fix that first thing Monday.

schana updated the task description. (Show Details)Jan 30 2016, 6:39 AM

The URL parameter is now optional.

Jdlrobson edited a custom field.Feb 1 2016, 5:52 PM

Update - I think the code is still under review. Present advice is it's okay for engineers to +1 it if it is technically correct (i.e., an optional name-value pair can be appended => also means I think a query path separator [the ? mark] comes before it when this optional configuration is part of a given third party survey). Once the verbiage is solidified, though, the +2 can be applied if the +1s are there.

@dr0ptp4kt to help me review this to the best of my ability is there a good reason why we wouldn't append this to all surveys?

If so, is there a good reason we make this so configurable? In the current patchset I can name the parameter anything so given a session id 5 I could use that cause confusion by configuring surveys like
http://surveys.wikimedia.org?id=50&token=5 and http://surveys.wikimedia.org?id=50&sessionid=5 and http://surveys.wikimedia.org?id=50&usersessionid=5
Wouldn't a simple boolean flag to send session id be enough?

i chatted with Adam in person and he told me that apparently the external surveys read this parameter and embed it in the form thus control over the name of the parameter is a necessary requirement which obviously changes this.

I will update my review with this in mind.

A few tweaks needed from @schana before we can wrap this up

Once the tweaks are in and acceptable to the code reviewers, code reviewers you've got the go ahead for +2 and merge-deploy the code.

Preferably this code is on the cluster the week of 8-February-2016 (again, assuming the code is good to go in time) (i.e., at the latest on Wikipedias by 11-February-2016).

I'd like @bmansurov or @phuedx to take a look at patch and +2
Note the patch is also on the dev branch so given the new release process we'll want to stick that back on master @schana

Change 266797 merged by jenkins-bot:
Add URL parameter for external surveys

https://gerrit.wikimedia.org/r/266797

Change 269351 had a related patch set uploaded (by Bmansurov):
Add URL parameter for external surveys

https://gerrit.wikimedia.org/r/269351

Change 269351 merged by jenkins-bot:
Add URL parameter for external surveys

https://gerrit.wikimedia.org/r/269351

phuedx added a comment.Feb 9 2016, 5:04 AM

Note the patch is also on the dev branch so given the new release process we'll want to stick that back on master @schana.

Done in 269351.

phuedx closed this task as Resolved.Feb 9 2016, 5:25 PM

I've deployed @schana's change to the staging server and updated the local configuration. You can see the change in action here: http://en.local.wmftest.net:8080/wiki/Selenium_language_test_page?useformat=mobile&debug=true&quicksurvey=external-survey-external%20example%20survey

phuedx updated the task description. (Show Details)Feb 9 2016, 5:26 PM