Logging url parameters in the OS component
in JATOS
Hey all,
I'm about to distribute an experiment build on a OSWeb study via a panel provider. The provider platform we use, provides a user id, given as a URL parameter to every participant. I therefore read the documentation on how to log such parameters with JATOS and on how to do so using OSWeb with the jatos.urlQueryParameters
function.
The problem is, that my OSWeb experiment is only one component of the whole JATOS experiment. Therefore once the OSWeb experiment part of is loaded, the URL has changed and seemingly doesn't contain the parameter to log anymore. When running the OSWeb experiment as a single component study I manage to log all URL parameters in the way staited above. Also when starting the experiment, I generally see that the URL parameters are reccocnized in my browser console. Its only the change of the URL when starting the OSWeb component where I think these parameters are getting "lost" so that they are no more to be logged in this component.
Since I only want data to be logged in from the OSWeb experiment (to tidy up the results) I wonder how I can use the quoted function above in the OSWeb component, to log the URL parameter of the initial URL?
Kind regards and thanks in advance,
Leo
Comments
Hi Leo,
This function
jatos.urlQueryParameters
should work in all JATOS components of the same JATOS study. E.g. if your URL parameter is calledfoobar
you can access it in any component of this study withjatos.urlQueryParameters.foobar
. But maybe I don't fully understand your question?Best,
Kristian
Hey Kristian,
thanks for the rapid reply! I see your point. What i somehow do not understand is that the jatos.urlQueryParameters seemingly are not passed to OS. Look when i run my study with parameters: m=123&test=456 and given the following code run at the beginning of the OSWeb experiment:
console.log("m parameter:", jatos.urlQueryParameter.m)
I receive the following browser console log:
JATOS query parameter: test = 456
JATOS query parameter: m = 123
m parameter: undefined
Ah shit i see it is the typo writing
jatos.urlQueryParameter.m
instead ofjatos.urlQueryParameters.m
Sorry I didn't see that before, thanks again for your service!