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

# Lead Capture

> A pop-up for your own site that collects emails and WhatsApp numbers, hands out a promo code through a small game, and starts a journey.

Lead Capture puts a pop-up on your website that asks visitors for their email
and WhatsApp number and gives them a promo code in return. You can show the code
straight away, or make it a game: **pick 1 of 3** cards, **spin the wheel**,
drop a ball down a **Plinko** board, **scratch** a card, pull a **slot machine**,
or open **1 of 3 gift boxes**.

Every submission becomes a lead in your [CDP](/cdp/overview) people, marked
`source: lead_capture`, and a `lead_captured` [event](/events), so a [journey](/journeys) can welcome the lead on WhatsApp or
email within seconds, while they still remember you.

<Note>
  Lead Capture is an add-on. If you don't see **Settings → Add-ons → Lead
  Capture** in the Boom app, ask your account manager to turn it on for your
  organization.
</Note>

## Create a pop-up

In **Settings → Add-ons → Lead Capture**, choose **New pop-up**, pick a
template, and give it a name and the site it will run on. Templates are finished
pop-ups (a big coupon, a newsletter sign-up, a full-screen offer, the wheel and
the other games) with their design and text already in English, Spanish and
Portuguese; choose **Blank** to start plain. Either way you only add your prizes
and codes. New pop-ups start **Paused**, so you can design one without it
showing to anyone.

The pop-up's page is a live preview with the settings beside it:

| Tab | What you set |
| - | - |
| **Install** | Status, the install tag, and the sites allowed to load it. A checklist shows what is still missing before it can go live. |
| **Design** | **Browse templates** (replaces the design and text, keeps your prizes, sites and timing), a one-click **look**, then fine-tuning: layout (centered, split, corner card or full screen), where the image goes (inside, top banner or background), your brand colors, one of seven fonts, button shape and corner roundness. |
| **Content** | Every piece of text, in English, Spanish and Portuguese — including the big **offer** line ("\$250", "15% OFF"). Wrap words in `*asterisks*` to highlight them. Anything left blank uses the English text. |
| **Form** | Which fields to ask for, the phone field's default country, an optional **ask first** screen (one "yes" before the form), and what happens after: show the code (optionally with a button that applies it in your store) or send it by message. |
| **Trigger** | When it opens: after a delay, after scrolling part of the page, when the visitor is about to leave, or only when they click a button you add. Whether it shows on phones, and how long to wait after someone closes it. |
| **Prizes** | The game, and the prizes it can land on, each with its promo code and odds. |
| **Leads** | Everyone who has submitted it, newest first. |

## Install

Copy the tag from the **Install** tab and paste it at the end of the page body on
every page that should show the pop-up:

```html theme={null}
<script async src="https://www.useboom.ai/widget/v1/lc/blc_live_YOUR_INSTALL_KEY"></script>
```

It is separate from the [web widget](/web-widget)'s tag; you can use either or
both. Like the widget's, the install key is public and identifies the pop-up — it
does not authorize anything.

Then add every site that hosts it under **Allowed sites**. Matching is exact:
`https://example.com` does not cover `https://www.example.com`. On any other site
the pop-up does not open, and your browser's console says why.

### Open it from your own button

Any button or link with the pop-up's install key in `data-boom-lead-capture-open`
opens it when clicked, whatever its trigger:

```html theme={null}
<button type="button" data-boom-lead-capture-open="blc_live_YOUR_INSTALL_KEY">
  Get my gift
</button>
```

The tag above must still be on the page. A button opens the pop-up even for a
visitor who closed it or already signed up, because they asked for it. Every
entry records a `lead_captured` event, a repeat one included (`repeat` is
`true`), so give a welcome journey a frequency cap or branch on `repeat` to
avoid welcoming the same person twice. Set the trigger to **On click** if it
should only ever open this way. That is also the
choice for a page where search ranking matters: a pop-up that covers a page as
soon as it loads on a phone can cost it.

## Apply the code in your store

Under **Form → After the form**, add an apply-code link and the prize screen gets
a button that opens your store with the code already applied. Write `{code}`
where the code goes. For Shopify:

```
https://your-store.com/discount/{code}
```

## Going live

**Set Active** is refused until the pop-up can keep its promise:

* at least one allowed site;
* it asks for an email or a WhatsApp number;
* a game has at least one prize;
* if it asks for a WhatsApp number, it has a consent sentence.

While it is Active, changes that would break one of these are refused too —
pause it first.

## Prizes and games

Each visitor gets **one** prize, drawn on Boom's side using the odds you set. The
game only shows the result: whichever card or box the visitor picks, the wheel,
the ball and the reels land on the prize already drawn, and the scratch card hides it. Nothing on your page can change what a
visitor wins, and the promo codes are never sent to the page until a prize is
drawn.

Someone who enters again — same WhatsApp number, or the same email inbox, even
with a `+tag` or Gmail dots — gets the prize they got the first time.

<Tip>
  Wheel slices, Plinko slots, reels and gift tags are small. Lead with the value
  in each prize's label — "10% off", "Free shipping" — or give it a short label.
</Tip>

## Consent

When the pop-up asks for a WhatsApp number, it shows your consent sentence beside
an unticked box, and the visitor has to tick it to continue. Boom stores, with
each lead, whether they ticked it, the exact sentence they saw, the language it
was in, and when.

A visitor who leaves the box unticked (on a form that asks only for email) is
still saved as a lead, but is **not** enrolled in journeys.

A form that asks only for email can show the consent sentence as a **notice**
instead of a checkbox — submitting the form is then the agreement. Forms that ask
for a WhatsApp number always use the checkbox. Each lead records which of the
two it was.

## Use the lead in a journey

Start a journey with the **`lead_captured`** event. It appears in the journey
builder as soon as a pop-up is first set Active. Its properties are available as
message variables:

| Property | |
| - | - |
| `email`, `phone`, `displayName` | What the visitor entered |
| `promo_code`, `prize_label`, `prize_id` | The prize they won |
| `form_id`, `form_name` | Which pop-up |
| `consent` | Whether they ticked the consent box |
| `consent_method` | `checkbox` (they ticked it) or `notice` (submitting was agreeing) |
| `consent_text` | The exact sentence they agreed to — your record of the opt-in |
| `locale` | The language the pop-up was shown in |
| `repeat` | `true` when this person had already entered |
| `page_url` | The page they submitted from |

A typical welcome sends the promo code again on WhatsApp, then follows up if no
order arrives.

### Before you publish

* **Check for a WhatsApp number first.** `email` and `phone` are only there
  when the visitor gave them, so some leads arrive with an email and no number.
  Start the journey with a condition on `phone` **is set**: send WhatsApp on
  *Yes* and email on *No*. A WhatsApp step for someone with no number ends their
  journey there; an email step for someone with no email is skipped.
* **One journey hears every pop-up.** The trigger is the event name, so a
  `lead_captured` journey receives leads from all your pop-ups. To treat them
  differently, add a condition on `form_name` (or `form_id`) right after the
  start.
* **Publishing is going live.** The journey starts enrolling new leads the
  moment you publish it, so test the messages first.
* Visitors who left the consent box unticked are saved as leads but never
  enter a journey.

Anyone can type any email or number into a public form, so a submission never
changes a customer you already have — not their details, opt-ins or journeys.
Each visitor is a **lead** of their own (its ID starts with `lead_`, and it
carries `source: lead_capture`), even when the email or number matches a
customer. The same visitor coming back, on any of your pop-ups, is the same lead,
and gets the prize they were first given. To target leads in a segment, use
`source` is `lead_capture`.

## Your own analytics

After a successful submission the page receives a `boom:lead-captured` event on
`window`, carrying the install key and the prize id (no contact details):

```js theme={null}
window.addEventListener('boom:lead-captured', (event) => {
  analytics.track('Lead captured', event.detail);
});
```


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