langcog / web-cdi

7 stars 5 forks source link

aid in addition to source id as the tracked info from link (dev centiment changes) #319

Closed JMankewitz closed 3 years ago

JMankewitz commented 3 years ago

Hi! The reusable link for a centiment study is eg http://webcdi-dev.stanford.edu/interface/nih-centiment/Centiment%20Pilot/new_parent/?source_id={{%source_id%}}

As I understand, we want to feed in the aid/pid here in addition to the source, which gets returned with the completion code at the end (similar to how the prolific process currently works).

So if a participant is coming in from prolific, the url will have source=prolific&pid=alphanumeric. For centiment it'll be source=centiment&aid=alphanumeric.

Otherwise, how will we collect the aid/pid from the participant?

JMankewitz commented 3 years ago

Additionally, we need aid passed to the completion code. Right now it passes just the URL without the aid/pid passed in.

JMankewitz commented 3 years ago

I have a suggestion that might not be right? But if we need to flexibly take in participants from centiment/prolific/any additional services maybe we keep pid in the intake url and then depending on the source_id we pass back either aid or pid as the outgoing url param amendment? I'm just thinking through how we can maintain prolific functionality as much as possible while expanding it to take in centiment aids...

HenryMehta commented 3 years ago

Hi! The reusable link for a centiment study is eg http://webcdi-dev.stanford.edu/interface/nih-centiment/Centiment%20Pilot/new_parent/?source_id={{%source_id%}}

As I understand, we want to feed in the aid/pid here in addition to the source, which gets returned with the completion code at the end (similar to how the prolific process currently works).

So if a participant is coming in from prolific, the url will have source=prolific&pid=alphanumeric. For centiment it'll be source=centiment&aid=alphanumeric.

Otherwise, how will we collect the aid/pid from the participant?

No, that is not how it works. We only need to replace {{%source_id%}} with the pid / aid. The rest is captured in the url. The use of {{%source_id%}} is because within prolific this will automatically populate the field with the pid. I need to know the templating language for centiment and I can replace {{%source_id%}} with the appropriate template code

HenryMehta commented 3 years ago

Additionally, we need aid passed to the completion code. Right now it passes just the URL without the aid/pid passed in.

No it doesn't. The aid is added within by the code. That is why you only put the completion code in the url

HenryMehta commented 3 years ago

I have a suggestion that might not be right? But if we need to flexibly take in participants from centiment/prolific/any additional services maybe we keep pid in the intake url and then depending on the source_id we pass back either aid or pid as the outgoing url param amendment? I'm just thinking through how we can maintain prolific functionality as much as possible while expanding it to take in centiment aids...

The way I have done it maintains prolific functionality and provides centiment functionality and allows for future development

HenryMehta commented 3 years ago

@JMankewitz Perhaps we need a Zoom conversation so I can talk you through and explain all of this. Clearly, my explanation in slack was poor

JMankewitz commented 3 years ago

Oh! Sorry this makes a bunch of sense, I got confused by the lack of aid in the final completion url. I'll do more testing tomorrow now that I understand. Thanks for clarifying!

JMankewitz commented 3 years ago

Hi I think there's still a problem with the final completion url. Right now, I've tested creating a participant with the intake link eg http://webcdi-dev.stanford.edu/interface/nih-centiment/Centiment%20Pilot/new_parent/?source_id=test

After completing the survey, at the last step I click "Click to Complete the Study" and get directed to https://app.centiment.co/r/client/complete?ct=ad97fcbc1c. This final redirect needs the &aid=test variable. Centiment uses this final variable to mark a specific participant as complete and give them payment.

The final url the participant gets directed to at the end should be https://app.centiment.co/r/client/complete?ct=ad97fcbc1c&aid={{source_id}}

NB: AFAIK Prolific does not need this &pid={{source_id}} variable, they generate a completion code per study and don't need to track individual participants' completion.

Please let me know if I'm still misunderstanding something.

HenryMehta commented 3 years ago

@JMankewitz It works for me (that is &aid=xxx is added to the URL). Did you set the participant source when you set up the study. Below I've copied my original slack instructions about setting it up

When creating the study set Demographic to English_Centiment.json, tick redirect URL and enter the base URL with the completion code like this https://app.centiment.co/r/client/complete?ct=8d4c9c6b1e.  The &aid=abcd will be added automatically.
Select Centiment for Participant Source - this way the program knows to add the ?aid=
JMankewitz commented 3 years ago

I found my problem, I'd accidentally selected "prolific" instead of "centiment" at that option. Apologies! This is working as expected, now.

I've tested with a couple formats and haven't encountered any other problems! Thanks!

HenryMehta commented 3 years ago

@JMankewitz @vmarchman Excellent - does that mean I should move this to production tomorrow morning, which will let me look at the issues Canada and Holland have raised?

vmarchman commented 3 years ago

@HenryMehta sorry - we just added a few more things that need to be done before we move to production.