> ## Documentation Index
> Fetch the complete documentation index at: https://docs.os.default.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Default and Marketo: webhooks and Marketo forms

> How Default works with Marketo: capture embedded Marketo forms with the Pixel, send Marketo leads to a Default workflow with a webhook, route leads when they reach a lead score threshold, and write results back to Marketo.

Default works with Marketo in 3 ways. The Default Pixel captures submissions from Marketo forms
embedded on your website, a Marketo webhook sends lead data to a Default workflow through the
**Incoming Webhook** trigger, and results flow back to Marketo through your CRM's sync or through a
**Send to Webhook** node that calls a service connected to Marketo's REST API.

Marketo is not a native integration in Default. It has no card under **Settings** →
**Integrations**, and Default does not sign in to Marketo or sync with it. Every connection on this
page runs through the Pixel, a webhook, your CRM's sync, or the Marketo API.

## How Default connects to Marketo

| Direction | How it connects | What starts in Default | What you set up in Marketo |
| - | - | - | - |
| Marketo form on your site to Default | The Pixel captures the submission | **Form Submission** trigger | Nothing. The form keeps submitting to Marketo. |
| Marketo to Default | A Marketo webhook posts to a Default **Ingestion URL** | **Incoming Webhook** trigger | A webhook, and a smart campaign with a **Call Webhook** flow step |
| Default to Marketo | Marketo's Salesforce sync, or a **Send to Webhook** node that calls a service you run, which calls the Marketo REST API | Any workflow | For the REST API, a Marketo API user whose credentials your service holds |

If Marketo syncs with your Salesforce instance, the fields Default writes to a Salesforce record,
such as the owner, reach Marketo through that sync when Marketo syncs those fields. No webhook is
needed for them.

## Choose a path for each Marketo event

* **A visitor submits a Marketo form on your site.** Use the Pixel. Default gets the submission
  while the visitor is still on the page, so the workflow can route the lead and show a scheduler
  right after the submit.
* **Something changes inside Marketo.** Use a Marketo webhook. Examples are a lead score crossing
  your threshold, a program status change, or a lead joining a list.
* **Send each event through 1 path.** If a form submission reaches Default through the Pixel and
  also through a Marketo webhook, the lead runs through 2 workflows and can be routed twice.

## Capture Marketo forms with the Pixel

The Default Pixel recognizes forms rendered by Marketo's Forms 2.0 embed code. It listens for the
form's success event, so Default receives the submitted values after Marketo accepts the
submission. Marketo still receives every submission.

| Behavior | Detail |
| - | - |
| Forms that load late | Detected, including Marketo forms that appear after the page loads, for example in a modal. |
| Adding the form to Default | Use **Catalog forms**. Catalog mode recognizes embedded Marketo forms, alongside HubSpot, Pardot, and plain HTML forms. |
| Field names | Default receives Marketo's field names, for example `Email` or `FirstName`. Map them to Person and Company fields. |
| Scheduler after submit | When the form's workflow has a **Display Scheduler** node, the Pixel stops Marketo's follow-up page so the calendar can open on your page. |
| Forms Default skips | A form with `data-default-ignore` on it, or on an element around it. |

<Steps>
  <Step title="Install the Pixel">
    Connect the domain in **Signals** and add the Pixel snippet to the pages that hold your Marketo
    forms. For a Marketo landing page, add the snippet to the landing page template. A connected
    domain covers its subdomains, so `example.com` also covers a landing page on `go.example.com`.
    See [Set up the Pixel and Forms SDK](/pixel-sdk-setup).
  </Step>

  <Step title="Catalog the form">
    In **Signals**, open the domain's actions menu and select **Catalog forms**. Under
    **Start on**, pick the page with the Marketo form, then select **Open catalog mode**. On your
    page, select **Add form** on the Marketo form and confirm. See
    [Add forms from your site](/forms/your-forms#add-forms-from-your-site).
  </Step>

  <Step title="Map its fields">
    Map the Marketo fields you route on, such as `Email`, `Company`, and `Country`, to Person and
    Company fields. See [Map form fields](/forms/your-forms#map-form-fields).
  </Step>

  <Step title="Start a workflow from it">
    In **Workflows**, add the **Form Submission** trigger and set **Connected Form** to the Marketo
    form. To offer a meeting right after the submit, add a **Display Scheduler** node. See
    [How Default books a meeting from a form submission](/forms/scheduler).
  </Step>
</Steps>

The Pixel reads Marketo forms that render into your page. It cannot read into a form inside a
cross-origin iframe. See [Automatic detection](/pixel-sdk-integration-guide#automatic-detection-the-pixel).

## Send Marketo leads to Default with a webhook

A Marketo webhook can post lead data to a Default **Ingestion URL**. Each request starts the
published, enabled workflows that use that webhook in their **Incoming Webhook** trigger.

<Steps>
  <Step title="Create the webhook in Default">
    In **Workflows**, create a workflow and add the **Incoming Webhook** trigger. Under
    **Connected Webhook**, select **Create new webhook**.
  </Step>

  <Step title="Copy the URL and the secret">
    The trigger shows the **Ingestion URL** and the **Bearer secret**. Copy the URL, then reveal
    and copy the secret. The secret is shared by every incoming webhook in your workspace. See
    [Webhook Secret](/settings/webhook-secret).
  </Step>

  <Step title="Create the webhook in Marketo">
    In Marketo, go to **Admin** → **Webhooks** and select **New Webhook**:

    * **URL**: the **Ingestion URL** from Default.
    * **Request Type**: **POST**.
    * **Template**: a JSON body built from Marketo tokens, like the example below.
    * **Request Token Encoding**: **JSON**.

    Then select the webhook, open **Webhook Actions**, and select **Set Custom Header**. Add a
    header named `Authorization` with the value `Bearer <your secret>`.
  </Step>

  <Step title="Give Default a sample">
    Back in the Default trigger, under **Test event**, select **Paste a sample** and paste the
    template with example values. You can also select **Listen for test event** and have Marketo
    call the webhook within 5 minutes. A captured request builds the field list and does not run
    the workflow.
  </Step>

  <Step title="Map the lead's email">
    Under **Identity mapping**, set **Person email** to the field that holds the email, for
    example `email`. Later nodes, such as **Enrich Data**, then treat the request as that person.
  </Step>

  <Step title="Build and publish the workflow">
    Add the nodes that act on the lead and select **Publish**. Then check that the status next to
    the [deployment switch](/workflows#the-enabled-switch) reads **Live**. A new workflow goes live
    when you first publish it. If the status reads **Paused**, turn the switch on.
  </Step>

  <Step title="Call the webhook from a smart campaign">
    In Marketo, add the **Call Webhook** flow step to the smart campaign that should send leads,
    choose the webhook, and activate the campaign.
  </Step>
</Steps>

A Marketo template for this webhook can look like this:

```json theme={null}
{
  "email": "{{lead.Email Address}}",
  "first_name": "{{lead.First Name}}",
  "last_name": "{{lead.Last Name}}",
  "company": "{{company.Company Name}}",
  "lead_score": "{{lead.Lead Score}}",
  "marketo_id": "{{lead.Id}}"
}
```

Every field in the sample becomes available in the data picker. Type `{{` in a later node to use
them.

### How the Ingestion URL responds

| Response | What it means |
| - | - |
| `200` with `"accepted": true` | Default accepted the request. It returns `200` even when no published, enabled workflow uses the webhook. |
| `400` | The body is not valid JSON, or the value in the mapped **Person email** field is not a valid email. |
| `401` | The `Authorization` header is missing or the secret is wrong. |
| `404` | The webhook does not exist or was deleted. |
| `410` | The webhook is paused. Turn it back on in the trigger. |
| `413` | The body is larger than about 1 MB. |

Send 1 lead per request. A request whose body is a list starts 1 workflow run with the whole list.

## Route Marketo leads when they reach a lead score threshold

Marketo keeps scoring the lead, and Default decides who owns it. A common setup:

1. **Marketo decides when a lead qualifies.** A smart campaign runs when the lead's score crosses
   your threshold, for example with Marketo's **Score is Changed** trigger, and calls the Default
   webhook with a **Call Webhook** flow step.
2. **Default checks the CRM.** A **Match Record** node looks up the lead by email in Salesforce or
   HubSpot.
3. **Default picks an owner for new records.** On the **No Match** branch, a **Round-Robin** node
   picks a rep from a queue, and **Create Record** writes the rep as the owner. See
   [Queues](/queues) and [Round-Robin](/workflows/steps-routing-scheduling#round-robin).
4. **Existing owners stay in place.** On the **Match** branch, notify the current owner with
   **Send Slack Message** and leave the record's owner as it is. If some matched records still
   belong to a placeholder owner, such as your Marketo sync user, send only those through
   **Round-Robin** and **Update Record** with a **Multi-Branch** node on the owner.
5. **Default tells the new owner.** On the **No Match** branch, add **Send Slack Message** with the
   lead's score and company, so the rep follows up while the lead is active.

If Marketo also syncs leads to your CRM, keep **Match Record** before **Create Record**, so Default
does not add a second record for a lead that Marketo already synced.

To follow up automatically, add the lead to a sequence as the assigned rep. See
[Send routed leads to sales sequences](/guides/routed-leads-to-sequences).

## Send data from Default back to Marketo

### Through your CRM

If Marketo syncs with Salesforce, write the result to the Salesforce record with **Update Record**
or **Create Record**. Marketo picks it up through its own sync. This keeps 1 system of record and
needs no Marketo credentials in Default.

### Through the Marketo REST API

Marketo's REST API accepts an access token that Marketo issues in exchange for an API user's client
ID and client secret. Keep that exchange out of **Send to Webhook**. Its run logs show a request's
URL parameters and body fields, and hide only common credential names such as `secret`, `token`, and
`password`, so a `client_secret` value would appear in the log.

To write to Marketo from a workflow, send the data to a service you control that holds the Marketo
credentials and calls the Marketo REST API, such as your own backend:

1. Add **Send to Webhook** with **Request Type** set to **POST** and **Request URL** set to your
   service's endpoint.
2. Set **Authorization** to **API Key** or **Token** so the service can check the caller. Default
   hides the **API Key** and **Bearer Token** values in run logs.
3. Under **Body**, send the lead's email and the values to write, for example the assigned rep.
   Type `{{` to insert them.
4. The service requests a Marketo access token and updates the lead. See Marketo's REST API
   documentation for the lead endpoints.

**Send to Webhook** cancels a request after 30 seconds, does not follow redirects, and cannot reach
private network addresses. See [Send to Webhook](/workflows/steps-actions#send-to-webhook).

## Troubleshoot Marketo and Default

| What you see | What to check |
| - | - |
| A Marketo form does not appear in catalog mode | The Pixel is not on that page, the form carries `data-default-ignore`, or the form sits inside a cross-origin iframe. |
| Marketo form submissions do not start the workflow | The form is not catalogued or is **Inactive** in **Forms**, or the workflow is not published and turned on. |
| The thank-you page loads instead of the scheduler | The form's workflow has no **Display Scheduler** node, or the form in **Connected Form** is a different form. |
| Marketo's webhook log shows `401` | The `Authorization` header is missing, or the secret was rotated. Update the custom header with the current secret. |
| The webhook returns `200` but nothing runs | No published, enabled workflow uses this webhook in its **Incoming Webhook** trigger. |
| Later nodes cannot find the lead's fields | The sample did not include them. Capture or paste a new sample that has every field. |
| The same lead is routed twice | The event reaches Default through both the Pixel and a Marketo webhook. Keep 1 path per event. |

Related: [Default integrations](https://www.default.com/integrations)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.