# Set up SourceTag with Pardot Forms

Canonical: https://sourcetag.io/docs/fields-pardot-forms

Pardot (now part of Salesforce Marketing Cloud Account Engagement) requires you to create custom prospect fields first, then add them as hidden fields in the form builder. The key is making sure the **External Field Name** matches the SourceTag field name.

## What you need

- SourceTag installed on your website (where the Pardot form is embedded)
- A Pardot account with access to custom fields and forms
- Salesforce admin access (if custom fields need to sync to Salesforce)

## Step 1: Create custom prospect fields in Pardot

1. In Pardot, go to **Admin > Object and Field Configuration > Prospect Fields** (or in Account Engagement: **Setup > Object and Field Configuration > Prospect Fields**)
2. Click **Add Custom Field**
3. For each SourceTag field:
   - Set the **Field Label** to a descriptive name (e.g. "ST First Click Channel")
   - Set the **External Field Name** to the SourceTag field name exactly (e.g. `st_fc_channel`)
   - Set the **Field Type** to **Text**
   - Optionally set the **Custom Field ID** if you want to control the API name
4. Save

The **External Field Name** is the critical setting. This is what Pardot uses in the form HTML, and it is what SourceTag looks for.


### Core fields (create these)

| Field Label | External Field Name |
|---|---|
| ST First Click Channel | `st_fc_channel` |
| ST First Click Detail 1 | `st_fc_detail_1` |
| ST First Click Detail 2 | `st_fc_detail_2` |
| ST First Click Detail 3 | `st_fc_detail_3` |
| ST First Click Detail 4 | `st_fc_detail_4` |
| ST Last Click Channel | `st_lc_channel` |
| ST Last Click Detail 1 | `st_lc_detail_1` |
| ST Last Click Detail 2 | `st_lc_detail_2` |
| ST Last Click Detail 3 | `st_lc_detail_3` |
| ST Last Click Detail 4 | `st_lc_detail_4` |
| ST First Click Landing | `st_fc_landing_page` |
| ST Last Click Landing | `st_lc_landing_page` |

### Optional extended fields

| Field Label | External Field Name |
|---|---|
| ST First Click ID | `st_fc_click_id` |
| ST Last Click ID | `st_lc_click_id` |
| ST Visits | `st_visits` |
| ST Days to Convert | `st_days_to_convert` |
| ST Device | `st_device` |

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

## Step 2: Add hidden fields to your Pardot form

1. Go to **Marketing > Forms** (or **Content > Forms**)
2. Edit your form (or create a new one)
3. In the form builder, go to the **Fields** step
4. Click **Add Field** and select one of the custom prospect fields you created
5. In the field settings, set **Type** to **Hidden** (or tick the **Hidden** checkbox)
6. Repeat for all SourceTag fields


## Step 3: Verify the External Field Name

For each hidden field in the form:

1. Click on the field
2. Check that the **External Field Name** matches the SourceTag field name exactly
3. Pardot uses this as the HTML `name` attribute in the rendered form

If Pardot has modified the external field name (added a prefix or changed case), update it to match.


## Step 4: Embed the form

Pardot forms can be embedded on your site using the iframe embed code or the form handler URL:

1. In the form builder, go to the final step and copy the embed code
2. Paste it onto your website page

The iframe embed is the hardest method for hidden field population because Pardot iframes are almost always cross-origin, which means SourceTag cannot access the fields inside them. For best results, use a **Pardot form handler** with a custom HTML form on your site. Build a standard HTML form with SourceTag hidden fields and set the form's `action` URL to your Pardot form handler endpoint. This gives SourceTag full access to populate the hidden fields before submission.

Alternatively, use a **Pardot Landing Page** with the form, and install SourceTag on the landing page's template.
## Step 5: Test

Visit the page with UTM parameters:

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

Submit the form. In Pardot, go to **Prospects** and find the test record. Check the custom fields. They should contain your attribution data.

If you have Pardot-to-Salesforce sync enabled, the data will also flow to the corresponding Lead or Contact fields in Salesforce.
## Tips

- The External Field Name is the most important setting. Double-check it for every field.
- If you want the data to sync to Salesforce, create matching custom fields on the Lead and Contact objects in Salesforce, then map them in Pardot's field sync settings.
- Pardot form handlers are an alternative to embedded forms. If you use a form handler, your front-end form needs the hidden inputs with names matching the External Field Names.
- Pardot's completion actions can trigger automations based on form submissions. The attribution data is available for segmentation rules and automation logic.
