What are Query string parameters?
On the internet, a Query string is the part of a link (otherwise known as a hyperlink or a uniform resource locator, URL for short) which assigns values to specified attributes (known as keys or parameters).
Typical link containing a query string is as follows:
http://example.com/over/there?name=ferret
In the above example the question mark separates the base URL from the Query strings.
Each Query string is made up from a parameter and a value that are joined together using an equals sign (=).
Multiple Query strings are joined together using an ampersand (&).
Query strings allow information to be sent to a webpage in a way that can be easily ingested and used within the webpage.
Integrating Query strings with your Activity
Positly can both send and receive Query strings when integrating with your Activity.
Receiving Participant attributes from Positly
When a Participant is taking part in your study Positly will send participant attributes such as their unique identifiers (e.g. Assignment ID) and Demographics (e.g. Gender) through to your Activity using Query strings.
For example, if your Activity link was http://example.com/mystudy then Positly would append the key and value for the Assignment ID through like this:
http://example.com/mystudy?assignmentID=abc123
Then Positly would continue to dynamically add Participant data using the same format, separated by ampersand symbols, for example:
http://example.com/mystudy?assignmentID=abc123&participantID=xyz987
To learn more read:
- How to integrate Query strings with your study software
- How to customise URL query string attribute names
- Attribute names for unique participant attributes (e.g. identifiers and pre-screened demographics)
Sending Custom attributes to Positly from your Activity
Positly can also dynamically receive Custom attributes for Participants using query strings appended to the Completion link.
For example, you could set a Custom attribute “favouriteColor” as “blue” by adding &favouriteColor=blue to the Completion link.
Here is an example:
https://app.positly.com/#/f?task_id=ID&favouriteColor=blue
A few things to note:
- Parameter names cannot have spaces in them
- Parameter names cannot contain special URL characters (e.g. space, ? or &)
- Parameter names and values can be text or numbers
- Values cannot contain special characters (e.g. space, ? or &) unless they are encoded