# Set up SourceTag with Wufoo

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

Wufoo (by SurveyMonkey) supports hidden fields that SourceTag can populate with attribution data. You add the hidden fields in Wufoo's form builder, then embed the form on your site using the JavaScript embed method.

## What you need

- SourceTag installed on your website
- A Wufoo account
- A plan for getting data into the form (see embed limitations below)

## Step 1: Open your form in the Wufoo form builder

Log in to Wufoo and click **Edit** on the form you want to track. This opens the drag-and-drop form builder.
## Step 2: Add hidden fields

Wufoo does not have a dedicated hidden field type in the builder palette. Instead, you use a **Single Line Text** field and hide it with CSS, or you use the **Add Hidden Values** option in the form settings.

### Option A: Use the "Add Hidden Values" setting (recommended)

1. In the form builder, click the **Form Settings** tab (or gear icon)
2. Scroll to **Hidden Field Values** or **Custom Hidden Fields**
3. Add a new hidden field for each SourceTag data point
4. Set the field name to match the SourceTag field name exactly

### Option B: Use a Single Line Text field with CSS

1. Drag a **Single Line Text** field onto your form
2. Set the field label to the SourceTag field name
3. After embedding the form, use custom CSS to hide the field (`display: none`)

Option A is cleaner if your Wufoo plan supports it. Option B works on all plans.


### Core fields (add these)

- `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 API name

For each hidden field, make sure the underlying field name (the one used in the HTML `name` attribute) matches the SourceTag field name exactly. In Wufoo, the API label or field alias controls this.

1. Click on the field in the builder
2. Find the **API Label** or **Field Alias** setting in the field properties
3. Set it to the SourceTag field name (e.g. `st_fc_channel`)
4. Leave the default value empty

If Wufoo assigns its own internal name (like `Field1`, `Field2`), you may need to edit the embed code after generating it. See the tips section below.


## Step 4: Understand the embed limitation

Both of Wufoo's embed methods (iframe and JavaScript) render the form inside a cross-origin iframe hosted on Wufoo's domain. This means SourceTag cannot access the form fields directly in either case.

To pass attribution data into Wufoo, use one of these approaches instead:

### Option A: Use Wufoo's webhook or API (recommended)

1. Set up a Wufoo **webhook** notification or use the Wufoo API
2. On your site, build a custom HTML form with SourceTag hidden fields
3. When the form is submitted, send the data to Wufoo's API endpoint (`https://SUBDOMAIN.wufoo.com/api/v3/forms/FORM_HASH/entries.json`)
4. SourceTag populates the hidden fields on your page, and your submission handler forwards everything to Wufoo

### Option B: Build a custom HTML form that posts to Wufoo's API

```html
<form action="https://YOUR_SUBDOMAIN.wufoo.com/api/v3/forms/YOUR_FORM_HASH/entries.json" method="POST" id="wufoo-form">
  <!-- Visible fields -->
  <label for="name">Name</label>
  <input type="text" name="Field1" id="name" required>

  <label for="email">Email</label>
  <input type="email" name="Field2" id="email" required>

  <!-- SourceTag hidden fields -->
  <input type="hidden" name="Field10" value="">
  <input type="hidden" name="Field11" value="">
  <!-- Map Wufoo's internal field names to your SourceTag fields -->

  <button type="submit">Send</button>
</form>
```

Use Wufoo's API field names (`Field1`, `Field2`, etc.) in the `name` attributes. You will need to add a `data-st-field` attribute to each hidden field so SourceTag can find it. For example, `<input type="hidden" name="Field10" data-st-field="st_fc_channel" value="">` tells SourceTag to populate `Field10` with the first click channel value.
## Step 5: Test

Visit the page with UTM parameters:

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

Submit the form. In Wufoo, go to **Entries** and check the test submission. The hidden fields should contain your attribution data.
## Tips

- Wufoo uses internal field names (like `Field1`, `Field2`) by default. If you cannot change the API label to match SourceTag's field names, add a `data-st-field` attribute to each hidden field instead. For example: `<input type="hidden" name="Field10" data-st-field="st_fc_channel" value="">`. SourceTag looks for `data-st-field` as one of its field matching methods.
- Field names are case-sensitive. Copy them from the Fields page in your SourceTag dashboard.
- Wufoo integrations (email notifications, webhooks, Zapier, etc.) include hidden field values in the submission data.
- If hidden fields come through empty, make sure you are using a custom HTML form on your own page rather than a Wufoo embed. Both Wufoo embed methods use cross-origin iframes, so SourceTag cannot populate fields inside them.
