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

# MarketCall integration

> Set up the MarketCall Cometly integration so each call from your pay per call offers is recorded as an event and tied to the ad that drove it.

The MarketCall Cometly integration sends tracked calls from your MarketCall pay per call offers to Cometly. Each call is recorded as an event (an action a person takes on the way to becoming a customer, such as a call, a lead or a purchase), with the payout MarketCall reports saved as the event amount.

This matters because a pay per call sale happens on the phone, where your ad platform cannot see it. Your landing page passes each visitor's Cometly tracking token to MarketCall, and MarketCall sends it back with the call, so each call is attributed to the ad that drove it.

## Before you start

* A MarketCall account with access to pay per call offers.
* A landing page where you can add custom scripts to the `<head>`.
* Access to **Setup** and **Integrations** in your Cometly space.

## Step 1: Configure a campaign in MarketCall

1. Log in to your **MarketCall** account and click **Pay Per Call Offers**.

   ![MarketCall menu with Pay Per Call Offers circled, next to the offers list](https://mintcdn.com/cometly/gJhojf-axy7BVk83/images/integrations/platforms/marketcall/01.webp?fit=max\&auto=format\&n=gJhojf-axy7BVk83\&q=85\&s=c1c501b6324bd8de21f3de52ef8f8e96)

2. Click the offer you want to use. When the offer opens, click **Create a campaign**.

   ![MarketCall offer details with the Create a campaign button circled](https://mintcdn.com/cometly/gJhojf-axy7BVk83/images/integrations/platforms/marketcall/02.webp?fit=max\&auto=format\&n=gJhojf-axy7BVk83\&q=85\&s=b77a890b0a44dcc1aa935e79f5f42fa8)

3. On the **Create a campaign** page:

   * Enter the campaign's name.
   * Click **Get a phone number**.
   * Select your traffic sources.
   * Add advertising materials.
   * Agree to the terms and conditions.
   * Click **Create and submit for moderation** to send the campaign to MarketCall for approval.

   ![MarketCall Create a campaign form with name, type, phone number and traffic sources](https://mintcdn.com/cometly/gJhojf-axy7BVk83/images/integrations/platforms/marketcall/03.webp?fit=max\&auto=format\&n=gJhojf-axy7BVk83\&q=85\&s=2abba5dc2e743c67fca40a5b74e6f384)

   ![Bottom of the MarketCall campaign form with the Create and submit for moderation button](https://mintcdn.com/cometly/gJhojf-axy7BVk83/images/integrations/platforms/marketcall/04.webp?fit=max\&auto=format\&n=gJhojf-axy7BVk83\&q=85\&s=9656d430fbb906a7bd27ebc457309654)

4. In the left menu, click **Call Tracking**, then **Sites**.

   ![MarketCall left menu with Call Tracking expanded and Sites circled](https://mintcdn.com/cometly/gJhojf-axy7BVk83/images/integrations/platforms/marketcall/05.webp?fit=max\&auto=format\&n=gJhojf-axy7BVk83\&q=85\&s=bd3c85cd126308158625196ab4f01fc5)

5. On the **Sites** page, click **Add a Site**.

6. Fill in the **Add a Site** form:

   * Enter your site or landing page URL.
   * Enter the Max Tracking Numbers.
   * Select the session duration.
   * For **Number Substitution**, select **DOM Selector**.
   * For **Phone Number Format**, use `(xxx) xxx-xxxx`.

   > [!WARNING]
   >
   > The number must be displayed on the landing page in this exact format: `(xxx) xxx-xxxx`

   Then click **Add**.

   ![MarketCall Add a Site form with DOM Selector and the custom phone format (xxx) xxx-xxxx](https://mintcdn.com/cometly/gJhojf-axy7BVk83/images/integrations/platforms/marketcall/07.webp?fit=max\&auto=format\&n=gJhojf-axy7BVk83\&q=85\&s=38c1432304ab08578c2acf400cd5f5d4)

7. After the site is added, click its code icon. (To get back to this list, click **Call Tracking**, then **Sites**.)

8. In the popup, select your campaign in the **Campaign** field. MarketCall generates the tracking script. Make sure the **Phone Number Format** is exactly `(xxx) xxx-xxxx`.

   ![MarketCall Calltracking Script Code popup with Campaign, Phone Number Format and the widget code boxed](https://mintcdn.com/cometly/gJhojf-axy7BVk83/images/integrations/platforms/marketcall/09.webp?fit=max\&auto=format\&n=gJhojf-axy7BVk83\&q=85\&s=ac64f7f10d29c969e1b09fdbe963d420)

### Build the script for your landing page

From the script MarketCall generated, take the **site** number and the **campaign** number and put them into the script below, replacing:

* `REPLACE_WITH_SITE_NUMBER`
* `REPLACE_WITH_CAMPAIGN_NUMBER`

The script below calls `cometToken()` and passes the result to MarketCall as the `subid` (see [Comet Token](https://docs.cometly.com/concepts/comet-token.md)).

```html theme={null}
<script>
  (function(w, d, s, o, f) {
    w[o] = w[o] ||
    function() { (w[o].q = w[o].q || []).push(arguments);
    };
    var js = d.createElement(s),
    fjs = d.getElementsByTagName(s)[0];
    js.id = o;
    js.async = 1;
    js.src = f;
    fjs.parentNode.insertBefore(js, fjs);
  })(window, document, 'script', 'mcc', 'https://marketcall.com/js/mc-calltracking.js'); (function() {
    mcc('init', {
      site: REPLACE_WITH_SITE_NUMBER,
      serviceBaseUrl: 'https://www.marketcall.com'
    });
    const tokenValue = cometToken();
    mcc('requestTrackingNumber', {
      campaign: 'REPLACE_WITH_CAMPAIGN_NUMBER',
      selector: [{
        type: 'dom',
        value: "a[href^='tel:']"
      }],
      mask: '(xxx) xxx-xxxx',
      subid: tokenValue
    });
  })();
</script>
```

> [accordion] Here's an example of what the script should look like
>
> **Do not add this script to your landing page. It is only an example.**
>
> ```html theme={null}
> <script>
>   (function(w, d, s, o, f) {
>     w[o] = w[o] ||
>     function() { (w[o].q = w[o].q || []).push(arguments);
>     };
>     var js = d.createElement(s),
>     fjs = d.getElementsByTagName(s)[0];
>     js.id = o;
>     js.async = 1;
>     js.src = f;
>     fjs.parentNode.insertBefore(js, fjs);
>   })(window, document, 'script', 'mcc', 'https://marketcall.com/js/mc-calltracking.js'); (function() {
>     mcc('init', {
>       site: 2152,
>       serviceBaseUrl: 'https://www.marketcall.com'
>     });
>     const tokenValue = cometToken();
>     mcc('requestTrackingNumber', {
>       campaign: '329877',
>       selector: [{
>         type: 'dom',
>         value: "a[href^='tel:']"
>       }],
>       mask: '(xxx) xxx-xxxx',
>       subid: tokenValue
>     });
>   })();
> </script>
> ```

## Step 2: Add the scripts to your landing page

1. Once the script has your **campaign** number and **site** number, open your page builder and add the script to the `<head>` of the page.

   Almost every page builder lets you add custom scripts to a landing page. Check your page builder's documentation if you cannot find where to add them.

2. Now add a second script to the page: the Cometly pixel. In Cometly, click **Setup** in the sidebar and open the step **Install the Cometly pixel**. Under **Install the pixel**, click **Copy Code**. For the full walkthrough, see [Install the pixel](https://docs.cometly.com/getting-started/install-pixel.md).

   ![Install the pixel section of Cometly Setup with the tracking script and a box around the Copy Code button.](https://mintcdn.com/cometly/gJhojf-axy7BVk83/images/integrations/platforms/marketcall/10.webp?fit=max\&auto=format\&n=gJhojf-axy7BVk83\&q=85\&s=6a55a1ac7b5aa2517f3a40fd2e3bc677)

3. Paste the Cometly script **above** the MarketCall script you just added. The Cometly script should be at the very top of the `<head>` code section.

## Step 3: Configure your landing page button

This example uses the ClickFunnels editor. Other page builders have equivalent settings.

1. In the **BUTTON CONFIG** section, add your **Button text**. Use any call to action you like.
2. In the **BUTTON ACTION ON CLICK** section, set the link to `tel:`

The number is added to the button dynamically. After you save the page, test the landing page to make sure the number appears and works.

![ClickFunnels button settings with Button text set to Call Now and the action link set to tel:](https://mintcdn.com/cometly/gJhojf-axy7BVk83/images/integrations/platforms/marketcall/11.webp?fit=max\&auto=format\&n=gJhojf-axy7BVk83\&q=85\&s=0ccc7891cf7f19c44b9864c332239f93)

### Fix a dynamic call number that looks unstyled on the button

In ClickFunnels and other website builders, the dynamic call number sometimes inherits default styles that do not match your button. To fix this, overwrite the styling with CSS.

1. In ClickFunnels, go to **Settings > Show Code > CSS** (or the equivalent custom CSS section in your builder).

   ![ClickFunnels editor with the settings icon and the CSS code tab marked 1 and 2](https://mintcdn.com/cometly/gJhojf-axy7BVk83/images/integrations/platforms/marketcall/12.webp?fit=max\&auto=format\&n=gJhojf-axy7BVk83\&q=85\&s=bcbcc85ab216adad196e49c1f2f36e45)

2. Add custom CSS that targets your button and the dynamic call number text. You can change any of the button styling by editing the CSS below.

Example CSS:

```css theme={null}
/* Restore CF look for the phone button text */
.id-6Z-9WDQAG-2 a.elButton[href^="tel:"] {
  text-decoration: none !important;
  color: var(--style-guide-button-style1-text-color, #fff) !important;

  /* Text styling to avoid the “thinner numbers” issue */
  font-family: var(--style-guide-font-family-content, "Open Sans", sans-serif);
  font-weight: 600;   /* make digits thicker; use 400 if you want normal */
  font-size: 20px;    /* matches CF style-1 */
  line-height: 1;     /* matches CF style-1 */
  letter-spacing: 0;
}

/* Keep text white on states */
.id-6Z-9WDQAG-2 a.elButton[href^="tel:"]:hover,
.id-6Z-9WDQAG-2 a.elButton[href^="tel:"]:active,
.id-6Z-9WDQAG-2 a.elButton[href^="tel:"]:visited {
  color: var(--style-guide-button-style1-text-color, #fff) !important;
}
```

## Step 4: Set up the postback URL that sends calls to Cometly

1. In Cometly, click **Integrations** in the sidebar and open the **MarketCall** card (category **Calls**).

2. On the MarketCall page, click **Activate MarketCall**.

3. Under **Copy the webhook URL**, click **Copy**. This is the postback URL you will paste into MarketCall.

4. Under **Map MarketCall events to Cometly**, choose which Cometly event a MarketCall call should create, then click **Save**. By default, **Call** is mapped to the **Contact** event. To map it to an event of your own, [create a custom event](https://docs.cometly.com/guides/events/custom-events.md) first.

5. Go back to your MarketCall account. In the left menu, click **Automation**, then **Postbacks**.

   ![MarketCall left menu with Automation expanded and Postbacks selected](https://mintcdn.com/cometly/gJhojf-axy7BVk83/images/integrations/platforms/marketcall/15.webp?fit=max\&auto=format\&n=gJhojf-axy7BVk83\&q=85\&s=bf33cabae51591405b4a1269a157bcbc)

6. On the **Postbacks** page, click **Add a Postback**.

7. Configure the postback:

   * **Template**: select **Custom**
   * **Object**: select **Call**
   * **HTTP Method**: select **GET**
   * **Trigger**: select **Status**
   * **Status**: select **All**
   * **Campaign**: select the campaign you configured
   * **Link**: paste the webhook URL you copied from Cometly

   ![MarketCall Adding Postback form set to Custom, Call, GET, Status, All and the campaign](https://mintcdn.com/cometly/gJhojf-axy7BVk83/images/integrations/platforms/marketcall/17.webp?fit=max\&auto=format\&n=gJhojf-axy7BVk83\&q=85\&s=ad9af6e19ef5121b2d6eb5357795836c)

8. Scroll down the page and add these parameters:

   | Parameter | Value | Notes |
   | - | - | - |
   | `subid` | `{subid}` | The value the landing page script set as `subid` |
   | `earn` | `{earn}` | Saved as the event amount |
   | `caller_id` | `{caller_id}` | Saved as the caller's phone number |
   | `calldate_timestamp` | `{calldate_timestamp}` | Used as the event time |

   They should look like this:

   ![MarketCall postback parameters: subid, earn, caller\_id and calldate\_timestamp with matching variables](https://mintcdn.com/cometly/gJhojf-axy7BVk83/images/integrations/platforms/marketcall/18.webp?fit=max\&auto=format\&n=gJhojf-axy7BVk83\&q=85\&s=a908b854b00872b748c0c88545972b57)

9. Scroll to the bottom and click **Create**.

Cometly is now ready to receive and process postbacks from MarketCall.

## Step 5: Add URL parameters to your ads

Use the standard Cometly URL parameters on your ads. To copy them, click **Setup** in the Cometly sidebar, open the step **Add URL parameters to your ads**, choose your ad platform under **Select integration** and click **Copy Parameters**.

For **Meta Ads**, these are the URL parameters to use:

```text theme={null}
comet_source={{site_source_name}}&comet_ad_id={{ad.id}}&comet_placement={{placement}}
```

If you need help with where to add URL parameters in your Meta ads, see [URL parameters](https://docs.cometly.com/getting-started/url-parameters.md).

![Add URL parameters to your ads step in Cometly Setup with Meta Ads selected, the Meta Ads URL parameters shown and a box around the Copy Parameters button.](https://mintcdn.com/cometly/gJhojf-axy7BVk83/images/integrations/platforms/marketcall/20.webp?fit=max\&auto=format\&n=gJhojf-axy7BVk83\&q=85\&s=a652688ffe37e48f68c248f257962a36)

## Check it worked

Visit your landing page and confirm the button shows a phone number, then call it. After MarketCall sends the postback, open **Events Manager** in Cometly 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

### Why are my MarketCall calls not showing up in Cometly?

Cometly only accepts postbacks while the MarketCall integration is activated, and only on the exact webhook URL shown on the MarketCall page in Cometly. Check that the postback **Link** in MarketCall is that URL, copied in full, and that the postback includes the `subid`, `earn`, `caller_id` and `calldate_timestamp` parameters. Then open the **Events Log** tab in **Events Manager** to see whether the call arrived and what its **Status** is.

### Why does the Cometly pixel have to sit above the MarketCall script?

The MarketCall script calls `cometToken()`, a function the Cometly pixel provides. If the pixel has not loaded first, there is no token to pass to MarketCall as the `subid`, so Cometly cannot link the call to the visitor and the ad they clicked.

### Does each Cometly space need its own MarketCall webhook URL?

Yes. The integration is activated per space (a space is one workspace in Cometly, usually one business or website), and each space gets its own webhook URL. Calls sent to a URL are recorded in the space that URL belongs to, so activate MarketCall and create a postback for every space that should receive calls.

## Next steps

* [Understand how events work in Cometly](https://docs.cometly.com/guides/events/how-events-work.md)
* [Learn what the Comet Token is and how it links a call to a visit](https://docs.cometly.com/concepts/comet-token.md)
* [Send your call events back to the ad platforms](https://docs.cometly.com/getting-started/send-conversions.md)
* [Create a custom event for your calls](https://docs.cometly.com/guides/events/custom-events.md)
* [Set up call tracking with the Cometly API instead](https://docs.cometly.com/guides/events/call-tracking.md)

Still have questions or need a hand? We're happy to help. Reach our team at [support@cometly.com](mailto:support@cometly.com).


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