Skip to main content
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

Limited accuracy when using Google Tag ManagerThe 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.
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 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 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.

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.

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.

Next steps

Still have questions or need a hand? We’re happy to help. Reach our team at support@cometly.com.