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

# Shopify pixel installation

> Install the Cometly pixel on Shopify by pasting it into your theme.liquid file, so Cometly can track store visitors and tie orders to your ads.

The Cometly pixel is a small script that tracks where your website visitors come from. To install the Cometly pixel on Shopify, you copy it from Cometly and paste it into your store theme's `theme.liquid` file, so it loads on your storefront pages.

This matters because Cometly has no record of a visit without the pixel. With it in your theme, Cometly can identify each store visitor and tie their orders back to the ad or channel that brought them in.

## Before you start

> [!WARNING]
>
> Each Cometly space has its own pixel. If you have multiple stores and created a space for each, make sure you place the Cometly pixel from the correct space.

## Install the Cometly pixel on Shopify

**1. Open the pixel step in Cometly**

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

![The Space setup card in Cometly Setup, with the Install the Cometly pixel step outlined in orange in the list of seven steps.](https://mintcdn.com/cometly/2fSDFk1g6ELl9hsV/images/integrations/pixel/shopify/01.webp?fit=max\&auto=format\&n=2fSDFk1g6ELl9hsV\&q=85\&s=e4215d2d85843cfa44a090749f737e4a)

**2. Copy the pixel**

Under **Install the pixel**, click **Copy Code**. You will paste this code into the `<head>` section of your store theme.

![The Install the pixel section in Cometly Setup, showing the pixel script tag and an orange arrow pointing to the Copy Code button, above the Pixel Guide, WordPress and GTM links.](https://mintcdn.com/cometly/2fSDFk1g6ELl9hsV/images/integrations/pixel/shopify/02.webp?fit=max\&auto=format\&n=2fSDFk1g6ELl9hsV\&q=85\&s=175ee33cb1a51af4f389a7b1ec82b1ba)

**3. Open the theme code editor in Shopify**

Log in to your Shopify store. Under **Sales channels**, click **Online Store** > **Themes**. Next to the **Customize** button, click the three dots, then click **Edit code**.

![Shopify Themes page with arrows on Themes, the three dots menu next to Customize, and Edit code](https://mintcdn.com/cometly/2fSDFk1g6ELl9hsV/images/integrations/pixel/shopify/03.webp?fit=max\&auto=format\&n=2fSDFk1g6ELl9hsV\&q=85\&s=b46e158c47443fc343e6b11b86fceba1)

**4. Open theme.liquid**

In the left panel, choose **theme.liquid**.

![Shopify code editor file list with an arrow pointing to theme.liquid under Layout](https://mintcdn.com/cometly/2fSDFk1g6ELl9hsV/images/integrations/pixel/shopify/04.webp?fit=max\&auto=format\&n=2fSDFk1g6ELl9hsV\&q=85\&s=0b43ddad5c91021328dceb91cab3d5e0)

**5. Paste the pixel before the closing head tag**

If you no longer have the pixel on your clipboard, go back to **Setup** step 2 in your Cometly space and click **Copy Code** again.

Search `theme.liquid` for `</head>` and paste the Cometly pixel just before it.

**6. Save**

Click **Save**.

## Check it worked

In Cometly, go back to **Setup** step 2 and click **Verify** next to your store's domain under **Verify your pixel**. The domain shows **Pixel detected** when the pixel is installed correctly. For the full verification steps, see [Install and verify the Cometly pixel](https://docs.cometly.com/getting-started/install-pixel.md).

> [!NOTE]
>
> For checkout events, also set up the [Shopify integration](https://docs.cometly.com/integrations/platforms/shopify.md) in Cometly.

## Frequently asked questions

### Does the Cometly pixel track Shopify purchases on its own?

No. The pixel identifies each visitor to your store, and paid orders reach Cometly through the Shopify integration, which sends each order when payment is captured. Set up both so each order can be matched to the visitor who placed it. See [Shopify integration](https://docs.cometly.com/integrations/platforms/shopify.md).

### Do I need to add my Shopify store domain in Cometly?

Yes. In **Setup** step 2, add each domain and subdomain where you place the pixel under **Add domains**. Check whether your store's address includes `www.` when it loads, and enter the domain the same way.

### Do I need to paste the pixel into Shopify again after changing my pixel settings?

Yes, if the script changes. The script changes when you add or remove domains, or change a setting under **Pixel options**. When Cometly tells you your tracking script has changed, click **Copy Code** again and replace the old script in `theme.liquid`.

## Next steps

* [Verify the Cometly pixel on your domains](https://docs.cometly.com/getting-started/install-pixel.md)
* [Set up the Shopify integration to track paid orders](https://docs.cometly.com/integrations/platforms/shopify.md)
* [Check your installation with the Cometly Pixel Helper](https://docs.cometly.com/guides/tracking/pixel-helper.md)
* [Fix a Cometly pixel that is not detected](https://docs.cometly.com/support/troubleshooting/pixel/base-code-not-detected.md)
* [Check your Tracking Health score](https://docs.cometly.com/getting-started/tracking-health.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.