# Integrating OptiMonk campaigns with Marketo

Canonical URL: https://support.optimonk.com/en/articles/integrating-optimonk-campaigns-with-marketo

Integrating [Marketo](http://www.marketo.com) with OptiMonk lets you gather leads with your popups and work with them in Marketo — so everyone who signs up through OptiMonk also gets your upcoming promotions and news.

**Where this is set up.** Marketo is not offered in the new campaign builder's provider list, so the account connection is made **once in the classic admin**. After that the connection is available to your campaigns here as well, under *Your connected accounts*.

**Before you start:** you need a campaign whose popup is already built (the field mapping is read from the input fields of your popup) and a Marketo account with REST API access.

---

## Step 1 — Enable API calls in Marketo and collect the credentials

Log in to your Marketo account in another tab and follow their [quick start guide for the REST API](http://developers.marketo.com/blog/quick-start-guide-for-marketo-rest-api/). You need three values from it.

**Host URL** — click **Admin**, then select **Integration → Web Services** in the left menu, and copy the **HOST URL** from the **REST API** box.

*Please note: remove the **`/rest`** part of the URL — e.g. **`https://123-ABC-456.mktorest.com`**.*

**Client ID and Client Secret** — select **Integration → LaunchPoint**. You see the list of services you have created; select the service you created and click **View details** to reveal the **Client ID** and the **Client Secret**.

---

## Step 2 — Connect the Marketo account in the classic admin

1. In OptiMonk, click your name at the bottom of the left-hand menu and choose **Go to classic admin**. You are signed in there with the same account.
2. Open the campaign you want to use and click **Edit settings**.
3. Click **Add new integration** under **Add integration**.
4. Select **Marketo** from the list of available integrations.
5. Paste the **Host URL**, the **Client ID** and the **Client Secret** into the matching fields, then save the integration.

*Optional:* you can add the subscribers you gather with OptiMonk to a specific list in Marketo. When you don't choose a list, leads are simply added to your general lead database, or to a Smart List you have set up in Marketo.

---

## Step 3 — Use the connection on a campaign built in the new app

Once the account is connected, it belongs to your OptiMonk account — not to one campaign — so you can attach it to campaigns you build here:

1. Open **Campaigns** in the left menu and click your campaign.
2. Open the **Integrations** tab and click **Add integration**.
3. In the **Provider** step, look under **Your connected accounts** — your Marketo connection is listed there. Click it. (Marketo is not in the provider grid below; that grid only holds providers you can connect from here.)
4. Pick the destination in Marketo, then click **Continue**.
5. In the **Field mapping** step, decide where each popup field goes (see below) and click **Save integration**.

**Draft vs. live:** if the campaign has not been published yet, the integration shows a **Draft** pill and the note *Saved as draft — it goes live when you publish the campaign.* On a published campaign it 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 **Marketo field** on the right — the field identifiers from your Marketo account. OptiMonk pre-fills the mapping with its own suggestions.

- The **email** field is fixed.
- Pick **Don't sync** for any popup field you don't want to send.
- If Marketo does not return a selectable field list, the right-hand side is a text box: *Type the exact Marketo field or property name (e.g. first_name). Leave empty to skip a field.*

To forward a piece of data that isn't on the left, the popup has to collect it first: ask the agent in the design chat to add the field, let the popup rebuild, then reopen **Integrations → Edit mapping**.

---

## Check that leads actually arrive

Open **Leads** in the left menu. Every submission has a **Sync status** column: **Synced** means the lead reached Marketo; **Integration issue** means the forwarding failed. Click the row for the reason (*Incorrect API key*, *Invalid list*, *Field mapping issue*, *Account issue*…) and press **Retry** once you have fixed the settings.
