---
title: Send lead source data to Salesforce
description: "**Prerequisite:**🔗[Add the Leadsources script to your website](https://help.leadsources.io/docs/add-leadsources-code/) 🔗[Add hidden fields to your form](https://help.leadsources.io/docs/add-hidden-fields/) We collect leads and their source information (channel, source, campaign, term, content, landing page, and subfolder) using our form. Our goal is to **send this data to…"
url: "https://help.leadsources.io/docs/salesforce/"
updated: "2024-12-05"
category: Connect CRM
---

# Send lead source data to Salesforce

**Prerequisite:**🔗[Add the Leadsources script to your website](https://help.leadsources.io/docs/add-leadsources-code/)
🔗[Add hidden fields to your form](https://help.leadsources.io/docs/add-hidden-fields/)

We collect leads and their source information (channel, source, campaign, term, content, landing page, and subfolder) using our form.

Our goal is to **send this data to Salesforce**, so we can **track which leads turn into customers**and identify the channels, sources, campaigns, etc. driving sales.

This allows you to **focus your marketing budget** on what works and eliminate what doesn’t.

We are going to use **Zapier**to send your leads and their source data to **Salesforce**.

The process has 4 steps:

1. **Create custom fields in Salesforce**to store the lead source data
2. **Display the custom fields in Salesforce**
3. **Set up Zapier**to send new leads (and their source data) from your form to Salesforce
4. **Test the automation**

## Step 1: Create the custom fields in Salesforce

**What is a custom field in Salesforce?**
To store lead source data for each lead in Salesforce, we need to create custom fields. In Salesforce, custom fields are used to store details about your leads (address, name, company, etc.).

By creating new custom fields, we will allow Salesforce to store the lead source data for each lead: channel, source, campaign, term, content, landing page, and landing page subfolder.

**Log in**your Salesforce account --> Click the **Leads**tab --> Open any lead.

![](http://help.leadsources.io/wp-content/uploads/2024/12/Send-lead-source-data-to-Salesforce-1-and-9.webp)

On the top right corner, click the **Setup gear icon** --> Click **Edit Object**.

![](http://help.leadsources.io/wp-content/uploads/2024/12/Send-lead-source-data-to-Salesforce-2.webp)

From the left panel, select **Fields & Relationships**. On the main panel, click **New**.

![](http://help.leadsources.io/wp-content/uploads/2024/12/Send-lead-source-data-to-Salesforce-3.webp)

The **New Custom Field** window opens. Let's create the Channel custom field:

Scroll down and check the **Text** radio button --> Click **Next**

![](http://help.leadsources.io/wp-content/uploads/2024/12/Send-lead-source-data-to-Salesforce-5.webp)

Enter the details:

- Field Label=**Channel**
- Length=**255**
- Field name=**Channel**
- Leave the rest as it is, click **Next**

![](http://help.leadsources.io/wp-content/uploads/2024/12/Send-lead-source-data-to-Salesforce-6-1024x657.webp)

Select the profiles to which you want to grant edit access to this field --> Click **Next**

![](http://help.leadsources.io/wp-content/uploads/2024/12/Send-lead-source-data-to-Salesforce-7-1024x657.webp)

Make sure the **Lead Layout**is checked --> Click **Save & New**

![](http://help.leadsources.io/wp-content/uploads/2024/12/Send-lead-source-data-to-Salesforce-8-1024x657.webp)

You have now created the Channel field. Use the same process to create the rest of the fields below:

| **Data Type** | **Field Label** | **Length** |
| --- | --- | --- |
| Text | Source | 255 |
| Text | Campaign | 255 |
| Text | Term | 255 |
| Text | Content | 255 |
| Text | Landing page | 255 |
| Text | Landing page subfolder | 255 |

You have now created all the custom fields that will store the lead source data.

Now we want to display them from the **Lead** view.

## Step 2: Display the custom fields in Salesforce

To make the new fields visible from a Lead view, let's go through the following steps.

Head back to the homepage --> **Leads** --> Open any lead

![](http://help.leadsources.io/wp-content/uploads/2024/12/Send-lead-source-data-to-Salesforce-1-and-9.webp)

Click the **Setup gear icon** --> **Edit Page**.

![](http://help.leadsources.io/wp-content/uploads/2024/12/Send-lead-source-data-to-Salesforce-10.webp)

We will display the custom fields in the Highlights Panel.

Select the **Highlights Panel**. From the right panel, click **Leads Custom Compact Layout (previewed)**.

![](http://help.leadsources.io/wp-content/uploads/2024/12/Send-lead-source-data-to-Salesforce-112-1024x657.webp)

The **Lead Compact Layouts**page opens --> Click **Edit**.

![](http://help.leadsources.io/wp-content/uploads/2024/12/Send-lead-source-data-to-Salesforce-12-1024x657.webp)

In the **Select Compact Layout Fields**section, select the custom fields you want to display --> Click the **Add** arrow.

![](http://help.leadsources.io/wp-content/uploads/2024/12/Send-lead-source-data-to-Salesforce-13-1024x657.webp)

Repeat until you have added all the following fields:

- Channel
- Source
- Campaign
- Term
- Content
- Landing page
- Landing page subfolder

Click **Save**.

![](http://help.leadsources.io/wp-content/uploads/2024/12/Send-lead-source-data-to-Salesforce-14-1024x657.webp)

Head back to the homepage --> **Leads** --> Open a lead.

From the **Highlights Panel**, click **Edit**.

![](http://help.leadsources.io/wp-content/uploads/2024/12/Send-lead-source-data-to-Salesforce-15.webp)

Scroll down until you find the custom fields displayed.

![](http://help.leadsources.io/wp-content/uploads/2024/12/Send-lead-source-data-to-Salesforce-16-1024x657.webp)

The fields are currently empty. To populate them with the lead source data that Leadsources captured in your form, we are going to connect your form with Salesforce in the next step.

## Step 3: Send lead source data using Zapier

Zapier is a workflow automation tool that connects different apps. In our case, we’ll create this workflow:

**When a lead is captured in our form ➡️ Create Lead in Salesforce**

**Note**: This workflow sends your new leads to Salesforce. If you're already sending leads to Salesforce, make sure this method doesn't create duplicates. Adjust the guide as needed to fit your process.

Sign up to **Zapier.com** (it’s free).

Create a new **Zap**.

![](http://help.leadsources.io/wp-content/uploads/2024/11/Monday-CRM-7-1024x461.webp)

The **Zap editor** opens.

![](http://help.leadsources.io/wp-content/uploads/2024/11/Send-lead-source-to-Pipedrive-8.webp)

Click in the **Trigger** box.

Our trigger will be: a new lead is created in our form builder.

In our case, we use **Typeform **to collect leads. But you can connect another form builder.

Search for your form builder in the search bar. Select it.

![](http://help.leadsources.io/wp-content/uploads/2024/11/Send-lead-source-to-Pipedrive-9.webp)

Set the **Trigger event **as “New entry” – wording can vary.

Under **Account**, link your form builder account with Zapier.

![](http://help.leadsources.io/wp-content/uploads/2024/11/Send-lead-source-to-Pipedrive-24.webp)

Click **Continue**.

Under **Form**, select the form you want to connect.

![](http://help.leadsources.io/wp-content/uploads/2024/11/Send-lead-source-to-Pipedrive-10.webp)

Click **Continue** –> Click **Test Trigger** –> Click **Continue with selected record**.

The pop-up for the **Action** box opens.

Here we are going to define the **Action event** you want to occur on Salesforce when a new lead is generated in our form builder.

In our case, we want to *Create Lead*on Salesforce. Let’s go through the steps:

Search for **Salesforce**. Select it.

![](http://help.leadsources.io/wp-content/uploads/2024/12/Send-lead-source-data-to-Salesforce-17.webp)

Under **Action event**, select **Create Lead**.

![](http://help.leadsources.io/wp-content/uploads/2024/12/Send-lead-source-data-to-Salesforce-18-1024x657.webp)

Under **Account**, connect your Salesforce account with Zapier.

Click **Continue**, the **Configure**section opens.

![](http://help.leadsources.io/wp-content/uploads/2024/12/Send-lead-source-data-to-Salesforce-19.webp)

Here, we want to **map the fields between our form builder and Salesforce**. Feel free to map the data you want to send to Salesforce by clicking the **+** symbol next to each field.

Scroll down the **Configure**section until you find the custom fields we just created: channel, source, campaign, term, content, landing page, landing page subfolder.

Let’s map the **Channel** field:

1. In the **Configure**section, identify the **Channel**field
2. Click the **+** icon
3. Select the **Channel**hidden field from your form

![](http://help.leadsources.io/wp-content/uploads/2024/12/Send-lead-source-data-to-Salesforce-20-1024x657.webp)

Let's use the same process to **map the rest of the fields**(from Salesforce) with their associated hidden fields (from your form builder):

- Source
- Campaign
- Term
- Content
- Landing page
- Landing page subfolder

![](http://help.leadsources.io/wp-content/uploads/2024/12/Send-lead-source-data-to-Salesforce-21.webp)

Click **Continue**. You enter in the **Test **step. Click **Test step**.

If the test is successful, a green check is added next to the **Test **title.

Click **Publish**.

You are all set!

## Step 4: Test the automation

To test the automation:

1. Empty the cache of your browser
2. Visit your website from the channel of your choice. You can use this link to emulate a Google Ads click:

> 🔗 *https://yoursite.com/landing-page***?gclid=123456789&wc_clear=true&UTM_source=Google+Ads&UTM_campaign=Your+Campaign+Name&UTM_term=Keyword+Clicked&UTM_content=Ad+Name**
>
> ➡️ Replace the italic URL with your landing page URL

Fill out your form and submit it.

Head back to Salesforce –> **Leads**page.

If the automation was successful, you will see your new lead. Open it.

![](http://help.leadsources.io/wp-content/uploads/2024/12/Send-lead-source-data-to-Salesforce-22.webp)

In the **Highlights Panel**, click **Edit**.

![](http://help.leadsources.io/wp-content/uploads/2024/12/Send-lead-source-data-to-Salesforce-23.webp)

Scroll down until you find the 7 **custom fields**: channel, source, campaign, term, content, landing page, and landing page subfolder.

![](http://help.leadsources.io/wp-content/uploads/2024/12/Send-lead-source-data-to-Salesforce-24.webp)

The fields have been filled out with the lead source data captured by Leadsources (channel, source, campaign, term, content, landing page, and landing page subfolder).

You can now **track the source of each lead directly in Salesforce**.

When a lead turns into a customer, you can**link this customer** back to the channel, source, campaign, etc., that generated it.

This allows you to **adjust your marketing activities** to focus on the channels, sources, campaigns, etc., that drive sales.
