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

# CallRail and ClickFlare Integration Guide

> Track CallRail calls in ClickFlare: read the click ID from the call's landing page URL and relay CallRail's webhook to the ClickFlare postback.

![CallRail and ClickFlare Integration](https://mintcdn.com/clickflare/gS923ib4WFySqxSL/images/integrations/covers/callrail.png?fit=max\&auto=format\&n=gS923ib4WFySqxSL\&q=85\&s=46a6a9b8dd7693f5a6ac56fa8c458b29)

CallRail is a call tracking and analytics platform. Its **Website (Session)** trackers show each website visitor their own number from a pool, and record the page the caller first landed on, including the URL parameters. That URL is how the ClickFlare click ID gets onto the call.

The way back is less direct. CallRail webhooks send the whole call as a **JSON POST** with CallRail's own field names, and you can't change that body. ClickFlare needs its own keys: `click_id`, `payout`, `txid`, `ct`. So a small **relay** sits in between: Zapier, Make, n8n or a short script receives CallRail's webhook, picks out the fields and calls the ClickFlare postback.

* **Into CallRail:** your lander URL carries `cf_click_id={cf_click_id}`. CallRail stores the URL with the call as `landing_page_url`.
* **Back to ClickFlare:** CallRail's webhook → your relay → ClickFlare postback with the click ID, the call value and CallRail's call ID.

***

## At a glance

To set up CallRail with ClickFlare:

1. Create custom conversions for calls.
2. Add the lander as the offer.
3. Track the lander with a session tracker.
4. Create the relay.
5. Point a CallRail webhook at it.

Each step is explained in [Setup](#setup).

| | CallRail + ClickFlare |
| - | - |
| **How it connects** | CallRail webhook, relayed to the ClickFlare postback |
| **What reaches ClickFlare** | Calls, call value, lead status, call ID |
| **Timing** | Post-Call fires up to 20 min after hangup |
| **Key parameters** | `cf_click_id={cf_click_id}`, `landing_page_url`, `id`, `value`, `lead_status` |
| **Works with** | Website (Session) trackers on your lander |
| **Good to know** | CallRail doesn't resend failed webhooks. Keep the relay up. |

***

## How the data flows

```text theme={null}
Ad click
  → https://trk.yourdomain.com/cf/r/CAMPAIGN?...
     (ClickFlare records the click and generates the click ID)
  → https://your-lander.com/?cf_click_id=CF_CLICK_ID
     (CallRail's website code swaps in a session tracking number)
  → Visitor calls. CallRail saves landing_page_url with the call.
  → Call ends → CallRail Post-Call webhook (POST, JSON) → your relay
  → Relay reads cf_click_id from landing_page_url, plus id, value, lead_status
  → Relay calls:
     https://trk.yourdomain.com/cf/cv?click_id=CF_CLICK_ID&payout=40&txid=CALLRAIL_ID&ct=call
     (ClickFlare matches the call to the original click)
```

| Step | Who does it | What carries the click ID |
| - | - | - |
| Ad → lander | ClickFlare | `cf_click_id={cf_click_id}` in the offer URL |
| Lander → call | CallRail session tracker | `landing_page_url` on the call |
| Call → webhook | CallRail | The call object as JSON in the POST body |
| Webhook → ClickFlare | Your relay | `click_id` in the ClickFlare postback |

***

## What you'll need

* A ClickFlare account with your **own tracking domain**. See [Tracking domains](/docs/en/settings/tracking-domains.md).
* A CallRail account with a **Website (Session)** tracker for the lander, and CallRail's website tracking code on the lander. Only calls to session trackers carry `landing_page_url`.
* A **relay** that can receive a JSON POST and send an HTTP request: a Zapier, Make or n8n workflow, or a script on your own server or a serverless function.

***

## Setup

**1. Set up your own tracking domain**

Add a custom tracking domain first, for example `trk.yourdomain.com`. Your relay calls the postback on this domain. See [Tracking domains](/docs/en/settings/tracking-domains.md).

**2. Create custom conversions for calls**

Go to **Settings → Custom Conversions** and add the call types you want to count, for example `call` for every answered call and `good_lead_call` for qualified calls. Your relay sends one of these as `ct`, so the spelling must match. See [Custom conversions](/docs/en/settings/custom-conversions.md).

**3. Create the campaign and add the lander as the offer**

Go to **Campaigns → New Campaign**, choose **Redirect tracking**, pick your traffic source and your tracking domain. See [Creating a campaign](/docs/en/campaigns/creating-a-campaign-in-click-flare.md).

In the campaign path, create an offer for the page that shows your CallRail number, with the click ID in its URL:

```text theme={null}
https://your-lander.com/?cf_click_id={cf_click_id}
```

Set the payout to **Auto** so ClickFlare uses the `payout` your relay sends. Keep the braces in `{cf_click_id}`.

**4. Track the lander with a Website (Session) tracker**

In CallRail, make sure the lander's number is swapped by a **Website (Session)** tracker, and that CallRail's tracking code is on the page. Session trackers serve one number from a pool per visitor, so each call can be tied to one visit.

Size the pool for the number of visitors on the lander at the same time. A visitor who doesn't get a pool number can't be tied to a click.

**5. Create the relay**

Build the workflow or script first, so you have its URL for CallRail. It must:

1. Accept a POST with a JSON body and answer **2xx** quickly.
2. Read the fields in [Map CallRail fields to ClickFlare](#map-callrail-fields-to-clickflare).
3. Call the ClickFlare postback.

No-code options: [Zapier](/docs/en/integrations/zapier-click-flare-integration-guide.md), [Make](/docs/en/integrations/make-click-flare-integration-guide.md), [n8n](/docs/en/integrations/n8n-click-flare-integration-guide.md). Each starts with a webhook trigger that gives you a URL, then an HTTP request step to ClickFlare. A code example is in [Relay script example](#relay-script-example).

**6. Point a CallRail webhook at the relay**

Create a webhook in your CallRail account with the relay URL, and select the **Post-Call** event. Add **Call Modified** too if you qualify or value calls after they end.

You can also create it through CallRail's API, as an integration of type `Webhooks` with `post_call_webhook` and `updated_call_webhook` in its config. A company can have only one Webhooks integration, but each event takes a list of URLs, so your relay can sit next to existing webhooks.

**7. Launch**

Save the ClickFlare campaign, copy the campaign URL from the **Tracking** tab and use it in your ads. Run [Verify the setup](#verify-the-setup) first.

***

## Map CallRail fields to ClickFlare

CallRail's webhook body is the call object from its API. These are the fields the relay needs:

| CallRail field | What it holds | ClickFlare key | What the relay does |
| - | - | - | - |
| `landing_page_url` | The URL the caller first landed on (session trackers only) | `click_id` | Read the `cf_click_id` query parameter from it |
| `id` | CallRail's unique ID for the call | `txid` | Send as is |
| `value` | The call's value, set in CallRail. Can be `"$1.00"`, `"1.00"` or empty | `payout` | Strip `$` and commas, send a number, or `0` when empty |
| `lead_status` | `good_lead`, `not_a_lead`, `previously_marked_good_lead` or empty | `ct` or a filter | Choose the conversion type, or skip calls that aren't leads |
| `tags`, `source_name`, `gclid` | Tags, source and Google click ID | `param1`…`param20` | Optional extra values |

Send the postback as a GET:

```text theme={null}
https://trk.yourdomain.com/cf/cv?click_id=CF_CLICK_ID&payout=40&txid=CALLRAIL_ID&ct=good_lead_call
```

> [!TIP]
>
> ClickFlare also accepts a JSON POST to `https://trk.yourdomain.com/cf/cv` with the keys `cf_click_id`, `payout`, `txid`, `ct` and `param1`…`param20`, for example `{"cf_click_id": "CF_CLICK_ID", "payout": 40, "txid": "CALLRAIL_ID", "ct": "good_lead_call"}`. Either form works. Whichever you use, send CallRail's `id` as `txid` so the same call doesn't count twice.

### Relay script example

A minimal Node.js relay. Adapt it to your server or serverless platform:

```js theme={null}
// Receives CallRail's Post-Call and Call Modified webhooks
app.post('/callrail', express.json(), async (req, res) => {
  res.sendStatus(200); // answer CallRail first

  const call = req.body;
  if (!call.landing_page_url) return; // not a session-tracked call

  const clickId = new URL(call.landing_page_url).searchParams.get('cf_click_id');
  if (!clickId) return; // visit didn't come through ClickFlare

  if (call.lead_status !== 'good_lead') return; // optional: qualified calls only

  const payout = parseFloat(String(call.value || '0').replace(/[$,]/g, '')) || 0;

  const postback = new URL('https://trk.yourdomain.com/cf/cv');
  postback.search = new URLSearchParams({
    click_id: clickId,
    payout: String(payout),
    txid: String(call.id),
    ct: 'good_lead_call',
  });
  await fetch(postback);
});
```

CallRail signs every webhook. It sends a `Signature` header: a Base64 HMAC-SHA1 of the request body, made with your company's signing key from the webhooks page. Check it in your relay if the URL is public.

***

## Post-Call or Call Modified

| CallRail event | When it fires | Use it for |
| - | - | - |
| **Post-Call** | After an inbound call ends and its recording, transcription and summary are attached. At most 20 minutes after hangup. | Counting calls as they happen |
| **Call Modified** | When a call changes after it ended: tags, note, value, transcription, summary, recording, scores. Also when a call is marked as spam. Its `changes` field lists what changed. | Values and qualifications you add later |

With both events on, the same call can reach the relay several times. Send CallRail's `id` as `txid` every time: ClickFlare keeps one conversion per click ID and txid, and a later postback replaces the earlier one. A changed value then updates the conversion instead of adding a second one.

> [!WARNING]
>
> CallRail doesn't resend failed webhooks, and repeated failures can disable the webhook integration. Keep the relay up, answer with a 2xx status, and do the ClickFlare call after answering.

### Good leads only

If you only want qualified calls in ClickFlare, filter on `lead_status` in the relay. If you want both, send every call with `ct=call` and good leads with `ct=good_lead_call`, as two postbacks with different txids, for example `CALLRAIL_ID` and `CALLRAIL_ID-lead`.

How a call gets its lead status depends on your CallRail setup and plan. Check on a test call that the event you rely on, Post-Call or Call Modified, carries the status you expect.

***

## Verify the setup

**1. Click through the campaign**

Open the ClickFlare campaign URL. On the lander, the address bar must show `cf_click_id=` followed by a real click ID, and the number must be a CallRail session number.

**2. Place a test call**

Call the number. Wait for the Post-Call webhook, up to 20 minutes after you hang up.

**3. Check the call in CallRail**

Open the call and check the landing page shows your lander URL with `cf_click_id`.

**4. Check the relay and ClickFlare**

Check your relay's run history for the incoming call and the request it sent. In ClickFlare, the conversion should show on the campaign. In **Logs → Event Logs**, check the `txid` is CallRail's call ID.

***

## Troubleshooting

> [accordion] landing\_page\_url is empty
>
> The call came to a tracker that isn't a Website (Session) tracker, the tracking code isn't on the lander, or the visitor saw a static number because the pool was busy. Only session-tracked calls carry the landing page.

> [accordion] The relay never receives anything
>
> * Check the webhook URL in CallRail and the events selected on it.
> * Wait the full 20 minutes for Post-Call.
> * If earlier requests failed, CallRail may have disabled the webhook integration. Fix the relay, then check the integration is active.

> [accordion] The relay runs but ClickFlare shows nothing
>
> * Log the postback URL the relay builds. `click_id` must be the real click ID, not empty.
> * `ct` must match a custom conversion exactly.
> * If you used the JSON POST, the key is `cf_click_id`, not `click_id`, and the `Content-Type` header must be `application/json`.
>
> See [Troubleshooting S2S postbacks](/docs/en/tracking/troubleshooting-s2s-postback-url-in-clickflare.md).

> [accordion] The same call counts twice
>
> The relay doesn't send `txid`, or sends a different value each time. Send CallRail's `id`.

> [accordion] The click ID belongs to an older visit
>
> `landing_page_url` is the URL the caller **first** landed on. CallRail keeps the visitor's source in a cookie, so a returning visitor's call can carry the click ID of their first visit. ClickFlare then credits the first click.

***

## FAQ

> [accordion] Does ClickFlare integrate with CallRail?
>
> Yes, through ClickFlare's S2S postback. CallRail saves the click ID in the call's landing page URL, and a relay turns CallRail's webhook into a ClickFlare postback.

> [accordion] Why can't CallRail post straight to ClickFlare?
>
> CallRail's webhook body is fixed: CallRail's call object, with its own field names. ClickFlare's JSON POST needs `cf_click_id`, `payout` and `ct` as top-level keys, and the click ID is inside a URL in CallRail's body. Something has to extract and rename it.

> [accordion] Can I use CallRail's query string parameters instead of the JSON?
>
> CallRail still sends some fields in the query string for its legacy API, but recommends parsing the JSON body and ignoring the query string. New fields are only added to the JSON.

> [accordion] Can I pass the call duration or source?
>
> Yes. Map any CallRail field to `param1`…`param20` in the relay, for example `duration` or `source_name`.

> [accordion] What about form submissions?
>
> CallRail also has a **Form Submission** webhook event. The same relay pattern works with a different `ct`, if the form submission carries the landing page in your account. Check one payload before building on it.

> [accordion] Can I send the call to my traffic source?
>
> Yes. Once ClickFlare records the call, it can pass it to the traffic source through that source's postback or conversion API integration.

***

## Related

> [card] [Zapier](/docs/en/integrations/zapier-click-flare-integration-guide.md)
>
> No-code relay

> [card] [Custom conversions](/docs/en/settings/custom-conversions.md)
>
> One ct per call type

> [card] [Postback parameters](/docs/en/tracking/click-flare-parameters-in-postback-urls.md)
>
> click\_id, txid, ct


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