# Set up SourceTag with Zoho CRM Webforms

Canonical: https://sourcetag.io/docs/fields-zoho-webforms

Zoho CRM Webforms are generated from within Zoho CRM. You create custom fields on the CRM module (Leads or Contacts) first, then build a webform that includes those fields as hidden inputs.

## What you need

- SourceTag installed on your website
- Zoho CRM account with access to custom fields and webforms
- Admin or customisation permissions in Zoho CRM

## Step 1: Create custom fields in Zoho CRM

1. In Zoho CRM, go to **Setup > Customisation > Modules and Fields**
2. Choose the module your webform targets (usually **Leads** or **Contacts**)
3. Click **Layouts** and edit the layout
4. Drag a **Single Line** field onto the layout for each SourceTag field
5. Set the **Field Label** to the SourceTag field name (e.g. `st_fc_channel`)
6. Save the layout


### 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: Create or edit a webform

1. Go to **Setup > Developer Space > Webforms** (or **Setup > Channels > Webforms**)
2. Click **Create Webform** (or edit an existing one)
3. Choose the module (Leads or Contacts)
4. The webform builder opens
## Step 3: Add fields and set them as hidden

1. From the field panel on the left, drag the custom fields you created onto the webform
2. For each SourceTag field, click on it in the webform builder
3. In the field properties, tick **Hidden** or set the visibility to **Hidden**
4. Make sure the **Field Name** (the HTML name attribute) matches the SourceTag field name

Zoho generates a field name based on the CRM field's API name. Check that this matches the SourceTag field name. If Zoho adds a prefix or modifies the name, you may need to adjust it in the generated HTML after embedding.


## Step 4: Generate and embed the webform

1. In the webform builder, click **Save** and then **Generate Code** (or **Embed**)
2. Copy the HTML embed code
3. Paste it onto your website page

The page must also have the SourceTag script installed.
## Step 5: Verify field names in the HTML

Before testing, check the generated HTML to make sure the hidden input `name` attributes match the SourceTag field names:

1. Open the page in your browser
2. Right-click on the form area and choose **Inspect**
3. Find the hidden input elements
4. Check that each `name` attribute matches (e.g. `name="st_fc_channel"`)

If Zoho has modified the names (e.g. added a prefix like `LEADCF1`), you have two options:
- Edit the generated HTML manually to use the correct names
- Or set up a Zoho custom function to map the submitted field names
## Step 6: Test

Visit the page with UTM parameters:

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

Submit the form. In Zoho CRM, go to the **Leads** (or **Contacts**) module and find the test record. Check the custom fields. They should contain your attribution data.
## Tips

- Zoho CRM field API names can differ from the display label. Check **Setup > Developer Space > APIs** to see the exact API names for your custom fields.
- If you are using Zoho Forms (the standalone form builder) instead of Zoho CRM Webforms, the process is slightly different. Zoho Forms has its own hidden field type in the form builder.
- Attribution data in Zoho CRM custom fields is available for reports, workflows, and blueprints. You can create CRM reports that group leads by first-click channel.
- If you regenerate the webform, you will need to re-check the field names in the HTML.
