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

# Install the Whop pixel

> Add the whop.track snippet to your funnel to measure page views, identify visitors, and attribute conversions from first-party data.

The Whop pixel is a lightweight JavaScript snippet you add to your website. It measures page views, links visitors to their purchases, and attributes conversions back to your ads — using Whop's first-party payment data instead of third-party cookies. Once installed, everything shows up live in your [pixel dashboard](https://whop.com/dashboard/biz_xxxxxxxxxxxxx/pixel).

<Note>
  You only need your **company ID** (`biz_xxxxxxxxxxxxx`) to install the pixel. Find it in the URL of your dashboard, or on the pixel page at `https://whop.com/dashboard/{biz_id}/pixel`.
</Note>

## Install the snippet

Paste this snippet inside the `<head>` of **every page** in your funnel — landing pages, advertorials, checkouts, and thank-you pages, not just your homepage. Replace `biz_xxxxxxxxxxxxx` with your own company ID.

```html Pixel snippet theme={null}
<script>
!function(w,d,s,u,n,a,b){if(w[n])return;a=w[n]={q:[],t:+new Date,s:[],o:u,track:function(){a.q.push([+new Date].concat([].slice.call(arguments)))},setScope:function(){a.s=[].slice.call(arguments).filter(function(x){return typeof x==="string"});a.q.push([+new Date,"setScope"].concat(a.s))},scope:function(){var c=[].slice.call(arguments);return{track:function(){a.q.push([+new Date].concat([].slice.call(arguments)).concat([{__scope:c}]))}}}};b=d.createElement(s);b.async=1;b.src=u+"/s.js";d.getElementsByTagName(s)[0].parentNode.insertBefore(b,d.getElementsByTagName(s)[0])}(window,document,"script","https://t.whop.tw","whop");
whop.setScope("biz_xxxxxxxxxxxxx");
whop.track("page");
</script>
```

<Tip>
  If your platform (Shopify, Webflow, Framer, WordPress, etc.) has a dedicated field for custom header or `<head>` code, paste the snippet there so it ships on every page template automatically.
</Tip>

<Note>
  For most brands — especially ecommerce stores that send traffic to Whop checkout — this snippet is all you need. Whop automatically tracks page views, checkout views, purchases, subscriptions, and trials. You only need extra event code if you want to track steps Whop cannot see, like a lead form on your own site.
</Note>

## Verify the install

Open `https://whop.com/dashboard/{biz_id}/pixel` and watch **Step 1 — Install the pixel**. Page views appear within about a minute of the first visit, and the status turns green once data is flowing. Domains the pixel reports from are listed there too.

## Track events

Most brands can skip this section. Add extra `whop.track` calls only when your funnel has an important step outside Whop checkout — for example a lead form, call booking, application, or quiz.

The most common setup is to fire `whop.track("lead")` either:

* when the lead form submits successfully
* on the thank-you page or confirmation page the visitor sees after submitting

```javascript Standard events theme={null}
whop.track("lead");                                      // a standard event
whop.track("schedule", { value: 50, currency: "USD" });  // optionally with a value
whop.track("custom", { name: "quiz_completed" });        // or your own event name
```

### Standard event names

Use these names for common funnel moments. Each one optionally accepts a `value` (number) and `currency` (ISO 4217 code).

| Event                   | When to fire it                                    |
| ----------------------- | -------------------------------------------------- |
| `lead`                  | A visitor submits contact info or an opt-in form   |
| `schedule`              | A call or appointment is booked                    |
| `submit_application`    | An application is submitted                        |
| `contact`               | A visitor starts a conversation or contact request |
| `complete_registration` | A signup or registration finishes                  |
| `view_content`          | A key page or piece of content is viewed           |
| `add_to_cart`           | An item is added to a cart                         |
| `custom`                | Anything else — pass `{ name: "your_event" }`      |

For custom events, put your event name in `data.name`. Keep names short, stable, and reuse a small set — custom names are capped at 34 characters.

```javascript Custom event theme={null}
whop.track("custom", { name: "watched_vsl" });
```

<Tip>
  **Where to put the tracking call depends on what happens after the action.**

  * **The action does not redirect** (e.g. a form that submits in place and shows an inline success message) — fire the event in the action's success handler, like the form's `onSubmit` callback, after it succeeds:

  ```javascript Track on submit (no redirect) theme={null}
  form.addEventListener("submit", async (e) => {
  	e.preventDefault();
  	await submitForm();
  	whop.track("custom", { name: "watched_vsl" });
  });
  ```

  * **The action redirects** (e.g. a form that sends the visitor to a new page on submit) — fire the event on the page they land on, like the thank-you or confirmation page. Just make sure the pixel snippet is installed on that page too.
</Tip>

### Attach customer fields

You usually do **not** need to attach extra customer fields. Whop can often match events from the pixel, checkout activity, browser signals, and first-party payment data automatically.

If you already have customer details available when an event fires, you can attach them for extra matching coverage. It does not hurt to include them, and it can improve matching. These fields can be attached to any event type, and you can send only the fields you have.

```javascript Lead with customer fields theme={null}
whop.track("lead", {
  email: "visitor@example.com",
  first_name: "Jane",
  last_name: "Doe",
  name: "Jane Doe",
  phone: "+15551234567",
  external_id: "customer_123",
  city: "New York",
  state: "NY",
  postal_code: "10001",
  country: "US",
});
```

| Field         | Description                  |
| ------------- | ---------------------------- |
| `email`       | Visitor's email address      |
| `first_name`  | Visitor's first name         |
| `last_name`   | Visitor's last name          |
| `name`        | Visitor's full display name  |
| `phone`       | Visitor's phone number       |
| `external_id` | Your own user/customer ID    |
| `city`        | Visitor's city               |
| `state`       | Visitor's state or region    |
| `postal_code` | Visitor's postal or ZIP code |
| `country`     | Visitor's country            |

<Note>
  **Don't track purchases, subscriptions, or trials.** Whop records every checkout view, purchase, subscription, and trial start server-side with zero configuration, and the pixel will not accept duplicates. Only send the events Whop cannot see, like leads or bookings on your own infrastructure.
</Note>

## Send events from your server

If you want to send events from your backend instead of (or in addition to) the browser — ad blockers can't touch server-side events, and they're more reliable for high-value conversions — use the [Events API](/api-reference/beta/events/create-event). Attach as much customer information as you have so the event attributes correctly.

<Card title="Events API reference" href="/api-reference/beta/events/create-event" icon="server">
  Create conversion events from your server with an API key. Full endpoint, fields, and examples.
</Card>

## Advanced: multiple companies on one page

Most brands can ignore this. It only applies if the same website or landing page is intentionally tracking events for more than one Whop business.

In that case, set a default scope with multiple IDs, or scope an individual call.

```javascript Scoping theme={null}
// Default scope for every subsequent event
whop.setScope("biz_companyA", "biz_companyB");
whop.track("lead");

// Or scope a single call
whop.scope("biz_companyA").track("lead");
```

## Next steps

<CardGroup cols={2}>
  <Card title="Events API" href="/api-reference/beta/events/create-event">
    Send conversions from your server when browser tracking is not enough — ad blockers cannot touch them.
  </Card>

  <Card title="Whop Ads & WHIXEL" href="/manage-your-business/growth-marketing/ads">
    How first-party attribution powers ad measurement and lookalike audiences.
  </Card>

  <Card title="Tracking integrations" href="/manage-your-business/growth-marketing/tracking-integrations">
    Pipe Whop sales data into Meta, Google, Hyros, and other platforms.
  </Card>

  <Card title="Tracking links" href="/manage-your-business/growth-marketing/tracking-links">
    Build branded links to attribute traffic and conversions across channels.
  </Card>
</CardGroup>
