Skip to main content
All CollectionsAdd Events
Setting Up Call Tracking with Cometly
Setting Up Call Tracking with Cometly

Learn how to setup call tracking with Cometly. Track calls and all future actions back to the correct source.

Updated over 2 weeks ago

This guide will walk you through the steps to implement call tracking using the Cometly API. Please note that this is an advanced integration and will require a developer. You'll also need to view the Cometly API documentation for detailed technical instructions.

Overview of Call Tracking Setup

Call tracking ensures that phone calls are attributed to the correct buyer journey in Cometly. This involves capturing the comet_token and linking it to events, such as calls and purchases, in your backend system.

Why This Is Important

  • Cometly uses the comet_token to connect events back to the original user journey.

  • If an email address becomes available later, it will be used for attribution in subsequent events.

  • Storing the comet_token ensures that call tracking remains accurate, even if user details are incomplete during the initial event.


Steps to Set Up Call Tracking

1. Capture the comet_token from the Pixel

Before tracking phone calls, your developer must retrieve the comet_token using the Cometly Pixel installed on your website. This token acts as a unique identifier for the user journey.

Action Required:

  • Ensure the Cometly Pixel is installed on your site.

  • Use your call tracking platform (e.g., Invoca) to capture the comet_token when a call is made.

  • Inject the comet_token into your backend system for future use.


2. Send the First Event (Phone Call)

When a call is made, send the first event using the Cometly API. This event links the phone call to the original buyer journey.

Required Parameters for the First Event:

  • event_name: Use a custom event that you created in Cometly. Learn how to create and setup a custom event.

    • Custom events (events that you create) use an event_name like the examples below:

      • custom_event_1

      • custom_event_2

      • custom_event_3

  • comet_token: The unique token captured from the Pixel.

  • phone: The caller’s phone number.

Example API Payload:

{
"event_name": "custom_event_1",
"comet_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"phone": "+1234567890"
}


3. Send Subsequent Events (e.g., Purchase)

If additional details become available later (e.g., email address, purchase information), you can send a second event to Cometly. This step is critical for accurate attribution of the full buyer journey.

Parameters for the Second Event:

  • event_name: Use a relevant event name like Purchase.

  • comet_token: Include the token stored in your backend system.

  • email: The contact’s email address.

  • phone: The caller’s phone number.

  • amount: The purchase amount.

  • first_name and last_name (or full_name).

Example API Payload:

{
"event_name": "purchase",
"comet_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"email": "customer@example.com",
"phone": "+1234567890",
"amount": "99.99",
"first_name": "John",
"last_name": "Doe"
}


Best Practices for Accurate Tracking

  1. Store the comet_token in Your Backend System
    The comet_token must be saved in your backend system so it can be included in future events, particularly those without an email address.

  2. Transition to Email-Based Attribution
    Once an email address is captured, future events will use the email address as the primary identifier. However, until this point, the comet_token remains essential.

  3. Use the Cometly API for All Events
    Both the first event (e.g., Phone Call) and subsequent events (e.g., Purchase) must be sent using the Cometly API. Refer to the Cometly API documentation for detailed guidance.


Key Notes for Developers

  • The comet_token is the critical link between a user’s activity and their original journey in Cometly.

  • For platforms like Invoca, ensure that the comet_token is captured at the time of the call and passed along in your backend system.

  • Any future events that lack an email address must include the comet_token for proper attribution.


Need Help?

For additional assistance, refer to the Cometly API Documentation or contact our support team. This integration is advanced and may require additional collaboration with your technical team.

Did this answer your question?