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

# Set up a Google Tag Manager web container

> Set up a Google Tag Manager web container and install it on your site, so you can add the Cometly pixel and your event tags through GTM.

You want to add the Cometly pixel (the script that tracks where your website visitors come from) through Google Tag Manager (GTM), but you have no container to put it in. Or you have a container, and its code is not on your site yet, so nothing you add to it loads.

A tag in Google Tag Manager only runs on pages that carry the container's own code. So before you add the pixel, you need to set up a Google Tag Manager web container and install it on your site. This page covers both parts.

After you create your container, continue with [Google Tag Manager pixel installation](https://docs.cometly.com/integrations/pixel/google-tag-manager.md) to add the Cometly pixel.

## Create a new Google Tag Manager web container

Google Tag Manager is a tag management system (TMS) that lets you quickly update measurement codes and related code fragments, collectively known as tags, on your website.

1. Open Google Tag Manager: [Create a Google Tag Manager web container](https://marketingplatform.google.com/about/tag-manager/)
2. Create a new web container for your website. The video below shows each click.

[How to setup a Google Tag Manager web container video](https://www.loom.com/embed/eac311a2d92b455abc7cc568b2a6df0f)

## Install Google Tag Manager in your ecommerce store

> [!NOTE]
>
> Skip this step if Google Tag Manager is already set up on your ecommerce store.

Watch the video below to see how to install the Google Tag Manager code in your ecommerce store. The example installs Google Tag Manager in a Shopify store, in the **theme.liquid** file.

[How to install Google Tag Manager in your Shopify store video](https://www.loom.com/embed/2b050458a60945ada297ddd21899d3a9)

## Confirm the container is ready for the Cometly pixel

The container is ready once its code is on your site and you can publish tags from it. To confirm it from Cometly, follow [Google Tag Manager pixel installation](https://docs.cometly.com/integrations/pixel/google-tag-manager.md) to add the pixel as a tag, publish the container, then click **Verify** under **Verify your pixel** in Cometly. Your domain shows **Pixel detected**.

## Frequently asked questions

### Do I need Google Tag Manager to install the Cometly pixel?

No. You can paste the pixel directly into the `<head>` section of your website, and that is the installation we recommend for the most accurate tracking. Google Tag Manager is an option when you prefer to add the pixel without editing your site's code.

### Is the Cometly pixel less accurate when installed through Google Tag Manager?

It can be. The pixel works through Google Tag Manager, but you may lose attribution data because of pixel loading delays, privacy blockers and data loss. See [Google Tag Manager pixel installation](https://docs.cometly.com/integrations/pixel/google-tag-manager.md) for the details.

### Can I add the Cometly pixel in Google Tag Manager if it is already on my site?

No, install it in one place only. If the pixel is hard coded on your site and also added through Google Tag Manager, it loads twice and causes tracking issues.

## Next steps

* [Install the Cometly pixel with Google Tag Manager](https://docs.cometly.com/integrations/pixel/google-tag-manager.md)
* [Install and verify the Cometly pixel](https://docs.cometly.com/getting-started/install-pixel.md)
* [Set up Add to Cart and Initiate Checkout events](https://docs.cometly.com/guides/events/add-to-cart-and-initiate-checkout.md)
* [Install the Cometly pixel on Shopify](https://docs.cometly.com/integrations/pixel/shopify.md)
* [Check your pixel with the Cometly Pixel Helper](https://docs.cometly.com/guides/tracking/pixel-helper.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.