# ClickFunnels 2.0 and Whop Checkout

> Learn how to track conversions when using ClickFunnels 2.0 as your funnel and Whop as your checkout platform. Capture leads and purchases with AnyTrack.

## Overview

This guide covers the setup for funnels that use **ClickFunnels 2.0** for lead capture and the **Whop** platform for checkout. AnyTrack bridges the two platforms so you can track the complete customer journey — from optin to purchase — and sync conversions to your ad platforms via Conversion APIs.

**What you'll achieve:**

* Track leads captured on ClickFunnels 2.0 optin pages
* Automatically fire an `InitiateCheckout` event when visitors reach the Whop checkout
* Capture successful payments from Whop via webhook
* Send conversion data to Google Ads, Meta, TikTok, and other ad platforms

<Prerequisites
  title="Before you begin"
  items={[
    { label: "You have an active AnyTrack account", done: true },
    { label: "You have a ClickFunnels 2.0 account with admin access", done: true },
    { label: "You have a Whop account with access to webhook settings", done: true },
    { label: "Your funnel includes an optin form before the Whop checkout page", done: true },
  ]}
/>

***

## How It Works

<SimpleStepper>
  <SimpleStep header="Step 1: Visitor fills out the optin form">
    ClickFunnels 2.0 captures the contact data (email, name, phone) and stores it in the dataLayer
  </SimpleStep>

  <SimpleStep header="Step 2: Visitor reaches the Whop checkout page">
    A tracking script reads the contact data from the dataLayer and fires an InitiateCheckout event to AnyTrack
  </SimpleStep>

  <SimpleStep header="Step 3: Visitor completes the purchase on Whop">
    Whop sends the payment data to AnyTrack via webhook
  </SimpleStep>

  <SimpleStep header="Step 4: AnyTrack syncs conversions to ad platforms">
    AnyTrack sends the conversion data to all connected ad platforms via Conversion API
  </SimpleStep>
</SimpleStepper>

***

## Setup Guide

### Step 1 — Integrate ClickFunnels 2.0 with AnyTrack

Follow the standard [ClickFunnels 2.0 integration guide](/docs/clickfunnels2) to:

1. Add the **AnyTrack Tracking Tag** to your ClickFunnels site.
2. Set up the **ClickFunnels 2.0 webhook** in AnyTrack.

This ensures AnyTrack tracks all visitor activity and optin events on your funnel pages.

***

### Step 2 — Add the Checkout Tracking Script

On the ClickFunnels page where the **Whop checkout widget** is embedded, add the following script. This script reads the contact data captured by your optin form and fires an `InitiateCheckout` event to AnyTrack.

```javascript
<script>
!function(){
  let attempts = 0;
  const captureCheckout = () => {
    attempts += 1;
    const {
      contactEmailAddress,
      contactFirstName,
      contactLastName,
      contactPhoneNumber,
      contactCountry,
      contactPostalCode
    } = window.dataLayer?.find(entry => entry.contactEmailAddress) || {};

    if (contactEmailAddress) {
      window.AnyTrack?.("trigger", "InitiateCheckout", {
        refId: contactEmailAddress,
        email: contactEmailAddress,
        firstName: contactFirstName,
        lastName: contactLastName,
        phone: contactPhoneNumber,
        country: contactCountry,
        zipcode: contactPostalCode
      });
      return true;
    }
    return attempts >= 10;
  };

  if (captureCheckout()) return;
  const interval = setInterval(() => {
    if (captureCheckout()) clearInterval(interval);
  }, 300);
}();
</script>
```

**How this script works:**

* It polls the ClickFunnels `dataLayer` for contact data submitted via the optin form.
* Once the email address is found, it fires an `InitiateCheckout` event with the lead's details.
* If no data is found after 10 attempts (3 seconds), it stops polling.

> ⚠️ **Important**
>
> The optin form must be on a page **before** the Whop checkout page. The script relies on contact data already being present in the `dataLayer` when the checkout page loads.

***

### Step 3 — Set Up the Whop Webhook

Connect Whop to AnyTrack to capture successful payment events:

1. In your **AnyTrack dashboard**, go to the **Integration Catalog**.
2. Search for **Whop** and click **Install Integration**.
3. Copy the **Webhook URL** provided by the integration.
4. Log in to your **Whop account** and navigate to your webhook settings.
5. Add a new webhook and paste the **AnyTrack Webhook URL**.
6. Select the **successful payment** event as the trigger.
7. Save the webhook configuration.

***

### Step 4 — Test Your Setup

Verify the full funnel is working:

1. Visit your ClickFunnels funnel and submit the **optin form** with test data.
2. Proceed to the **Whop checkout page** and verify the `InitiateCheckout` event appears in your AnyTrack Event Log.
3. Complete a **test purchase** on Whop.
4. Check your **AnyTrack dashboard** for the purchase conversion.

<Callout icon="🔎" theme="default">
  ### Verify with AnyTrack Pixel Helper

  Install the [AnyTrack Pixel Helper](https://chromewebstore.google.com/detail/anytrack-pixel-helper/ojmhkmdpagjeopleoeihbhgejcfoijjn) Chrome extension to verify the AnyTrack Tag is firing correctly and the `InitiateCheckout` event is triggered on the checkout page.
</Callout>

***

## Tracked Events

| Event              | Description                                   | Data Source           |
| ------------------ | --------------------------------------------- | --------------------- |
| `PageView`         | Visitor lands on a funnel page                | AnyTrack JS Tag       |
| `Lead`             | Visitor submits the optin form                | ClickFunnels Webhook  |
| `InitiateCheckout` | Visitor reaches the Whop checkout page        | Checkout Script       |
| `Purchase`         | Visitor completes payment on Whop             | Whop Webhook          |

***

## Connect Your Ad Platforms

Once tracking is active, connect your advertising platforms to receive conversion data:

<Cards columns={3}>

  <Card title="Google Ads" href='/docs/google-ads' icon="fa-brands fa-google">
    Enhanced conversions and smart bidding optimization
  </Card>

  <Card title="Meta Ads" href='/docs/facebook-ads' icon="fa-brands fa-facebook">
    Conversion API for improved attribution
  </Card>

  <Card title="TikTok Ads" href='/docs/tiktok-ads' icon="tiktok">
    Events API for improved targeting
  </Card>

</Cards>

> ⚠️ **Important**
>
> After connecting ad accounts through AnyTrack, remove any existing tracking pixels from your ClickFunnels and Whop pages to prevent duplicate tracking.

***

## Troubleshooting

### InitiateCheckout event not firing

* Verify the **optin form** is on a page before the checkout page — the script needs contact data in the `dataLayer`.
* Check that the **AnyTrack Tracking Tag** is installed on the page where the Whop widget is embedded.
* Open the browser console and confirm `window.dataLayer` contains an entry with `contactEmailAddress`.

### Purchase conversions not appearing

* Verify the **Whop webhook** is configured with the correct AnyTrack Webhook URL.
* Check the webhook is set to trigger on the **successful payment** event.
* Inspect the **Event Log** in your AnyTrack integration page for errors.

### Attribution data missing

* Ensure the AnyTrack tag is installed on **all pages** in the funnel, not just the checkout page.
* Confirm visitors go through the optin form before reaching the checkout — direct links to the checkout page skip the lead capture step.

***

<FaqAccordion
  title="ClickFunnels 2.0 & Whop Checkout - Frequently Asked Questions"
  icon="fa-duotone fa-circle-question"
  items={[
    {
      question: "Why do I need an optin form before the Whop checkout?",
      answer: "The checkout tracking script reads contact data (email, name, phone) from the ClickFunnels dataLayer. This data is only available after a visitor submits the optin form. Without it, the InitiateCheckout event cannot capture lead details."
    },
    {
      question: "Can I use this setup without ClickFunnels 2.0?",
      answer: "This guide is specifically for ClickFunnels 2.0 funnels with Whop checkout. If you use a different funnel builder, you need to adapt the tracking script to read contact data from that platform's data layer or form submissions."
    },
    {
      question: "What data is sent with the InitiateCheckout event?",
      answer: "The script sends the visitor's email address, first name, last name, phone number, country, and postal code — all captured from the ClickFunnels optin form."
    },
    {
      question: "How do I know if the webhook from Whop is working?",
      answer: "Check the Event Log in your AnyTrack integration page. Successful webhook deliveries will show purchase events with order details. If no events appear, verify the webhook URL and event trigger in your Whop account settings."
    },
    {
      question: "Will this track upsells on Whop?",
      answer: "Upsell tracking depends on whether Whop sends separate webhook events for upsell purchases. Configure additional webhook triggers in your Whop account if upsell events are available."
    }
  ]}
/>

***

## Related Resources

- [ClickFunnels 2.0 Integration](/docs/clickfunnels2)
- [Advertising Integrations](/docs/advertising-integrations)
- [Install the AnyTrack Tag](/docs/install-anytrack-tag)
