oTree Forum >

Participant_label is too long or malformed error

#1 by None (edited )

I am trying to pass in some parameter variables into an otree player model from my study's particpant URL link as follows: 


However I am getting an error that "participant_label is too long or malformed" (the code works with shorter parameter values). What is the size limit for the participant label variable, and is there a way to increase it? I can't make the parameter values shorter, unfortunately.

Thanks in advance

#2 by ErikdeKwaadsteniet

I'm having the same issue. What is the size limit of participant labels? And is there a way to increase it?


#3 by Chris_oTree

The participant label limit is something like 200-300 characters I think. It's not possible to increase it. Can you tell me more about your use case for having long participant labels?

#4 by ErikdeKwaadsteniet

Thanks for replying so quickly! The company I work with has a database of participants and they make use of redirect links with tracking ids. They use redirect links to the survey that includes a unique tracking id for each participant. This id is more than 200 characters long and it needs to be imported into otree via a redirect link. As far as I know, I can only do this by calling the tracking_id participant_label. I already asked the company to change the ?tracking_id=... to ?participant_label=... and they changed this but then otree says the participant_label is too long or malformed. I also asked them if they can use shorter tracking_IDs but this seems to be impossible. If I am able to get the tracking id into otree, I need to include it again at the end of my otree survey to redirect the participant back to the company website, so that they know which participants finished the study, after which they can pay them. Hopefully, this is enough info for you, and you know of a solution.

P.S. when I test it out, it seems that otree can import participant_labels of 100 characters max.

#5 by ErikdeKwaadsteniet (edited )

I still haven't solved this. Would the following code perhaps be a way to do it?


I can then chop the long tracking_id up in smaller parts (for instance 3 x 60-70 characters) and then send the different parts to otree as separate participant vars. At the end I can then put them all together as tracking_id in the completion redirect link again. Or is this not possible either?

Advice would be greatly appreciated!


#6 by ErikdeKwaadsteniet

Update: in case anyone has the same problem, using the above code from github indeed did the trick (see https://github.com/oTree-org/extra-url-params). Apparently, the participant vars that can be sent to an otree room via the otree rest api can be much longer than the participant label itself. So, by sending the 200 character tracking id as participant var, I was able to load it into the otree session. I could then also easily add it to the completion url at the end of the experiment.

Write a reply

Set forum username