Articles on: Collecting Reviews & Feedback

Survey answer segmentation with parameters

About Survey Parameters



Survey parameters are used to segment answers from certain sources when using the direct link sharing method. This way you can "mark" answers with important data such as a customer segment, area, or webpage.

What can a parameter contain?



The segment parameters can contain only URL safe characters, such as numbers (0–9), characters (a–z) and the special characters "-" and "_". The best practice for naming the segments is to use IDs from your systems.

Adding parameters to a survey URL



You can create a custom URL by adding ?p[number]=[name] as the query parameter at the end of the URL.

For example, if you would like to have a segment called "test" you could add ?p1=test after the survey URL, resulting in an URL that looks something like this:

https://trustmary.com/form/mCJKkwlKK?p1=test


You can get the base URL for you survey by opening a survey, selecting Direct link sharing in the top right, and copying the URL address from there.

Adding parameters in an embedded survey



You can also use parameters to create segments for an embedded survey. This can be useful if for example you need to track responses from a certain site, such as a blog post.

Start by selecting Embed on website as the sharing type in your survey, and copying the embed code by clicking the Copy code button.


Adding parameters to the code is done similarly to adding parameters to the URL.

The basic structure of the parameter is:

data-p1=xxxx


where "data-p" indicates the parameter, and the number after the "p" differentiates the parameters from each other. The part marked with x's is where you would place the name of the parameter. Note that the name needs to be in quotes.

Once you have your parameter, paste it into the embed code in between the last quote mark and the following larger than sign.

The result should look something like this:

<script src="https://widget.trustmary.com/3ZcIZtU456" data-p1=Helsinki data-p2=Test></script>


You can add as many parameters to the code as you like.

Parameters in results



You can see the parameter of each answer in the survey's Results in the rightmost columns of the table, as shown on the image below.


The answers can also be filtered in reports with these parameters. Reviews connected to these answers can be filtered in widgets with the parameters, by using Advanced filtering in the widget settings.

Updated on: 13/03/2025

Was this article helpful?

Share your feedback

Cancel

Thank you!