Integration/URL parameter Issue (Prolific/Qualtrics/JATOS)
I am having an issue with saving my URL parameters while moving across platforms.
I am able to move from Prolific to Qualtrics while maintaining my "PROLIFIC_PID" in the URL.
In Qualtrics, I set this as "embedded data"
and then redirect to my JATOS study link calling the embedded data:
Within my js code, I use var PROLIFIC_PID = jatos.urlQueryParameters.PROLIFIC_PID
to then get the PID. I do this in all html
files (I have a "welcome" component that then moves to a different component based on the condition a worker is assigned, similar to the randomize_between_workers
example).
However, when I run tests of the study through Prolific, the welcome page of the first component
a. does not have the URL parameters within the URL and
b. shows a console error: TypeError: undefined is not an object (evaluating 'jatos.urlQueryParameters.PROLIFIC_PID')
When I remove this from my first component's html
file, the task runs as expected, but when I redirect to qualtrics (end redirect URL: https://affiliation.co1.qualtrics.com/jfe/form/mysurvey?PROLIFIC_PID=[PROLIFIC_PID]
the resulting URL says the PROLIFIC_PID
is undefined
(https://brown.co1.qualtrics.com/jfe/form/SV_5yCDb4XUZvxFuHY?PROLIFIC_PID=undefined
)
I am assuming that the embedded data and custom hyperlink made in Qualtrics during the first redirect is somehow not being sent to or read in by JATOS. Would love some help on this!
Comments
Hi,
I don't have experience with Qualtrics, so it's a bit difficult to answer the question.
First, just to check (though from what you described I'm fairly sure this is the case) that the problem is not in your code but in passing the query parameters between Qualtrics and JATOS.
If you open the Developer Tools in your browser, put a breakpoint somewhere at the very beginning, and ask in the console for the contents of
jatos.urlQueryParameters
you'll be able to see what go transferred from Qualtrics. If it's the case that the information is not there, you're going to have to change something in Qualtrics.You could also check if the problem is in Qualtrics sending any query parameter, or just the variable one you specified. Try to hard-code any given value of PROLIFIC-ID in Qualtrics and see if that gets correctly sent.
If the problem is indeed in Qualtrics, we probably won't be able to help much more than that, sorry.
Hope this helps
Elisa
SOLVED!
All of these steps work when linking prolific -> Qualtrics -> Jatos study -> Qualtrics -> prolific if you add
the
jatos.urlQueryParameters
command within yourjatos.onLoad
functionThis is what I have:
Everything now works as expected/desired! Thank you @elisa for your help!
hi,
I have the following problem and I think you guys could help me.
So I use the jatos.urlqueryparameters code for retrieving an ID from qualtrics, but the ID that I try to retrieve from the URL is not saved in the Jatos results. When I check, during running the study in Jatos, if I can retrieve the jatos.urlqueryparameters in my browser window, I can weirdly find the right ID. So how is it possible Jatos doesn't save the ID in the results (the space {} stays blank (url: {}). What is the full code you guys would use in your lab.js script? thank you in advance.
Kind regards
Mrockster