# Set up SourceTag with Paperform

Canonical: https://sourcetag.io/docs/fields-paperform

Paperform supports hidden fields and URL-based prefills. You add hidden fields in the form editor, then embed the form on your site. SourceTag detects the embedded form and populates the fields with attribution data.

## What you need

- SourceTag installed on your website
- A Paperform account
- The form embedded on your site (not using the hosted Paperform URL)

## Step 1: Open your form in the Paperform editor

Log in to Paperform and open your form in the editor.
## Step 2: Add hidden fields

1. In the form editor, click the **+** button to add a new field
2. Choose **Hidden** from the field type list
3. Give it a name that matches the SourceTag field name (e.g. `st_fc_channel`)
4. Repeat for each SourceTag field

In Paperform, hidden fields do not appear to visitors. They only show up in the editor and in submission data.


### Core fields (add these)

Add a hidden field for each of the following:

- `st_fc_channel`
- `st_fc_detail_1`
- `st_fc_detail_2`
- `st_fc_detail_3`
- `st_fc_detail_4`
- `st_lc_channel`
- `st_lc_detail_1`
- `st_lc_detail_2`
- `st_lc_detail_3`
- `st_lc_detail_4`
- `st_fc_landing_page`
- `st_lc_landing_page`

### Optional extended fields

If you have enabled extended field groups in your SourceTag dashboard, also add:

- `st_fc_click_id` and `st_lc_click_id` (click IDs)
- `st_visits` (visit count)
- `st_days_to_convert` (days since first visit)
- `st_device` (device type)

See [Captured Fields](https://sourcetag.io/docs/captured-fields) for the full list of available fields.

## Step 3: Set the field key

For each hidden field:

1. Click on the hidden field
2. In the field settings, find the **Custom Key** or **Field Key** setting
3. Set it to the SourceTag field name exactly (e.g. `st_fc_channel`)
4. Leave the prefill/default value empty

The custom key controls the HTML `name` attribute when the form is rendered. This is what SourceTag uses to find the field.


## Step 4: Embed on your site

1. In Paperform, go to **Share** > **Embed**
2. Choose the **Standard embed** (JavaScript embed) option
3. Copy the embed code and paste it onto your page

```html
<!-- Your site already has SourceTag -->
<script src="https://cdn.sourcetag.io/scripts/YOUR_ID/st.js"></script>

<!-- Paperform embed -->
<div data-paperform-id="YOUR_FORM_SLUG"></div>
<script>(function() { var script = document.createElement('script'); script.src = "https://paperform.co/__embed.min.js"; document.body.appendChild(script); })()</script>
```

The page must have the SourceTag script installed. If you use a direct link to the Paperform hosted URL, SourceTag will not be able to populate the fields.
## Step 5: Test

Visit the page with UTM parameters:

```text
?utm_source=test&utm_medium=cpc&utm_campaign=paperform-test
```

Submit the form. In Paperform, go to **Submissions** and check the test entry. The hidden fields should contain your attribution data.
## Tips

- Custom keys in Paperform are case-sensitive. Copy the field names from the Fields page in your SourceTag dashboard.
- Paperform's integrations (Zapier, webhooks, Google Sheets, etc.) include hidden field values in the submission data.
- If your form has calculation or conditional logic fields, hidden fields work independently of those and will not interfere.
- If hidden fields come through empty, check that your form is embedded using the standard embed (not an iframe) and that the custom key matches the SourceTag field name exactly.
