Skip to main content

ClickFunnels Webhooks

Connect ClickFunnels webhooks to automatically track funnel orders and subscriptions as conversion events. DATALYR matches customers to their original ad click using email-based identity resolution.

What You’ll Learn

  • How to configure ClickFunnels webhooks
  • Supported ClickFunnels events
  • Email attribution matching
  • Testing and verification

Before You Start

  • DATALYR tracking script installed on your funnel pages
  • Email capture with datalyr.identify({ email }) before checkout
  • Admin access to ClickFunnels account
  • Active workspace in DATALYR

Supported Events

DATALYR processes these ClickFunnels webhook events:
ClickFunnels EventDATALYR EventDescription
order.completedpurchaseOrder completed in funnel
order.createdpurchaseNew order created
subscription.createdsubscribeSubscription started
subscription.activatedsubscribeSubscription activated

How Attribution Works

When a customer completes a ClickFunnels order:
  1. ClickFunnels sends webhook with contact email to DATALYR
  2. DATALYR queries events table: “Find visitor_id where email matches”
  3. DATALYR retrieves original attribution (fbclid, gclid, UTMs)
  4. Event is created with source: 'clickfunnels' and attribution data
  5. Conversion rules fire postbacks to Meta, Google, TikTok
Attribution only works if you call datalyr.identify({ email }) before the customer reaches the order form. The email must be captured in a DATALYR event first.

Step 1: Get Webhook URL

  1. Log in to DATALYR dashboard
  2. Navigate to Sources tab
  3. Click Webhooks tab
  4. Click ClickFunnels card
  5. Copy your webhook URL
The URL format is:
https://webhooks.datalyr.com/webhooks/clickfunnels/YOUR_WORKSPACE_ID

Step 2: Configure ClickFunnels Webhook

ClickFunnels Classic

  1. Log in to ClickFunnels
  2. Navigate to Account SettingsIntegrationsWebhooks
  3. Click Add New Webhook
  4. Configure webhook:
    • Name: DATALYR Attribution
    • URL: Your DATALYR webhook URL
    • Events: Select order and subscription events
  5. Click Save

ClickFunnels 2.0

  1. Log in to ClickFunnels 2.0
  2. Navigate to SettingsWebhooks
  3. Click Create Webhook
  4. Configure webhook:
    • Name: DATALYR Attribution
    • Endpoint URL: Your DATALYR webhook URL
    • Events to Listen: Select all order and subscription events
  5. Click Create Webhook

Select Events

Choose these events to listen to:
  • order.completed or order.created
  • subscription.created or subscription.activated

Step 3: Verify Setup

Test with Live Order

  1. Visit your funnel with ad parameters: yourfunnel.com?fbclid=test123
  2. Fill out email form and call datalyr.identify({ email: '[email protected]' })
  3. Complete order with the same email
  4. Check DATALYR Event Stream
You should see:
  • A purchase or subscribe event with source: 'clickfunnels'
  • Attribution data (fbclid, visitor_id) from original session
  • Event value matching order total

Check Webhook Delivery

In ClickFunnels:
  1. Navigate to webhook settings
  2. View webhook delivery logs
  3. Verify recent deliveries show 200 OK status

Step 4: Create Conversion Rules

After verifying webhook events are created, set up conversion rules to fire events to ad platforms.

Example: Meta Purchase Event

  1. Navigate to IntegrationsConversion Rules
  2. Click Create Rule
  3. Configure rule:
Trigger:
  • Event Name: purchase
  • Event Source: clickfunnels
Action:
  • Platform: Meta Ads
  • Event Type: Purchase
Value Mapping:
  • Use event value from webhook
Now when ClickFunnels sends an order.completed webhook, DATALYR will fire a Purchase event to Meta with the original fbclid.

Event Data Structure

ClickFunnels webhooks create events with this structure:
{
  "event_id": "cf_order_abc123",
  "workspace_id": "uuid",
  "event_name": "purchase",
  "source": "clickfunnels",

  "visitor_id": "original_visitor_id",
  "user_id": "[email protected]",
  "fbclid": "original_fbclid",
  "gclid": "original_gclid",

  "value": 97.00,
  "currency": "USD",

  "event_data": {
    "order_id": "order_abc123",
    "contact_id": "contact_abc123",
    "funnel_id": "funnel_abc123",
    "page_id": "page_abc123",
    "products": [
      {
        "product_id": "prod_123",
        "product_name": "Course Name",
        "quantity": 1,
        "price": 97.00
      }
    ],
    "status": "paid"
  }
}

Attribution Match Rate

DATALYR’s email-based attribution achieves:
  • 95%+ match rate when email is captured before order form
  • 90%+ match rate for cross-device (mobile ad → desktop purchase)
  • 85%+ match rate for 30+ day attribution windows

Maximize Match Rate

Capture email early in the funnel:
// Add to your ClickFunnels page (Custom JS/HTML)
// After email opt-in form
document.getElementById('email-form').addEventListener('submit', function(e) {
  const email = document.getElementById('email').value;

  // Call DATALYR identify
  datalyr.identify({
    email: email
  });
});

// Or use ClickFunnels form submission hook
CF2.Form.on('success', function(formData) {
  if (formData.email) {
    datalyr.identify({
      email: formData.email
    });
  }
});

Value Calculation

DATALYR automatically converts ClickFunnels amounts:
  • Orders: total / 100 or amount / 100 (ClickFunnels uses cents)
  • Subscriptions: recurring_amount / 100 or amount / 100

Deduplication

ClickFunnels may send the same webhook multiple times (retries). DATALYR uses Cloudflare KV to deduplicate:
  1. Extract event.id from webhook
  2. Check if workspace_id:event_id exists in KV
  3. If exists, return 200 OK but skip processing
  4. If new, process and store in KV
This prevents double-counting conversions.

Security

DATALYR validates all ClickFunnels webhooks by:
  1. Verifying event structure matches expected format
  2. Checking required fields are present
  3. Rejecting malformed requests with 400 Bad Request
ClickFunnels does not use signature-based verification, so ensure your webhook URL is kept private.

Troubleshooting

Events have no attribution data

Symptoms: ClickFunnels events appear in Event Stream but fbclid/gclid are null Cause: Email was not captured with datalyr.identify() before order Solution:
  1. Add datalyr.identify({ email }) to email opt-in forms
  2. Add custom JS to ClickFunnels pages to call identify
  3. Ensure identify call happens before order form submission
  4. Test by checking Event Stream for identify events with the same visitor_id

Webhooks not appearing in Event Stream

Symptoms: ClickFunnels order completes but no event in DATALYR Cause: Webhook URL not configured correctly Solution:
  1. Check ClickFunnels webhook settings → verify endpoint URL is correct
  2. Ensure all required events are selected
  3. Check webhook delivery logs in ClickFunnels for errors
  4. Test with a new order

Wrong event value

Symptoms: Event value in DATALYR doesn’t match order total Cause: Currency conversion or order structure Solution:
  1. Check event_data.total in Event Stream
  2. Verify currency is USD (ClickFunnels default)
  3. Check if order includes multiple products
  4. Contact support if amounts are incorrect

DATALYR tracking not working in funnels

Symptoms: No events captured at all from ClickFunnels pages Cause: DATALYR tracking script not installed on funnel pages Solution:
  1. Add DATALYR tracking script to ClickFunnels funnel settings
  2. Navigate to SettingsTracking CodeHead Tracking Code
  3. Paste your DATALYR tracking script
  4. Test by visiting funnel and checking Event Stream

Installing DATALYR on ClickFunnels

To enable email-based attribution, install DATALYR tracking on your funnels:

ClickFunnels Classic

  1. Navigate to funnel settings
  2. Click SettingsTracking Code
  3. Paste DATALYR script in Head Tracking Code
  4. Save changes

ClickFunnels 2.0

  1. Navigate to funnel settings
  2. Click SettingsCustom Code
  3. Paste DATALYR script in Header Code
  4. Save changes

Verify Installation

  1. Visit your funnel with ad parameters: yourfunnel.com?fbclid=test123
  2. Check DATALYR Event Stream
  3. You should see a $page_view event with fbclid

What Happens Next

After webhook events are created:
  1. Postback Worker checks for matching conversion rules
  2. Rules filtered by trigger_event_source: 'clickfunnels'
  3. Conversions fire to Meta, Google, TikTok with original attribution
  4. Ad platforms receive events with fbclid/gclid for optimization

Multi-Step Funnels

For multi-step funnels, capture email on the first opt-in page:
// Page 1: Opt-in form
datalyr.identify({ email: email });

// Page 2-3: Bridge pages (tracking continues with same visitor_id)

// Page 4: Order form (email already linked to session)
// ClickFunnels sends webhook → DATALYR finds attribution automatically

Next Steps