URL_Search_Params
URL_Search_Params is a system variable that holds every parameter present on the URL a participant's session started with, captured automatically as JSON. It exists for every study. Most researchers never need to touch it directly, since Labvanced already reads the parameters it recognizes (crowdsourcing ids, group, session, and so on) into their own dedicated variables.
Purpose
Crowdsourcing platforms and panels each send their own long list of URL parameters. Some are integral to how the integration works, like a participant id, and Labvanced already handles those directly. Others are more like supporting information, useful to record in some cases but without a dedicated variable of their own, such as a targeting criterion or an attempt id. URL_Search_Params is the catch-all for that second group: the entire set of parameters is captured automatically the moment the session starts, with nothing to configure, so a new integration just works.
The idea behind it is simplicity: rather than needing a dedicated variable for every parameter a platform might ever send, one variable holds all of them together. This keeps a new integration working without extra setup, and gives you a single place to check if a study ever needs a value nothing else already tracks.
The values themselves come from the crowdsourcing provider, not from Labvanced. Besample's tc, for instance, is created and sent by Besample; Labvanced only reads it off the link as part of URL_Search_Params.
How it's recorded
The full query string is read once, right when the session starts, and stored in the URL_Search_Params global variable from that point on. From there, it stays available for the rest of the experiment, the same as any other variable, ready to read whenever your study design needs it.
Internally, the value is stored as a JSON string of the form:
{"is_truncated": false, "params": {"type": "besample", "battempt": "3", "tc": "276", "tg": "f"}}
A repeated parameter name holds an array of its values. is_truncated is true only if the query string is unusually long, over 4096 characters. In that case, the parameters that would have pushed it past the limit are left out, and everything shorter is still recorded.
Excluded from the record are Labvanced's own experiment id, and each crowdsourcing platform's participant-identifying parameter, which is saved separately in Crowdsourcing_SubjId instead (for example PROLIFIC_PID for Prolific, bpid for Besample). A few further parameters are excluded for the same privacy reason without being stored anywhere else, such as Besample's bnum, a one-time code tied to a single respondent's completion payout.
How it's used
A Run JavaScript Action is how you pull one value out of URL_Search_Params and act on it. It's not strictly either/or with the simpler alternative: if you only need one specific, already-named value, a Get URL Parameter Action gets it with no JSON or code. Reach for URL_Search_Params when you want the complete picture of what was on the link kept on record, not just the one parameter you set out to extract, independent of whether every parameter's name is already known.
tc is Besample's own official parameter for the respondent's target country. Choose a trigger first, for example On Frame Start or a button click, whatever should kick off the read. Then use Run JavaScript to read tc out of URL_Search_Params and save it into a variable you create and fully control, for example Target_Country (create it first in the Variables tab):
var urlParams = JSON.parse(getValue("URL_Search_Params"));
setValue("Target_Country", urlParams.params.tc || ""); // ISO 3166-1 numeric country code, empty string if tc isn't on the link
The || "" matters: unlike Get URL Parameter, which defaults to an empty string automatically when a parameter is missing, a missing value here throws an error if you pass it straight into setValue with no fallback. Always fall back to a default when reading a parameter that might not be present.
From there, use Target_Country like any other variable. For example:
Trigger:
On Frame Start
Action:Requirement (If... Then)→ left sideVariable→Target_Country, comparisonequal, right sideConstant Value→276→ Then:Jump to Next Frame→ your country-specific task
See this method next to Get URL Parameter in a working example: Fetch Custom URL from Global Variable, a library study that reads the same URL parameter both ways so you can compare the results directly. Copy this URL to try it directly:
https://www.labvanced.com/player.html?id=88576&tc=276
If you have any questions, please contact us.
FAQ
Do I need to set anything up to use URL_Search_Params?
Can I select URL_Search_Params directly in the variable picker?
Will this ever include a participant's crowdsourcing id?
Further Reading
System Variables
What system variables are as a category, URL_Search_Params among them, and where the full reference table lives.
URL Parameters
The full reference of parameters Labvanced reads from a participation link, including how to build custom links.
Run JavaScript Action
How to read and set Labvanced variables with custom JavaScript, the mechanism behind the example above.
Get URL Parameter Action
The simpler alternative when you already know the exact parameter name you need, no JSON or code required.