Skip to main content
The application form can sit on your website through its embed code, one <script> line from Settings → Application Form → Look & share (Share, Your website). This page is for the developer of that website. It covers filling the form in with answers the merchant already gave on your page, what happens when a merchant submits so you can count each application once, and how the form keeps the ad tags of the page the merchant landed on.

Choose the design

The form comes in three designs: one-page (the default), steps and quick-start. The account picks one in Settings → Application Form. An embed code can use another with data-design:
A link to the form takes ?design=quick-start. For an embedded form only the attribute counts: a design in your page’s own address isn’t passed on. Prefill, the submit message and ad tags work the same in every design. In steps and quick-start the form changes screens inside its frame. It posts { type: 'mca-form-step', token } to your page on each change, and the embed code scrolls your page back to the top of the form when the visitor has scrolled past it.

Prefill the form from your page

When the merchant has already answered questions on your page, for example a short qualifier before the full application, hand those answers to the form so they don’t type them again:
The answers go from your page to the form inside the browser. They are never put in a web address and no API call is involved. MCAForm.prefill can be called straight after the embed code, or any time later: it waits until the form has loaded. What the form does with them:
  • Fills empty fields only. Nothing the merchant typed, or answers from an unfinished application they reopened, is replaced. The merchant can change anything you filled in.
  • Never takes an SSN, a signature, consent or the terms box. The merchant gives those themselves.
  • Only takes fields the form shows, formatted as if typed: 732-555-0199 becomes (732) 555-0199, NJ becomes New Jersey, 2019-04 becomes 04/2019. A choice must match one of the field’s options (any capitalization).
  • Answers with what it used: result.applied lists the keys it filled, and result.ignored lists the others, each with a reason such as already filled in or not one of the field's options.
Once the form has a first name and an email or phone, it saves the application as the merchant goes, as it does when they type. A merchant who leaves gets the usual unfinished-application follow-up with a resume link, see Unfinished applications.

Field keys

MCAForm.fields() resolves with every field the form accepts, with its key, label, type and, for choices, its options:
The standard keys are business_name, dba, ein, entity_type, business_address, business_city, business_state, business_zip, business_phone, industry, business_start_date, owner_first_name, owner_last_name, owner_email, owner_phone, owner_dob, ownership_percent, owner_credit_score, owner_address, owner_city, owner_state, owner_zip, annual_revenue, requested_amount and use_of_funds, plus owner2_first_name, owner2_last_name, owner2_email, owner2_phone, owner2_ownership_percent and owner2_credit_score when the form offers a second owner. Only the ones your form shows are accepted. Custom fields from Settings → Fields can be passed by their key from MCAForm.fields() or by their label. Dates can be sent as YYYY-MM-DD (or YYYY-MM for the business start date), amounts as numbers or text such as $50,000, and yes/no fields as true/false or Yes/No. A multiple choice field takes an array or a comma-separated list. A form pasted in as a plain <iframe> takes the same message, once it has posted { type: 'mca-form-ready' } to your page: iframe.contentWindow.postMessage({ type: 'mca-form-prefill', token: 'YOUR_TOKEN', id: 'any-id', data: { … } }, 'https://securefundingportal.com'). It answers with { type: 'mca-form-prefilled', id, applied, ignored }.

The application id

Every submitted application becomes a deal, and its id is the application id you get on your page. The same id comes back when the merchant sends the same application again (a lost connection, a second click), so counting each id once gives exact numbers. The id opens nothing without a sign-in to the workspace.

What happens on submit

When an application goes through, the form shows its confirmation and posts a message to your page. The embed code then, in this order:
  1. Pushes an event to Google Tag Manager’s dataLayer:
  2. Fires a mca:application-submitted event on window, with detail.applicationId and detail.redirectUrl. It can be cancelled.
  3. Two seconds later, when Redirect URL is set, sends the whole page to it, with application_id added to the address:
    Your own query string and fragment are kept.

Count with Google Tag Manager

Create a Custom Event trigger for mca_application_submitted and a Data Layer Variable for application_id. Send it with your Google Analytics event tag, for example as transaction_id on a conversion.

Count with gtag.js only

Without Tag Manager, listen for the window event:
Put it before the embed code. Count either the event or the thank-you page, not both.

Handle the redirect yourself

Call preventDefault() in your listener and the embed code stays put. Then you decide where the page goes:

A form in a plain iframe

The embed code is what moves the whole page: browsers don’t let a frame from another site move the page around it without a fresh click. A form pasted in as a plain <iframe> still posts the message, so you can listen for it yourself:
With a plain iframe and a Redirect URL, only the iframe moves to it.

Ad tags

The embed code passes these tags from your page’s address to the form: It also passes the page’s address without its query string, and only the site of the page that sent the visitor (https://www.google.com, not the full address). Nothing else from your page’s address reaches the form. The tags are kept from the merchant’s first visit: one who starts the application, leaves, and finishes later from a follow-up link keeps the tags of the visit that started it. On the deal they show in its activity, utm_source becomes its lead_source, and the API returns them all as attribution on the deal. A rep code works the same way as ad tags: yoursite.com/apply?rep=CODE assigns the application to that rep. See Application on your own domain.