Skip to main content

How to Enhance ClickFunnels Tracking with Stripe Payment Integration

Learn how to enhance ClickFunnels tracking with Stripe by adding a hidden comet_token field. This guide shows you how to set it up and map it to your Purchase event in Cometly for accurate attribution.

Updated over 2 weeks ago

When using ClickFunnels with Stripe to capture payments on your funnel, the Cometly pixel cannot capture the email address from the Stripe form. This creates a gap in attribution since we need the comet_token to properly link the purchase event back to the visitor.

In all other cases, Cometly tracks ClickFunnels forms automatically. But when Stripe is integrated for payment, you’ll want to enhance your tracking by adding a hidden comet_token field. This ensures that when the purchase event is sent from ClickFunnels, the comet_token is included in the payload for accurate attribution.

This solution works specifically for ClickFunnels, not ClickFunnels Classic.


Step 1: Add a Custom Input Field

  1. In the ClickFunnels editor, add a new Input Field to your form. To add the input field, hover your mouse under the last form field and click Add Element.

  2. In the 'Form' section click Input.

  3. Set Input Type to Custom Type.

  4. Enter comet_token (all lowercase, with underscore) into the Custom Type field.

  5. Make sure the field is set to Not Required (this prevents submission issues if the pixel is blocked).

Example:

(Make sure it’s spelled exactly like above — lowercase and with an underscore.)


Step 2: Add a Custom Attribute

  1. Select the comet_token input field.

  2. Go to Advanced → Logic → Custom Attributes.

  3. Add a new attribute:
    Click Add Custom Attribute and enter:

    • Name: data-hidden

    • Value: true


Step 3: Add the Custom Script

Next, add the script to your funnel page to hide the comet_token field:

  1. Open the page editor.

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

  3. Paste in this script:

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

    This script automatically hides any field with the data-hidden="true" attribute, turning the comet_token field into a hidden field.

  4. Make sure to Save the page.


Step 4: Map the comet_token to Your Purchase Event in Cometly

Once this setup is complete:

  • The comet_token will now be included in the payload when the purchase event is sent from ClickFunnels.

  • In Cometly Event Mappings, go to your Purchase event.

  • Map the comet_token field so Cometly can properly connect the purchase back to the visitor’s journey.

This step ensures your Stripe purchases are fully tracked and attributed inside Cometly.



Why This Works

  • The comet_token is captured even though Stripe blocks email capture.

  • The custom attribute + script hides the field from the user but keeps it functional.

  • By mapping comet_token in Cometly, you ensure every Stripe purchase event links back to the visitor’s funnel activity.

  • Setting the field to Not Required prevents form errors if the comet_token can’t be generated.


💡 Pro Tip:

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

Did this answer your question?