Tracking phone calls is essential for understanding how your ads and marketing efforts generate revenue. By integrating CallRail with Cometly, you can capture conversion events from calls and enrich them with Cometly’s tracking token for better attribution.
This guide walks you through the setup process step by step.
Step 1: Add the Cometly Script to <head> tag of your Website
Log in to your website hosting platform (e.g., WordPress, Webflow, etc).
Navigate to your global header/footer script section (commonly managed via plugins like Header Footer Code Snippets).
Paste the Cometly tracking script in the <head>, and ensure it’s installed on every page of your site.
Step 2: Add the CallRail Script after the Cometly Script
Place the following Snippet of code after the Cometly script in the <head>
<script>
(function () {
try {
if (typeof cometToken === "function") {
var token = cometToken();
if (token) {
var d = new Date();
d.setTime(d.getTime() + 180*24*60*60*1000); // 180 days
document.cookie = "comet_token=" + encodeURIComponent(token) + "; path=/; expires=" + d.toUTCString();
}
}
} catch (e) { /* fail silently */ }
})();
</script>
This ensures Cometly creates "Comet Tokens" across your site before CallRail pulls in call data.
Step 3: Capture the Cometly Token in CallRail
Inside CallRail, go to Integrations → Library → Custom Cookie Capture.
2. Create a new custom cookie.
Name it something clear, such as Comet Token.
3. This cookie will automatically capture the Cometly tracking token when visitors land on your site.
Step 4: Set Up a Webhook in CallRail
Go to Integrations → Library → Webhooks in CallRail.
Create a new Post-Call Webhook.
Connect this webhook to Cometly’s Events Manager so call events are pushed into your Cometly account.
First create the Webhook in Cometly, and give it a clear name like "Phone Calls from Call Rail"
Copy and paste the webhook you've created and Cometly into the Post-Call Webhook in CallRail, in the Webhook URL section
Save the changes and publish the webhook in CallRail
Step 5: Map the Token in Cometly
In Cometly, open Events Manager.
Locate the Phone Calls from CallRail event you created via webhook.
Click the Configure Button
Select the most recent payload event and Click Continue
Search for your custom cookie field (you should have already given this a clear name, i.e. Comet Token).
Map it to the Cometly field for "Comet Token".
Now, when a call comes in from a tracked source (like Google Ads), Cometly will attribute it correctly to the ad or campaign that drove the call.
Step 6: Confirm Your Call Tracking Setup
Place a test call through a CallRail tracking number tied to a Google Ad or even a direct visit to your landing page.
Check Cometly’s Events Log to confirm the call event appears with the correct token attached.
Notes on Subscription Levels
CallRail features like Webhooks and Custom Cookie Capture are available as add-ons.
While these may be included in standard or premium packages, verify that your CallRail plan supports them.
Why This Matters
By connecting CallRail with Cometly:
You can track inbound calls back to the original ad campaign.
Calls from channels like Google and Facebook are properly attributed in Cometly.