Skip to main content

ClickFunnels Integration

ClickFunnels Integration

J
Written by Jorge Rubia

ClickFunnels is a funnel-building platform used by advertisers to create sales flows that capture leads, process purchases, and manage upsells. Integrating ClickFunnels with Aftrad allows you to track every step of the funnel — from the initial click to the final purchase — and receive real-time postback notifications in Aftrad for each conversion event.

The integration works as follows: Aftrad sends a click to ClickFunnels with a unique click_id appended to the offer URL. When a user completes an action inside the funnel (a lead, a purchase, an upsell), ClickFunnels fires a webhook to Aftrad's event endpoint, passing back the click_id and the relevant event data.


Overview

The setup consists of two parts:

  1. Configure the offer in Aftrad — add the click_id macro to the ClickFunnels offer URL so it is passed through on every click

  2. Configure webhooks in ClickFunnels — set up Aftrad's postback endpoint as a webhook destination and select the events to track


Part 1 — Configure the offer in Aftrad

Create or edit the offer in Aftrad and set the ClickFunnels funnel URL as the Tracking URL.

The most important step is appending the click_id macro to the URL so that ClickFunnels receives it and can pass it back in the webhook payload. The parameter name used to pass the click ID is configurable on the ClickFunnels side — a common convention is clickid or rtclickid, but confirm with the advertiser which parameter name their funnel is configured to capture.

A typical tracking URL would look like:

https://your-funnel-domain.com/funnel-page?clickid={click_id}

The {click_id} macro will be replaced by Aftrad with the actual click ID on every click. Make sure the parameter name in the URL matches exactly what is configured in the ClickFunnels funnel form or hidden field.


Part 2 — Configure webhooks in ClickFunnels

In your ClickFunnels account, go to Workspace Settings → Webhooks and click Add New Endpoint.

Configure the webhook as follows:

  • Name — a descriptive name, e.g. Aftrad postback

  • URL — Aftrad's event endpoint for this advertiser:

    https://[your-event-domain]/api/v1/events?click_id={contact.custom_attributes.clickid}&event_parameter=[event_name]&payout=[amount]

    Replace [your-event-domain] with the event domain configured for the advertiser in Aftrad. See the event mapping table below for the values to use per event.

  • Event types — select the events you want to track (see below)

  • API Version — use V2 (V1 is deprecated and no longer updated)

Click Create endpoint to save.

For ClickFunnels Classic (1.0), webhooks are configured per funnel via Funnel Settings → Webhooks → Manage Your Funnel Webhooks. The event names differ slightly — use contact_created, purchase_created, and purchase_updated.


ClickFunnels events and Aftrad mapping

The following are the ClickFunnels webhook events relevant to performance tracking, and how they map to Aftrad payout rules:

ClickFunnels event (V2)

What it means

Suggested event_parameter in Aftrad

contact.created

A user submitted a form (lead / opt-in)

lead

contact.identified

A contact was identified by email or phone

lead

order.created

A new order was placed (purchase)

purchase

order.completed

An order was fully paid and completed

purchase

order.refunded

An order was refunded

refund

upsell.created (Classic)

A user accepted an upsell offer

upsell

form_submission.created

A form was submitted on a funnel page

lead

For ClickFunnels Classic, the equivalent events are contact_created (lead), purchase_created (purchase), and purchase_updated (purchase status update). ClickFunnels Classic supports three main event types for webhook tracking: Lead (form submission), Purchase (completed payment), and Upsell (accepted upsell Offer).


Payout rules in Aftrad

In the offer's Payouts & Events tab, create one payout rule per ClickFunnels event you want to track. The Parameter value for Event type must match the event_parameter value you configured in the webhook URL for each event.

ClickFunnels action

Parameter value for Event type

Lead / opt-in

lead

Purchase

purchase

Upsell

upsell

Refund

refund


Notes

click_id capture in ClickFunnels. For the click ID to be passed back in the webhook, ClickFunnels must capture it from the URL and store it — either as a hidden form field or as a custom contact attribute. This is typically done by adding a hidden input field with the parameter name matching the URL parameter (e.g. clickid), or by using ClickFunnels' built-in URL parameter capture feature. Confirm the setup with the advertiser or their developer.

Webhook retries. ClickFunnels automatically retries failed webhook deliveries. You can view delivery attempts and response codes in Workspace Settings → Webhooks → [your endpoint] → Deliveries.

V1 webhooks (Classic). ClickFunnels discourages the use of V1 webhooks — no new webhooks are launched in the V1 version, and existing V1 webhooks are not updated with new functionality. If you are on ClickFunnels Classic, use V2 webhooks where possible.


Related articles

Did this answer your question?