Millisecond Forums

custom fields from URL?

https://forums.millisecond.com/Topic25288.aspx

By tcarpenter - 7/18/2018

Hello, 

I'm curious if it's possible to add custom data fields from url? For example, if someone was going to take the same task twice, could I do something with the URL such as adding an "order" variable (coded 1 or 2) that could be saved with the data somehow?

https://research.millisecond.com/myaccount/myscript.web?subjectid=1&groupid=1234&order=1

Thanks
By Dave - 7/18/2018

tcarpenter - Wednesday, July 18, 2018
Hello, 

I'm curious if it's possible to add custom data fields from url? For example, if someone was going to take the same task twice, could I do something with the URL such as adding an "order" variable (coded 1 or 2) that could be saved with the data somehow?

https://research.millisecond.com/myaccount/myscript.web?subjectid=1&groupid=1234&order=1

Thanks

The script can generally only take in at most two query parameters and store them in its data file: one for the subject ID, another one for the group ID. The script would not have any awareness of additional query parameters beyond that. However,
(1) The full URL, including all query parameters (here: order in addition to subjectid and groupid) should be captured in the participant logs. You should be able to download the logs and merge the relevant information with the script's data file during data preparation using your preferred data analysis application.
(2) All incoming query parameters would also be preserved when you redirect to some other site after the experiment. If you were to redirect to a site under your control, you could also capture the information of interest there and then merge that with the remaining data.