Skip to main content
CallRail call tracking in Cometly sends each call from your CallRail account to Cometly as an event (an action a person takes on the way to becoming a customer). This guide also attaches the Comet Token, the identifier the Cometly pixel gives each visitor, to every call, so Cometly can attribute the call to the visit that led to it. Tracking phone calls shows you which ads and campaigns generate revenue over the phone. Once CallRail is connected, you can trace an inbound call back to the original ad campaign, and calls from channels like Google and Meta are attributed in Cometly alongside your other conversions.

Before you start

  • You can edit the <head> of your website (for example with a header and footer scripts plugin).
  • Your CallRail plan supports Webhooks and Custom Cookie Capture. CallRail offers these features as add-ons. They may be included in standard or premium packages, so verify that your plan has them.

Set up CallRail tracking

1

Add the Cometly pixel to the head of your website

  1. In Cometly, go to Setup and open the step Install the Cometly pixel. Under Install the pixel, click Copy Code.
  2. Log in to your website platform (for example WordPress or Webflow).
  3. Go to your global header and footer script section (often managed by a plugin such as Header Footer Code Snippets).
  4. Paste the Cometly pixel in the <head>, and make sure it is installed on every page of your site.
For other ways to install it, see Install the Cometly pixel.
Cometly Setup page on the step Install the Cometly pixel, with marker 1 and an arrow on Setup in the sidebar and marker 2 with a box around the Copy Code button below the pixel snippet.
2

Add the cookie snippet after the Cometly pixel

Place the following snippet after the Cometly pixel in the <head>:
The snippet reads the visitor’s Comet Token from the pixel and saves it in a cookie named comet_token, so CallRail can pick it up with the call data.
3

Capture the Comet Token in CallRail

  1. In CallRail, go to Integrations → Library → Custom Cookie Capture.
  2. Create a new custom cookie and name it comet_token.
This cookie captures the Comet Token when visitors land on your site.
4

Send CallRail calls to Cometly with a webhook

First create the event and its webhook URL in Cometly:
  1. In Cometly, go to Events Manager and click Create Event.
  2. Under App / Integration, select Webhooks.
  3. Pick the event name, or choose Create New Event and give it a clear name such as “Phone Calls from CallRail”. Click Create.
  4. Under Your webhook URL, click Copy.
Receive Data step for the event Phone Calls from CallRail, showing Your webhook URL with a box around the Copy button, and the Check for Data button below.
Then add the URL in CallRail:
  1. In CallRail, go to Integrations → Library → Webhooks.
  2. Paste the Cometly webhook URL into the Post-Call Webhook, in the Webhook URL section.
  3. Save the changes and publish the webhook in CallRail.
CallRail is also in the App / Integration list. If you select it instead of Webhooks, you connect a CallRail account with an API key (in CallRail: Settings > API > Manage API Credentials), choose the Post-Call trigger and click Continue. Cometly then adds its webhook URL to your CallRail webhooks for you, so you skip the CallRail part of this step. The other steps stay the same.
5

Map the Comet Token in Cometly

  1. In Cometly, open Events Manager.
  2. Find the event you created in the previous step and click Configure.
  3. Click Check for Data, select the most recent record and click Continue With Selected Record. If no record shows up yet, place a test call (see the next step) and check again.
  4. On the mapping step, click Add Field and choose Comet Token under Cometly Fields.
  5. Under Data Fields, search for your custom cookie field (custom.comet_token in the example below) and select it.
  6. Map the remaining fields (the page requires Email and Event Time), then click Save & Continue and finish the setup.
Mapping row with the Cometly field Comet Token mapped to the data field custom.comet_token, with a sample token value and a delete icon.
Now, when a call comes in from a tracked source (such as Google Ads), Cometly attributes it to the ad or campaign that drove the call.
6

Confirm your call tracking setup

  • Place a test call to a CallRail tracking number, after clicking a Google ad or visiting your landing page directly.
  • In Cometly, open Events Manager and the Events Log tab to confirm the call event appears with the token attached.

Check it worked

After your test call, the call event is listed in Events Manager, on the Events Log tab, with the Comet Token attached. From then on, a call from a tracked source (such as Google Ads) is attributed to the ad or campaign that drove it.

Frequently asked questions

Do I need a developer to connect CallRail to Cometly?

No. The CallRail setup does not use the Cometly API. You need to be able to paste the Cometly pixel and the cookie snippet into the <head> of your website, and to change settings in CallRail and Cometly.

How long is the Comet Token kept for a visitor who calls later?

The cookie snippet on this page saves the Comet Token in the comet_token cookie for 180 days. The snippet only saves it when the Cometly pixel has loaded first, which is why it must be placed after the pixel.

Which CallRail call events can Cometly receive?

This guide uses CallRail’s Post-Call Webhook, which fires when a call has ended. If you connect a CallRail account by selecting CallRail under App / Integration, you can choose from four triggers: Pre-Call, Call Routing Complete, Post-Call and Call Modified.

Next steps

Still have questions or need a hand? We’re happy to help. Reach our team at support@cometly.com.