theme.liquid, the theme file that loads on your storefront pages.
Install the Meta pixel in Shopify theme.liquid
This video shows how to hard code the Meta pixel into thetheme.liquid file of your Shopify store.
- Copy your Meta pixel code from Meta.
- 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.
- In the left panel, choose theme.liquid.
- Search
theme.liquidfor</head>and paste the Meta pixel code before it, so it sits in the<head>section. - Click Save.
Confirm the Meta pixel is installed
Open your store in a browser and visit a page. Then look for the new page view events from your store in Meta Events Manager.Frequently asked questions
Does Cometly’s Conversion API send page views to Meta?
No. Cometly’s Conversion API doesn’t send page view events. Place the Meta pixel in the<head> of your site for page views, and use Cometly’s Conversion API to send all other events to Meta from the server. See the Meta Conversion API guide.
Can I use Shopify’s Meta Conversion API and Cometly’s at the same time?
No. You can only run one Conversion API for Meta, or you will have duplicate events. Choose either Shopify’s native Meta Conversion API or Cometly’s. See the Shopify integration for how to choose.Do I still need the Cometly pixel in theme.liquid?
Yes. The Cometly pixel is a separate script that tracks where your store visitors come from, so Cometly can tie their orders back to the ad or channel that brought them in. The Meta pixel does not replace it. See Shopify pixel installation.Next steps
- Set up the Meta Conversion API in Cometly
- Install the Cometly pixel on Shopify
- Connect the Shopify integration
- Fix Meta Conversion API events that are not arriving