> ## 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.

# BuyGoods integration

> Set up the BuyGoods Cometly integration to track each BuyGoods purchase and upsell back to the ad that produced it, then send those sales to Meta.

The BuyGoods Cometly integration connects your BuyGoods affiliate account to Cometly. BuyGoods sends each purchase to Cometly through a Postback URL, and the Cometly pixel (a small tracking script) records the visitors who reach your VSL and your checkout.

With both in place, you can see which ad produced each BuyGoods sale, upsell and commission, next to your ad spend in the Cometly Ads Manager. Cometly can also send those purchases back to Meta, so the ad platform knows which ads lead to sales.

Read through every step, in order, to make sure Cometly is tracking correctly. Each step has a video, and the written steps cover the same ground.

> [!WARNING]
>
> **Important:** BuyGoods has a specific setup and uses specific URL parameters that differ from the standard Cometly setup. Ignore the general steps on the **Setup** page in Cometly (you only go there to copy your pixel) and follow this page step by step.

If you run into issues after completing the setup, see [Troubleshooting BuyGoods integration setup](#troubleshooting-buygoods-integration-setup) at the bottom of this page for common solutions.

## Understand the metrics you will track

The table below shows how Cometly tracks key BuyGoods metrics.

| BuyGoods metric | Cometly metric |
| - | - |
| Visitors | View Content |
| Checkouts | Initiate Checkout |
| Purchase | Purchase |
| (none) | LP CTR (landing page click-through rate) |

* **View Content**: visitors that visit your BuyGoods VSL/TSL.
* **Initiate Checkout**: visitors that reach your BuyGoods checkout.
* **Purchase**: visitors who purchased, and your commission amount.
* **Upsell Purchase**: the number of purchases that are upsells during checkout.
* **Upsell Revenue**: the revenue generated from upsells in your funnel, or when buyers add extra items to their purchase. Upsell Revenue is a subset of your total sales revenue and is automatically included in Gross Revenue.
* **Cost Per Upsell**: the average ad spend required to generate one upsell purchase. It is the total amount spent on ads divided by the number of upsell purchases.
* **LP CTR**: landing page click-through rate. It is the total number of View Content events divided by the number of link clicks.

> [!NOTE]
>
> **Pro tip:** Now that you know which metrics you will use in Cometly, [configure your Ads Manager](https://docs.cometly.com/guides/ads-manager/overview.md) to show them.

## Step 1: Add the Cometly Postback URL to BuyGoods

In this step you get the BuyGoods Postback URL from Cometly and add it to your BuyGoods account.

In Cometly, click **Events Manager** in the sidebar, then click **Create Event**.

Select **BuyGoods** under **App / Integration** and click **Integrate**. (You can also open the **BuyGoods** card on the **Integrations** page.)

Click **Activate BuyGoods**.

Under **Copy the Postback URL**, click **Copy**.

Log in to your BuyGoods account and go to your **AffOverview** page:

```text theme={null}
https://backoffice.buygoods.com/affoverview
```

On that page, click your name in the top right corner, then click **Postback Pixels**.

On the Postback pixels page, click **Add new**.

Paste the Cometly Postback URL, make sure **Status** is **Active** and **Event** is **Purchase**, then click **Save**.

> [!WARNING]
>
> Do NOT set up a postback pixel in the settings of a specific offer, or purchases will fire twice. Only add it on the main AffOverview page as described above.

## Step 2: Add scripts to your landing page

Add the scripts below to your landing page. You can use any landing page builder as long as it lets you add scripts to the `<head>` and to the `<footer>` or `<body>` of the page. In this step you also edit your offer URL to set up the BuyGoods conversion API.

If you use Hero AI landing pages, follow the [Hero AI setup page](https://docs.cometly.com/integrations/pixel/hero-ai.md) instead.

[Step 2: Add scripts to your landing page](https://www.loom.com/embed/66a90a627e4648c3934d630bf1685ccc)

If you use ClickFunnels for your landing page, open the editor for the funnel step and click **Settings** > **Tracking Code**.

![ClickFunnels editor Settings menu with an arrow pointing to Tracking Code](https://mintcdn.com/cometly/2fSDFk1g6ELl9hsV/images/integrations/platforms/buygoods/08.webp?fit=max\&auto=format\&n=2fSDFk1g6ELl9hsV\&q=85\&s=ed13d733dafe365a45812dba882a1074)

### Header code

Add your Cometly pixel and your Meta pixel code to the **HEADER CODE** section:

1. In Cometly, click **Setup** in the sidebar and open step 2, **Install the Cometly pixel**.
2. Under **Install the pixel**, click **Copy Code**.
3. Paste the Cometly pixel into the `<head>` section of your landing page.

### Footer code

Add both scripts below to the **FOOTER CODE** section:

```html theme={null}
<script src="https://app.cometly.com/affiliate/buygoods"></script>
```

```html theme={null}
<script type="text/javascript" src="https://buygoods.com/js/facebook_link_manager.js"></script>
```

![ClickFunnels Tracking Code dialog with the two BuyGoods scripts pasted into the Footer Code tab](https://mintcdn.com/cometly/2fSDFk1g6ELl9hsV/images/integrations/platforms/buygoods/10.webp?fit=max\&auto=format\&n=2fSDFk1g6ELl9hsV\&q=85\&s=202c54485fafadc71376ccad3ffaf4ac)

### Set up the conversion API parameter to send the fbclid (Facebook click ID)

So that the data can be sent back to Meta, add the following to the end of **every offer URL** on your landing page:

```text theme={null}
&fb=1
```

Here is an example:

![ClickFunnels button action with a Go To Website URL ending in the fb=1 parameter, underlined in red](https://mintcdn.com/cometly/2fSDFk1g6ELl9hsV/images/integrations/platforms/buygoods/11.webp?fit=max\&auto=format\&n=2fSDFk1g6ELl9hsV\&q=85\&s=c0caa8b694fdb21db928137abd365a18)

### Install the Meta pixel in the head of your landing page

Make sure the Meta pixel is installed in the `<head>` code of your landing page. The Meta pixel should be ABOVE the Cometly pixel.

[Install the Meta pixel in the head code of your landing page](https://www.loom.com/embed/b219a290ebb14a8aa5739aabfd3b0b73)

## Step 3: Install the Cometly pixel in your BuyGoods offer

If you run multiple offers, complete this step for each offer.

[Step 3: Install the Cometly pixel in the code section of your BuyGoods offer](https://www.loom.com/embed/fb62beef4ac544da9f1344f2bc4818a8)

> [!WARNING]
>
> **Important:** Each Cometly space (a separate workspace in your Cometly account) has its own unique Cometly pixel. If you run multiple offers in the same Cometly space, use the same pixel for all of them. If you use different spaces for your BuyGoods offers, install each space's pixel on the offer you run in that space.

1. In Cometly, click **Setup** in the sidebar and open step 2, **Install the Cometly pixel**.
2. Under **Install the pixel**, click **Copy Code**.
3. In BuyGoods, open your **offer** dashboard and click **Settings**.

![BuyGoods offer dashboard menu with an arrow pointing to Settings](https://mintcdn.com/cometly/2fSDFk1g6ELl9hsV/images/integrations/platforms/buygoods/12.webp?fit=max\&auto=format\&n=2fSDFk1g6ELl9hsV\&q=85\&s=e6c8cf6f37b84bb5cc3c6541113df808)

Click **Funnel pixels**.

![BuyGoods My profile tabs with an arrow pointing to the Funnel pixels tab](https://mintcdn.com/cometly/2fSDFk1g6ELl9hsV/images/integrations/platforms/buygoods/13.webp?fit=max\&auto=format\&n=2fSDFk1g6ELl9hsV\&q=85\&s=dc245c9de3e4f9302b023e4bcc252ece)

Paste the Cometly pixel into the **Lander/VSL** section and the **Checkout** section, then click **Save**.

## Step 4: Track VSL and checkout metrics

[Step 4: Track VSL and checkout metrics](https://www.loom.com/embed/10cfe134aaee42f7af8a7a966678b0de)

To track how many people reach your VSL (sometimes called a "hop") and how many reach your checkout (sometimes called an "OFI", or order form impression), paste the following additional scripts under the Cometly pixel.

**Lander/VSL**: triggers the View Content event when a visitor lands on the VSL page.

```html theme={null}
<script>
comet('view_content');
</script>
```

**Checkout**: triggers the Initiate Checkout event when a visitor lands on the checkout page.

```html theme={null}
<script>
comet('initiate_checkout');
</script>
```

## Step 5: Add URL parameters to your ads for traffic going to BuyGoods offers

> [!NOTE]
>
> BuyGoods uses its own URL parameters, listed below. Do not use the parameters shown on the Setup page in Cometly.

The following URL parameters are required for tracking BuyGoods purchases with Cometly.

### Meta

[Step 5 (Meta): Add URL parameters to your ads for traffic going to BuyGoods offers](https://www.loom.com/embed/8a8b98b576ce41d4aa11dcede40e2011)

Copy and paste the URL parameters below into the **URL parameters** field of your Meta ads:

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

![Meta ad URL parameters field containing the BuyGoods and Cometly parameters](https://mintcdn.com/cometly/2fSDFk1g6ELl9hsV/images/integrations/platforms/buygoods/17.webp?fit=max\&auto=format\&n=2fSDFk1g6ELl9hsV\&q=85\&s=60e34761011e087b9d2ed8d1730b0313)

### TikTok

[Step 5 (TikTok): Add URL parameters to your ads for traffic going to BuyGoods offers](https://www.loom.com/embed/fe2cdb6d1549485c997203992dd85302)

Add the following URL parameters to your website URL:

```text theme={null}
subid=__CID__&c_ad_id=__CID__&c_source=tiktok&comet_source=tiktok&comet_ad_id=__CID__
```

### Google

[Step 5 (Google): Add URL parameters to your ads for traffic going to BuyGoods offers](https://www.loom.com/embed/5c7442740a914a8ba24f6817e4d235e5)

Cometly needs the following tracking template on each of your regular Google ad campaigns that are **not** Smart campaigns:

```text theme={null}
{lpurl}?subid={{ad.id}}&c_source=google&c_ad_id={creative}&comet_source=google&comet_network={network}&comet_campaign={campaignid}&comet_ad_group={adgroupid}&comet_ad_id={creative}&comet_keyword={keyword}
```

To set this up in Google Ads, go to **Settings > Campaign settings** and select the campaigns you want to track with Cometly. Then click **Edit > Change tracking templates**.

Paste the tracking template above into the box labeled **New tracking template**.

Click **Apply** to save the change.

## Step 6: Connect your ad platforms to Cometly

For the full walkthrough, see [Connect ad platforms and ad accounts](https://docs.cometly.com/getting-started/connect-ad-platforms.md).

### Connect your profile to Cometly

Connecting your personal profile lets Cometly access the ad accounts you have permission to use. Once your profile is connected, you can link those ad accounts to your space for tracking and reporting.

1. Click **Integrations** in the sidebar.
2. Under **Ad Platforms**, open the row for the platform you want to connect (for example **Meta Ads**, **Google Ads** or **TikTok Ads**).
3. Click the sign-in button (for example **Sign in with Facebook**) and follow the prompts.

### Connect ad accounts to your space

After your profile is connected, the platform row lists the ad accounts you have access to under **Ad Accounts**. These accounts are tied to your personal profile, so only you can see and manage them.

Click **Connect & Sync Data** next to the ad account you want to add to the space.

Once connected, the ad account appears in the list of connected ad accounts for that platform and is visible to everyone in the space.

## Step 7: Data expectations after connecting ad accounts

* After you connect an ad account, **it takes up to 60 minutes for data to refresh and appear in Cometly**.
* During this time, active campaigns do not show in the Cometly Ads Manager. Once the data refreshes, all active campaigns appear automatically.
* Ad and event conversion data starts displaying from the moment tracking is enabled. Past data cannot be retrieved retroactively.

## Step 8: Configure the conversion APIs to send Purchase data to the ad platforms

The Conversion API is how Cometly sends the conversions it tracks to an ad platform, server to server. Turning on the Conversion API in your Cometly space automatically sends event data back to Meta.

[Step 8: Configure the conversion APIs to send Purchase data to the ad platforms](https://www.loom.com/embed/1b5e9903e2074f5fb4fc87c7d7500b57)

### Set up the Cometly Conversion API

1. In Cometly, click **Events Manager** in the sidebar, then open the **Conversion API** tab.
2. Open the **Meta** row.
3. Under **Master Data Sharing Settings**, select **Send only attributed events**.
4. Click **Save**.

![Meta row of the Conversion API tab in Cometly, with an arrow pointing at the selected Send only attributed events option under Master Data Sharing Settings](https://mintcdn.com/cometly/2fSDFk1g6ELl9hsV/images/integrations/platforms/buygoods/23.webp?fit=max\&auto=format\&n=2fSDFk1g6ELl9hsV\&q=85\&s=57414b0ff7af4f3030e8c5052c9bd3c3)

For the other options on this page (the Meta ad account, Pixel ID and custom rules), see [Configure the Meta Conversion API](https://docs.cometly.com/guides/conversion-api/meta.md).

### Set up the BuyGoods conversion API

Follow the steps in the [BuyGoods help article](https://buygoods.com/pixel-howto) to finish setting up the conversion API inside BuyGoods. This is required to send enhanced Purchase conversions to Meta and Google.

## Check it worked

After your next BuyGoods sale that comes from an ad click, go to **Events Manager** > **Events Log** in Cometly. Every postback BuyGoods sends is recorded there, so you should see a row from BuyGoods around the time of the sale. Within 15 to 30 minutes, the sale shows as a Purchase on the matching ad in the Ads Manager, along with the View Content and Initiate Checkout events from your offer pages.

## Troubleshooting BuyGoods integration setup

These are the common issues our support team sees when Cometly users set up the BuyGoods integration.

### My active ad campaigns are not showing in Cometly

After you connect an ad account, **it takes up to 60 minutes for data to refresh and appear in Cometly**. During this time, active campaigns do not show in the Cometly Ads Manager. Once the data refreshes, all active campaigns appear automatically. Ad and event conversion data starts displaying from the moment tracking is enabled.

### Red dots next to campaigns, ad sets and ads

If you see red dots (tooltip **UTM Setup Error**) next to your campaigns after the initial data refresh, there is likely an issue with the URL parameters on your ads. The BuyGoods integration requires specific URL parameters that differ from those listed on the Setup page. Use the parameters on this page:

* [Meta URL parameters for BuyGoods](#meta)
* [Google URL parameters for BuyGoods](#google)
* [TikTok URL parameters for BuyGoods](#tiktok)

### View Content and LP CTR % metrics are not showing

If the View Content (visitors) metric or the LP CTR % (landing page click-through rate) is not displaying, the cause is most likely the View Content tracking, because LP CTR % is calculated from the total number of View Content events. The page below explains how to verify the Cometly pixel installation and how to add a custom tracking script to your landing page so these metrics are recorded.

[Fix View Content and LP CTR % metrics not showing](https://docs.cometly.com/support/troubleshooting/integrations/buygoods-view-content-and-lp-ctr.md)

### Data in Cometly does not match Facebook

If the data in Cometly does not match what you see in Meta Ads Manager for BuyGoods campaigns, the cause is most likely a timezone difference.

[Learn why data in Cometly does not match Facebook](https://docs.cometly.com/support/troubleshooting/integrations/clickbank-data-mismatch.md)

### BuyGoods reports sales, but no sales show in Cometly

There is a small data delay: Cometly can take 15 to 30 minutes to display BuyGoods sales. If it has been more than 30 minutes and there is an `ad.id` for the sale in the BuyGoods dashboard, a setup step was missed and Cometly is not tracking. Cometly does not display BuyGoods sales that have no `ad.id`.

[Troubleshoot BuyGoods reporting sales with no sales showing in Cometly](https://docs.cometly.com/support/troubleshooting/integrations/buygoods-missing-sales.md)

### Double BuyGoods sales reported in Cometly

If you see double sales in Cometly, you have most likely added the Cometly Postback URL twice in your BuyGoods account (on the AffOverview page and in an individual offer). Step 1 says to add the Postback URL only account-wide on the AffOverview page.

[Fix double BuyGoods sales reporting in Cometly](https://docs.cometly.com/support/troubleshooting/integrations/buygoods-double-sales.md)

## Frequently asked questions

### Does Cometly track BuyGoods upsells?

Yes. When BuyGoods reports a purchase as an upsell, Cometly records it as an upsell purchase, so it counts toward **Upsell Purchase** and **Upsell Revenue**. Upsell revenue is also included in Gross Revenue.

### Do I need a different BuyGoods Postback URL for each Cometly space?

Yes. Each space has its own Postback URL, and a sale only reaches the space whose URL BuyGoods calls. If you work in several spaces, switch to the right one, go to **Integrations** > **BuyGoods**, and compare the **Postback URL** with the one saved in BuyGoods.

### What does the BuyGoods script on my landing page do?

The Cometly script in your footer code reads the URL parameters your ad added to the landing page address and copies them onto the links that lead to your BuyGoods offer. That is how the ad ID travels with the visitor to BuyGoods and comes back to Cometly with the purchase. It only runs when the page address contains the parameters from Step 5, which is why those exact parameters are required.

## Next steps

* [Configure your Ads Manager to show the BuyGoods metrics](https://docs.cometly.com/guides/ads-manager/overview.md)
* [Configure the Meta Conversion API](https://docs.cometly.com/guides/conversion-api/meta.md)
* [Use the Events Log to inspect incoming BuyGoods postbacks](https://docs.cometly.com/support/troubleshooting/general/event-log.md)
* [Troubleshoot BuyGoods sales that do not show in Cometly](https://docs.cometly.com/support/troubleshooting/integrations/buygoods-missing-sales.md)
* [Connect ad platforms and ad accounts](https://docs.cometly.com/getting-started/connect-ad-platforms.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.