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

# Framer pixel installation

> Install the Cometly pixel on Framer with a custom code block in Site Settings, so each visit, lead and sale on your Framer site is tied to its source.

The Cometly pixel is a small script that tracks where your website visitors come from. To install the Cometly pixel on Framer, you paste it into a custom code block in your Framer **Site Settings**. You can also fire a custom event (an action you define in Cometly) to track website sessions.

Once the pixel is on your Framer site, Cometly can tie each lead and sale back to the ad or channel that brought the visitor in. Without it, Cometly has no record of the visit, so the rest of your tracking depends on this step.

## Why install the Cometly pixel on Framer

Installing the Cometly pixel on Framer allows you to:

* Track website sessions and visitor activity
* Capture first-party attribution data
* Fire custom events used in reports and attribution models
* Ensure reliable tracking despite privacy restrictions and ad blockers

## Before you start

Copy your pixel from Cometly: click [**Setup**](https://app.cometly.com/space-setup?step=install-pixel) in the left sidebar, open step 2, **Install the Cometly pixel**, and under **Install the pixel** click **Copy Code**.

## Step 1: Open Site Settings in Framer

1. Open your site in the Framer editor.
2. Click **Site Settings** in the top toolbar.

   ![Framer editor top toolbar with an arrow pointing to the Site Settings icon](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/pixel/framer/01.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=d29007dd57a2ad1c15e1b890e23fea29)

This is where Framer lets you manage global custom code for your site.

## Step 2: Add the Cometly pixel (start of body)

1. In **Site Settings**, click **Custom Code**.
2. Create a new custom code block.
3. Set **Placement** to **Start of `<body>`**.
4. Paste your Cometly pixel code.
5. Set **Run** to **Once**.
6. Click **Save**.

> [!WARNING]
>
> On Framer websites, the Cometly pixel must be placed at **Start of `<body>`**. This ensures it loads early enough to capture sessions and attribution correctly.

## Step 3 (optional): Track website sessions with a custom event (end of body)

If you want to track website sessions or page-level activity, you can fire a custom event after the page loads.

### Before you add the event

* Set up a custom event in Cometly (**Events Manager** > **Manage custom events**). See [custom events](https://docs.cometly.com/guides/events/custom-events.md) for step-by-step instructions.
* Note the event's `event_name` (for example `custom_event_2`).

### Add the custom event in Framer

1. Go back to **Site Settings** > **Custom Code**.

2. Create a new custom code block.

3. Set **Placement** to **End of `<body>`**.

4. Paste the event script, using your own custom event number. For example:

   ```html theme={null}
   <script>
     setTimeout(function () {
       comet('custom_event_2');
     }, 500);
   </script>
   ```

5. Click **Save**.

![Framer Edit Script dialog with Placement set to End of body and a script that fires comet custom\_event\_2](https://mintcdn.com/cometly/4NU5YV9iL1PADmGE/images/integrations/pixel/framer/03.webp?fit=max\&auto=format\&n=4NU5YV9iL1PADmGE\&q=85\&s=9979cbf9d7556e359f0e52f00d2a0f67)

This triggers the custom event shortly after the page loads. It is commonly used for:

* Website session tracking
* Page view-style events
* Funnel entry tracking

## Setup tips

* Install the Cometly pixel only once. You do not need multiple pixel installs across pages.
* If your Framer site uses multiple domains or subdomains, add each of them under **Add domains** in Setup step 2, **Install the Cometly pixel**.
* Remember to **Publish** your Framer site after saving custom code. Changes do not go live until the site is published.
* To confirm the pixel is detected, see [Install and verify the Cometly pixel](https://docs.cometly.com/getting-started/install-pixel.md).

## Check it worked

After you publish your Framer site, go back to **Setup** in Cometly and open step 2, **Install the Cometly pixel**. Under **Verify your pixel**, click **Verify** next to your Framer domain. The domain shows **Pixel detected** when the pixel is installed correctly.

## Frequently asked questions

### Why is the Cometly pixel not detected on my Framer site?

The most common cause is that the site was not published after you saved the custom code, so the pixel is not live yet. Also check that the domain you added under **Add domains** matches the address your site loads on (with or without `www.`), and that the script in Framer is the one Cometly shows under **Install the pixel**. Then click **Retry** next to the domain.

### Do I need to update the pixel in Framer after I change settings in Cometly?

Sometimes. The script changes when you add or remove domains, or change a setting under **Pixel options**. If Cometly tells you your tracking script has changed, copy it again, replace the old code in your Framer custom code block, and publish the site.

### How do I check that Cometly captures the forms on my Framer site?

Use **Test form tracking**, the last part of the same Setup step. It opens a page of your site in a pop-up window and tells you whether Cometly can see the forms on it and their email field. See [Test form tracking](https://docs.cometly.com/guides/form-tracking/testing.md).

## Next steps

* [Install and verify the Cometly pixel](https://docs.cometly.com/getting-started/install-pixel.md)
* [Add URL parameters to your ads](https://docs.cometly.com/getting-started/url-parameters.md)
* [Set up custom events](https://docs.cometly.com/guides/events/custom-events.md)
* [Test form tracking on your pages](https://docs.cometly.com/guides/form-tracking/testing.md)
* [Set up First Party Domain Tracking](https://docs.cometly.com/guides/tracking/first-party-domain.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.