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

# Track ClickFunnels purchases paid with Stripe

> Track ClickFunnels Stripe purchases in Cometly: add a hidden comet_token field to your form and map it so each sale links back to its ad.

This guide shows you how to track ClickFunnels Stripe purchases in Cometly. When Stripe takes the payment on your funnel, the **Cometly pixel cannot capture the email address from the Stripe form** (the pixel is the tracking script on your pages). You close that gap with a hidden **comet\_token** field on your form: the comet\_token is the identifier that links a visitor's browser session to their attribution data.

Without it, Cometly cannot link the purchase event (the conversion ClickFunnels sends) back to the visitor. With it, the comet\_token is included in the payload when ClickFunnels sends the purchase event, so you can see which ad or channel produced each Stripe sale. In all other cases, Cometly tracks ClickFunnels forms automatically.

> [!NOTE]
>
> This solution works for ClickFunnels only, not ClickFunnels Classic.

## Before you start

* The Cometly pixel is installed on your funnel. See the [ClickFunnels pixel installation guide](https://docs.cometly.com/integrations/pixel/clickfunnels.md).
* ClickFunnels already sends a Purchase event to Cometly, through the [ClickFunnels integration](https://docs.cometly.com/integrations/platforms/clickfunnels.md) or a [webhook](https://docs.cometly.com/integrations/guides/clickfunnels-webhooks.md).

## Step 1: Add a custom input field

1. In the ClickFunnels editor, hover your mouse under the last form field and click **Add Element**.

   ![ClickFunnels editor with the Add Element button under the last form field](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/clickfunnels-with-stripe/01.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=cd071ab7668a3faa52f8bc0bb595d49e)

2. In the **Form** section, click **Input**.

   ![ClickFunnels elements panel with the Form section and the Input element highlighted](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/clickfunnels-with-stripe/02.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=15c299ad7e49af69ef283bd85eb61a1e)

3. Set **Input Type** to **Custom Type**.

4. Enter `comet_token` into the **Custom Type** field. Spell it exactly like this: all lowercase, with an underscore.

5. Set **Required** to **Not Required**. This prevents submission issues if the pixel is blocked.

   ![ClickFunnels input settings with Custom Type, comet\_token and Not Required selected](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/clickfunnels-with-stripe/03.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=1cb2a0a58dae86b38f79ef290f4cd55c)

## Step 2: Add a custom attribute

1. Select the comet\_token input field.

2. Go to **Advanced → Logic → Custom Attributes**.

   ![ClickFunnels input Advanced tab, Logic section, with Add Custom Attribute highlighted](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/clickfunnels-with-stripe/04.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=e36e39ad7c732a933a545707af7dee24)

3. Click **Add Custom Attribute**, enter the following and click **Save**:

   * **Name:** `data-hidden`
   * **Value:** `true`

   ![ClickFunnels New custom attribute dialog with data-hidden and true entered](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/clickfunnels-with-stripe/05.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=2b9a4bc94284f7c011d8eabf67c186a0)

## Step 3: Add the custom script

Next, add a script to your funnel page that hides the comet\_token field:

1. Open the page editor.

2. Go to **Settings → Custom Code → Footer Code**.

   ![ClickFunnels page editor with the settings menu, the code option and the Footer Code tab highlighted](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/guides/clickfunnels-with-stripe/06.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=8c436b5e8ee1945777cae1cc1d5fb1b9)

3. Paste in this script:

   ```html theme={null}
   <script>
     document.addEventListener("DOMContentLoaded", function() {
       document.querySelectorAll('[data-hidden="true"]').forEach(function(el) {
         el.style.display = "none";
       });
     });
   </script>
   ```

   The script hides any field with the `data-hidden="true"` attribute, which turns the **comet\_token** field into a hidden field.

4. **Save** the page.

## Step 4: Map the comet\_token to your Purchase event in Cometly

Once this setup is complete, the comet\_token is included in the payload when ClickFunnels sends the purchase event. Map it in Cometly:

1. In Cometly, go to **Events Manager**.
2. Find your ClickFunnels **Purchase** event and click **Edit** (or **Configure** if the event is still a draft).
3. Open the **Configure Mapping** step and click **Add Field**.
4. Under **Cometly Fields**, choose **Comet Token**. Under **Data Fields**, select the comet\_token field from the ClickFunnels payload.
5. Click **Save & Continue** and finish the remaining step.

Cometly can now connect each Stripe purchase to the visitor's journey.

## Check it worked

Complete a test purchase on your funnel. In Cometly, the data ClickFunnels sends for your **Purchase** event now includes the comet\_token field with a value, and it is mapped to **Comet Token**.

## Why this works

* The **comet\_token** is captured even though Stripe blocks email capture.
* The custom attribute and the script hide the field from the visitor but keep it working.
* Mapping the comet\_token in Cometly links every Stripe purchase event back to the visitor's funnel activity.
* Setting the field to **Not Required** prevents form errors if the comet\_token can't be generated.

> [!TIP]
>
> If you use multiple Stripe funnels, repeat this setup in each funnel so that all Stripe purchases are tracked accurately.

## Frequently asked questions

### What is the comet\_token in Cometly?

The comet\_token is a unique identifier created by the Cometly pixel. It links a visitor's browser session to their attribution data, so an event that arrives with it can be matched to that visitor even without an email address. The Cometly pixel must be installed on the page for it to exist.

### Why can't I find the comet\_token field when I map my ClickFunnels Purchase event?

Cometly lists the fields from the data ClickFunnels has already sent. Purchases made before you added the field to your form do not contain it. Complete a new purchase on the funnel after you save the page, then map the field from that record.

## Next steps

* [Connect ClickFunnels to Cometly with the direct integration](https://docs.cometly.com/integrations/platforms/clickfunnels.md)
* [Send ClickFunnels events with webhooks](https://docs.cometly.com/integrations/guides/clickfunnels-webhooks.md)
* [Install the Cometly pixel on ClickFunnels](https://docs.cometly.com/integrations/pixel/clickfunnels.md)
* [Learn how mapping and filters work in Cometly webhooks](https://docs.cometly.com/integrations/webhooks.md)
* [Understand how events work in Cometly](https://docs.cometly.com/guides/events/how-events-work.md)

Still have questions or need a hand? We're happy to help. Reach our team at [support@cometly.com](mailto:support@cometly.com).


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