# Salesforce Integration

Canonical URL: https://support.optimonk.com/en/articles/salesforce-integration

# Salesforce Integration

Salesforce is one of the most popular CRM systems, and it takes only a few steps to forward your subscribers' data from OptiMonk to your Salesforce account. You authorize OptiMonk once, choose whether new signups become **Contacts** or **Leads**, and map your popup fields onto Salesforce fields.

**Before you start:** you need a campaign in OptiMonk (the popup has to be built, because the field mapping is read from the input fields of your popup) and a Salesforce account you can authorize.

---

## Connect Salesforce to your campaign

1. Open **Campaigns** in the left menu and click the campaign you want to set up.
2. Open the **Integrations** tab of the campaign.
3. Click **Add integration**. If this is your first one, the same step is offered as *Connect your email or SMS tool*.
4. **Provider** step: pick **Salesforce** from the provider list. If the list is long, type into the *Search providers…* box. Accounts you have already connected are listed at the top, under *Your connected accounts* — pick one of those and you skip straight to the settings.
5. **Account** step: Salesforce is connected with OAuth, so there is no credential form — just the button **Continue with Salesforce**. *You'll be redirected to Salesforce to authorize OptiMonk, then brought back here to finish the setup.*

- If you are not logged in, Salesforce asks you to log in first.
- Then Salesforce asks you to authorize the integration — click **Allow** to continue.
6. **Settings** step: choose the **Object type** your new signups should be created as — **Contact** or **Lead**. Click **Continue**.
7. **Field mapping** step: match the input fields of your popup with the field identifiers in your Salesforce account (see below), then click **Save integration**.

That's it. Whenever a visitor signs up through your popup, the record is created in Salesforce.

**Draft vs. live:** if the campaign has not been published yet, the integration is shown with a **Draft** pill and the note *Saved as draft — it goes live when you publish the campaign.* On a published campaign the integration is applied right away and shows as **Active**.

---

## Field mapping

The mapping table has two columns: **Popup field** on the left (every input your popup collects) and **Salesforce field** on the right — the fields of the object type you selected. OptiMonk pre-fills the mapping with its own suggestions, so in most cases you only need to check it.

- The **email** field is fixed — it always maps to Salesforce's `email`.
- Pick **Don't sync** for any popup field you don't want to send.
- Under **Static fields** you can send a fixed value with every submission (for example a lead source or a campaign name). Click **Add static field**, type the value on the left, and choose the Salesforce field on the right.

Only the input fields that are actually on your popup appear on the left. If you want to collect something new — a company name, a phone number, a dropdown — describe it to the AI on the popup (for example *"add a company field under the email input"*) and it rebuilds the popup with that field. Then come back to the Integrations tab and click **Edit mapping**.

---

## Change or remove the integration

The Integrations tab lists every integration on the campaign.

- **Change list** / **Edit mapping** reopens the wizard at that step — this is also how you switch between **Contact** and **Lead**.
- **Remove** takes the integration off this campaign: *Remove from this campaign? The account connection stays and can be added again.* Your Salesforce authorization is not revoked, so you can reuse it on another campaign.

---

## What about the web-to-lead JavaScript?

The older version of this article described a second option: pasting an `OptiMonk.Integration.Salesforce.webToLead()` snippet into the campaign's JS editor in Dev mode. That option is not available in the new OptiMonk app — popups built here have no custom JavaScript or CSS, and there is no Dev mode or JS editor. Use the direct integration above; it covers the same job (creating a Lead) through the **Object type → Lead** setting.
