Skip to main content
The CallTrackingMetrics Cometly integration records phone calls from CallTrackingMetrics as events in Cometly (an event is an action a person takes on the way to becoming a customer, such as a call, a lead or a purchase). You pass your Cometly tracking token (comet_token, the ID Cometly gives each visitor) into CallTrackingMetrics, then send call webhooks back to Cometly. This matters when leads phone you instead of filling in a form. When CallTrackingMetrics sends the comet_token with each call, Cometly can match the call back to the ads and traffic sources that generated it, so you can see which campaigns make the phone ring.
Cometly only records a call when the webhook includes the comet_token custom field. Calls that arrive without it are rejected, so complete every step below.

Prerequisites

Before you start, make sure:
  • You have admin rights in CallTrackingMetrics.
  • Your CallTrackingMetrics account is on a Marketing Pro plan or higher.

Step 1: Buy a tracking number

  1. Log in to your CallTrackingMetrics account.
  2. In the left-hand menu, click Numbers, then Tracking Numbers.
    CallTrackingMetrics Numbers menu with Tracking Numbers circled
  3. Click the Buy Numbers button.
  4. Select a number and click the + icon.
  5. Click Confirm & Purchase to complete your purchase.

Step 2: Create a target number

  1. Go to Numbers, then Target Numbers.
    CallTrackingMetrics Numbers menu with Target Numbers circled
  2. Click New Target Number.
  3. In the Target Number field, enter the phone number displayed on your landing page. CallTrackingMetrics replaces this number dynamically.
  4. Set Match Type to Phone Match.
  5. Click Save Changes.

Step 3: Create a tracking source

  1. Go to Numbers, then Tracking Sources.
    CallTrackingMetrics Numbers menu with Tracking Sources circled
  2. Click New Tracking Source.
  3. In the General section:
    • Enter a Tracking Source Name.
    • Toggle Onsite (dynamic) on.
    • Click Save Changes.
    Tracking source General section with the name, Onsite (dynamic) toggle and Save Changes circled
  4. In the Matching Conditions section, open the Landing URL tab:
    • Enter your landing page URL.
    • Click Save Changes.

Step 4: Install the tracking code

  1. Go to Numbers, then Tracking Code.
    CallTrackingMetrics Numbers menu with Tracking Code circled
  2. Copy your Tracking Code Script and paste it into the <head> section of your landing page.
  3. Scroll down to Advanced Options, then expand the Custom Tracking Code section.
  4. Paste the script below into the Custom Tracking Code box. Replace YOUR-COMETLY-PIXEL-HERE with the src URL of your Cometly pixel. To find it, go to Setup in Cometly, open the Install the Cometly pixel step, and copy the URL inside src="..." from the code under Install the pixel. See Install the pixel for details.
    This script makes sure each call session captures the visitor’s Cometly tracking token (comet_token), which Cometly needs to attribute the call.
  5. Click Save Changes.

Step 5: Create a custom field for the Comet token

  1. Go to Settings, then Custom Fields.
    CallTrackingMetrics Settings menu with Custom Fields circled
  2. Under the Contact section, click Add Field.
  3. Enter the following details:
    • Field Name: Comet token
    • Type: Text
    • Save to: Activity
    • Check Log Visible
    Custom field named Comet token, type Text, saved to Activity, with Log Visible checked
    Check that the API Name shown under the field is comet_token. Cometly reads the token from the custom field with that API name.
  4. Click Save Changes.

Step 6: Add an Update Field action

  1. After saving the field, click Add Action.
  2. Select Update Field.
  3. In the fields list, select Comet token.
  4. Under Set value to, select Session.
  5. Enter _comet_token as the value.
    Update Field action setting Comet token to the Session value _comet_token
  6. Click Save Changes.

Step 7: Create a trigger

  1. Go to Flows, then Triggers.
    CallTrackingMetrics Flows menu with Triggers circled
  2. Click New Trigger.
  3. In the General section:
    • Enter a name for the trigger.
    • Set Trigger to When a website session is associated to the activity record.
    • Toggle Trigger for all Activities on.
    • Click Save Changes.
    Trigger General section with the name, trigger type, Trigger for all Activities and Save Changes circled
  4. In the Workflow section:
    • Click + Add Workflow.
    • Remove the default rule (trash icon).
    • Click Add Action and select Update Field.
    • Fill in the fields the same way as in step 6 (Comet token, Session, _comet_token).
    • Click Save Changes.

Step 8: Activate CallTrackingMetrics in Cometly

  1. Log in to Cometly.
  2. Click Integrations in the sidebar, select the Calls category, and click Connect on the CallTrackingMetrics card.
    The Cometly Apps & Integrations page with the Calls category boxed in the category list and the CallTrackingMetrics card with its Connect button boxed.
  3. Click Activate CallTrackingMetrics.
    The CallTrackingMetrics integration page in Cometly before activation, with a box around the Activate CallTrackingMetrics button in step 1 and the Setup Instructions panel on the right.
  4. After activation, the page shows two webhook URLs under Copy the webhook URLs:
    • Call Started
    • Call Answered
    Click Copy next to the webhook URL of each event type you want to track.
    The CallTrackingMetrics integration page in Cometly after activation, showing the Call Started and Call Answered webhook URLs with a box around each Copy button and an event mapping set to Contact with a Save button under each.
  5. Under each webhook URL you plan to use, pick the Cometly event the call should be recorded as in the Cometly Events dropdown, then click Save. The dropdown starts on Contact. Click Save even if you keep Contact, so the mapping is stored.

Step 9: Create webhooks in CallTrackingMetrics

  1. In CallTrackingMetrics, go to Settings, then Webhooks.
    CallTrackingMetrics Settings menu with Webhooks circled
  2. Click New Webhook.
  3. Enter a name for your webhook.
  4. Choose a trigger:
    • For Call Started, select When an activity is received [start].
    • For Call Answered, select When an agent answers a call queue [answered].
  5. In the Connection section:
    • Paste the matching webhook URL you copied from Cometly.
    • Set Request Body Type to Log Data.
    • Click Save Changes.
  6. Repeat for the other event type if you want to track both.

Check it worked

Visit your landing page, then call the tracking number it shows. In Cometly, open Events Manager and click the Events Log tab, with Source set to Server. The call appears in the log under the Cometly event you mapped it to.

Frequently asked questions

Do I need both the Call Started and Call Answered webhooks in CallTrackingMetrics?

No. Each webhook URL works on its own, so you only create a webhook in CallTrackingMetrics for the event types you want to track. Use Call Started to record a call as soon as it comes in, and Call Answered to record a call when an agent answers it.

Which Cometly event is a CallTrackingMetrics call recorded as?

By default, both Call Started and Call Answered are recorded as a Contact event. To use a different event, pick it in the Cometly Events dropdown under the webhook URL on the CallTrackingMetrics page in Cometly, then click Save.

What call data does CallTrackingMetrics send to Cometly?

Cometly reads the comet_token custom field, the caller’s name, the caller’s phone number and the time of the call from each webhook. The token links the call to the visitor’s journey, and the name and phone number are saved with the event.

Next steps

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