# Integrating the OptiMonk campaigns with Webhook

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

The Webhook integration lets you connect OptiMonk to any system. We recommend it when OptiMonk has no direct integration with the tool you use, or when you want to send more data than a standard integration carries.

Please note that a webhook needs someone who can receive the data on your side — a page or an endpoint you control. If you don't have a developer, use Zapier instead: it does the same job without code.

**Before you start:** the popup has to be built, because the field mapping is read from the input fields of your popup.

---

## How does the Webhook integration work?

When a visitor completes a form in a popup that has a Webhook integration, OptiMonk sends the submission to the URL you gave, with the **POST** method.

The payload always carries:

- the visitor's **email address**, **first name**, **last name** and **phone number** — these are OptiMonk's four built-in lead fields;
- the **URL** the popup appeared on;
- the **campaign name** and **campaign ID**.

Everything else your popup collects — dropdowns, checkboxes and radio buttons, text areas, survey and feedback answers, country / city / postcode fields, a privacy-policy checkbox — travels as a **custom field**, under the identifier that field has in your OptiMonk account. You don't have to create those identifiers by hand: when the popup is built, OptiMonk adds every new field of yours to the account's field catalog automatically, and the same identifier is what you map in the wizard and see in the payload.

**Please note:**

- With a webhook there is no extra tagging to do — the simplest approach is to name the field in OptiMonk exactly as your own system expects it.
- A webhook cannot handle delayed sending. If you collect an email address on one step of a multi-step popup and a phone number on a later one, OptiMonk reports an integration error even though the data does arrive. Keep the email and phone inputs on the same step to avoid it.
- A multi-step popup produces one call per step, so you will see several entries for a single visitor — a coupon code shown on step 3, for example, arrives in the third one.

---

## Set up the Webhook integration

1. Open **Campaigns** in the left menu and click the campaign you want to connect.
2. Open the **Integrations** tab.
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 **Webhook** — it sits in the **Popular** row. If the list is long, type into the *Search providers…* box.
5. **Account** step: click **Connect a new account** and enter the URL that should receive the data. The form tells you what it is for: *The data (firstname, lastname, e-mail address) will be sent to this URL.* You can also name the connection in **Name (optional)** so you recognise it later. Click **Connect**.

If you have set up a webhook before, that connection is offered here — pick it to reuse the same URL.
6. **Field mapping** step: say what each popup field should be called on your side, then 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 **Webhook field** on the right.

A webhook takes any name, so the right column is a free-text box, and the hint under the table says so: *Type the exact Webhook field or property name (e.g. first_name). Leave empty to skip a field.*

- Leave a row empty (**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 — a source or campaign label, for instance. Click **Add static field**, type the value on the left and the field name on the right.

---

## Testing the integration

The quickest way to see what arrives is a webhook inspector:

1. Open [https://webhook.site/](https://webhook.site/) and copy the unique URL it gives you.
2. Set up the integration with that URL, following the steps above.
3. Publish the campaign, then trigger the popup on your site and fill it in. If several campaigns run on your site, make sure you trigger the one you just set up.
4. Refresh the inspector. You should see the POST request; the data OptiMonk sent is in the **Body**.

Once you can see the data arriving, point the integration at your real endpoint: open the **Integrations** tab, click **Edit mapping** on the row — or remove the test connection and add a new one with the production URL.

---

## Change or remove the integration

The Integrations tab lists every integration on the campaign.

- **Edit mapping** reopens the setup at the mapping step.
- The **bin icon** takes the integration off this campaign: *Remove from this campaign? The account connection stays and can be added again.* The URL you connected is not deleted, so you can reuse it on another campaign.
