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

# Google Tag Manager pixel installation

> Install the Cometly pixel with Google Tag Manager: add it as a Custom HTML tag on all pages, then verify it so each visit is tied to its source.

The Cometly pixel is a small script that tracks where your website visitors come from and captures opt-in data from your forms (name, email and phone number). This page shows you how to install the Cometly pixel with Google Tag Manager (GTM), as a tag that loads on every page of your site.

Once the pixel is live, Cometly can tie each lead and sale back to the ad or channel that brought the visitor in. Google Tag Manager lets you add it without editing your site's code, at some cost in accuracy (see the first warning below).

## Before you start

* You need a Google Tag Manager web container that is already installed on your website. If you do not have one, see [Set up a Google Tag Manager web container](https://docs.cometly.com/support/troubleshooting/pixel/google-tag-manager-web-container.md).

> [!WARNING]
>
> **Limited accuracy when using Google Tag Manager**
>
> The Cometly pixel works when it is installed through Google Tag Manager, but you may lose attribution data because of pixel loading delays, privacy blockers and data loss. For the best performance and the most accurate tracking, we recommend installing the pixel directly in the `<head>` section of your website.

> [!WARNING]
>
> Do not install the pixel twice. If the Cometly pixel is hard coded on your site and also added through Google Tag Manager, it loads twice and causes tracking issues. If you set it up with Google Tag Manager, make sure it is only in Google Tag Manager.

## Create the Cometly pixel tag

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**.
2. In your Google Tag Manager container, create a new tag called **Cometly Pixel**.
3. Click **Tag Configuration** and choose **Custom HTML**.
4. Paste the Cometly pixel in the custom HTML block.
5. Set the trigger to **All Pages**.
6. Publish the container.

## Add your domain and verify the pixel

Go back to [Setup step 2](https://app.cometly.com/space-setup?step=install-pixel) in Cometly. Under **Add domains**, add your domain. Then, under **Verify your pixel**, click **Verify** to check that the Cometly pixel is installed on your website.

For details, see [Install and verify the Cometly pixel](https://docs.cometly.com/getting-started/install-pixel.md).

## Check it worked

In Cometly, under **Verify your pixel**, your domain shows **Pixel detected**. If it shows **Pixel not detected**, check that the container is published and the tag's trigger is **All Pages**, then click **Retry**.

## Frequently asked questions

### Do I need to update the Google Tag Manager tag when my Cometly pixel script changes?

Yes. 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, click **Copy Code** again, replace the code in your **Cometly Pixel** tag and publish the container.

### How do I check that the Cometly pixel is firing on a page?

Use the Cometly Pixel Helper, a Chrome browser extension. Open it on your page and you should see an **Init** event fire on each page that contains the Cometly pixel. See [Cometly Pixel Helper](https://docs.cometly.com/guides/tracking/pixel-helper.md).

### Can I use First Party Domain Tracking with Google Tag Manager?

Yes. **First Party Domain Tracking** serves the pixel from a subdomain you control, and you can add that first-party script through Google Tag Manager. If the default Cometly pixel is already in your tag, replace it with the first-party script. See [Set up First Party Domain Tracking](https://docs.cometly.com/guides/tracking/first-party-domain.md).

## Next steps

* [Install and verify the Cometly pixel](https://docs.cometly.com/getting-started/install-pixel.md)
* [Check your pixel with the Cometly Pixel Helper](https://docs.cometly.com/guides/tracking/pixel-helper.md)
* [Test form tracking on your pages](https://docs.cometly.com/guides/form-tracking/testing.md)
* [Set up cross-domain tracking](https://docs.cometly.com/guides/tracking/cross-domain-tracking.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.