> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.trustmary.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# 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:

```javascript
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.

![](https://storage.crisp.chat/users/helpdesk/website/a783bd1afd605800/ae25cc7f-d453-451b-9cf6-2043a8_1bob494.png)
Adding parameters to the code is done similarly to adding parameters to the URL. 

The basic structure of the parameter is:

```javascript
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:

```javascript
<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. 

![](https://storage.crisp.chat/users/helpdesk/website/510fb8da43fd0c00/5dc5c143-8d1c-469a-8b1a-e74c00_ejl5vn.png)
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.