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

# Hero AI pixel installation

> Install the Cometly pixel on Hero AI landing pages and add the ClickBank or BuyGoods script, so each affiliate sale is tied to the ad behind it.

To install the Cometly pixel on Hero AI landing pages, you paste two codes into a Hero AI site group: the Cometly pixel (the script that tracks where your visitors come from) and the script for [ClickBank](https://docs.cometly.com/integrations/platforms/clickbank.md) or [BuyGoods](https://docs.cometly.com/integrations/platforms/buygoods.md). The steps below apply to every landing page in the Hero AI site group, so any landing page you build in that site group gets the codes automatically.

This matters because ClickBank and BuyGoods report a sale but not the ad behind it. With the codes in place, the details of the ad a visitor clicked travel from your landing page to the offer, so you can see in Cometly which campaign, ad set and ad produced each sale.

> [!WARNING]
>
> If you want to track BuyGoods and ClickBank at the same time, use a separate Hero AI site group for each. The codes below are applied to all landing pages in the selected site group.

## 1. Add your Meta pixel code

In Hero AI, go to **Pixel Code** and add your Meta pixel.

![Hero AI Pixel Code page with the Meta pixel code pasted and arrows pointing to Pixel Code and Save Changes](https://mintcdn.com/cometly/2fSDFk1g6ELl9hsV/images/integrations/pixel/hero-ai/01.webp?fit=max\&auto=format\&n=2fSDFk1g6ELl9hsV\&q=85\&s=91cdf2e1ae14777740763d2f340c95e8)

## 2. Add the Cometly codes to your landing pages

1. In Cometly, click [**Setup**](https://app.cometly.com/space-setup?step=install-pixel) in the left sidebar and open step 2, **Install the Cometly pixel**. Under **Install the pixel**, click **Copy Code**. You only need to copy the pixel for this step, you do not need to verify it.

2. In Hero AI, go to **Site Settings** in your site group.

3. In the **Header Code** area, paste the Cometly pixel.

4. In the **Footer Code** area, paste the code for the integration you use (ClickBank or BuyGoods).

   **ClickBank (add to the footer):**

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

   **BuyGoods (add to the footer):**

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

   If you use BuyGoods, also add the BuyGoods Conversion API code to the footer:

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

5. Click **Save Changes**.

## Check it worked

Open a published landing page from the site group in Chrome and use the [Cometly Pixel Helper](https://docs.cometly.com/guides/tracking/pixel-helper.md) to check that the Cometly pixel loads without errors. If you use ClickBank, also click through from the landing page to your offer and check that the UTM parameters from your ad reach the ClickBank checkout. The [ClickBank integration](https://docs.cometly.com/integrations/platforms/clickbank.md) page has a video of this test.

## Frequently asked questions

### Is the Hero AI setup enough to track ClickBank or BuyGoods sales in Cometly?

No. The codes on your landing pages are one part of the setup. Each integration also needs its purchase tracking, the UTM parameters on your ads and your connected ad accounts, so follow every step on the [ClickBank](https://docs.cometly.com/integrations/platforms/clickbank.md) or [BuyGoods](https://docs.cometly.com/integrations/platforms/buygoods.md) page.

### Why are my UTM parameters not passing from my Hero AI landing page to the ClickBank checkout?

Check that the ClickBank script is in **Footer Code** and that the page has no other custom scripts. Use the exact encrypted hoplink that ClickBank provides on your buttons and linked images, with no extra parameters added to it. Depending on your offer, you may need `?tid=` instead of `?utm_campaign=`.

### Do I need to change my BuyGoods offer links on a Hero AI landing page?

Yes. Add `&fb=1` to the end of every offer URL on your landing page so the data can be sent back to Meta. The [BuyGoods integration](https://docs.cometly.com/integrations/platforms/buygoods.md) page shows an example.

## Next steps

* [Finish the ClickBank integration setup](https://docs.cometly.com/integrations/platforms/clickbank.md)
* [Finish the BuyGoods integration setup](https://docs.cometly.com/integrations/platforms/buygoods.md)
* [Fix a ClickBank TID that does not pass from your landing page to the offer](https://docs.cometly.com/support/troubleshooting/integrations/clickbank-tid-not-passing.md)
* [Check your pixel with the Cometly Pixel Helper](https://docs.cometly.com/guides/tracking/pixel-helper.md)
* [Connect your 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.