# Set up SourceTag with GoHighLevel Forms

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

GoHighLevel (GHL) has a form builder with hidden field support. You create custom fields in GHL first, then add them as hidden fields in the form builder and configure the field mapping.

## What you need

- SourceTag installed on your website or GHL funnel/website page
- A GoHighLevel account with access to custom fields and forms

## Step 1: Create custom contact fields in GHL

1. In GoHighLevel, go to **Settings > Custom Fields** (under the Contacts section)
2. Click **Add Field**
3. For each SourceTag field:
   - Set the **Field Name** to something descriptive (e.g. "ST First Click Channel")
   - Set the **Field Key** to the SourceTag field name (e.g. `st_fc_channel`)
   - Set the **Type** to **Single Line Text**
4. Save


### Core fields (create 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

- `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 2: Add hidden fields to your form

1. Go to **Sites > Forms** (or open the form from your funnel/website page)
2. Edit the form you want to track
3. In the form builder, add a new field element
4. Set the field type to **Hidden**
5. In the field settings, map it to the custom contact field you created (e.g. `st_fc_channel`)
6. Repeat for all SourceTag fields


## Step 3: Configure field mapping

GHL forms have a field mapping step that connects form fields to contact fields:

1. Click on the hidden field in the form builder
2. In the settings panel, find the **Custom Field** or **Map to Field** option
3. Select the corresponding custom contact field
4. Make sure the HTML field name matches the SourceTag field name

The field mapping ensures that when the form is submitted, the hidden field value is saved to the correct contact field in GHL.


## Step 4: Add SourceTag to the page

If you are using GHL's built-in website or funnel builder:

1. Go to the page settings or funnel step settings
2. Find the **Custom Code** or **Tracking Code** section
3. Add the SourceTag script tag in the **Head** section

If the form is embedded on an external website, make sure SourceTag is installed on that site.


## Step 5: Test

Visit the page with UTM parameters:

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

Submit the form. In GoHighLevel, go to **Contacts** and find the test contact. Check the custom fields. They should contain your attribution data.
## Tips

- GHL custom field keys are the important bit. Make sure they match the SourceTag field names exactly.
- Attribution data stored in GHL custom fields is available in workflows, automations, and reporting. You can trigger different workflows based on channel (e.g. route paid search leads differently from organic).
- If you are using GHL's funnel builder, add the hidden fields to each form step in the funnel.
- GHL's built-in form builder renders forms as standard HTML on the page, so SourceTag can detect and populate hidden fields directly.
