How to install the Meta pixel and Google tag on Shopify

On Shopify you connect the pixel Madder created through the Facebook & Instagram channel instead of pasting code, set data sharing to Maximum, and add a custom pixel only if leads come from a form.

For Shopify. Takes about 15 minutes

On this page

Before you start#

  • Admin on the Shopify store and on the Meta Business portfolio that owns the connected ad account.
  • The Facebook & Instagram channel installed: Settings › Sales channels › Shopify App Store › search “Facebook” › Add channel › Start set up › Connect account › Finish setup.
  • If someone once pasted pixel code into the theme, remove it first (Shopify refuses to connect a pixel while theme code holds one).

1Connect the pixel Madder created#

Paths as of September 2026. Go to Sales channels › Facebook & Instagram › Settings. Under Customer data sharing click Connect and pick the pixel whose ID matches step 2 of Madder’s pixel window. Do not click Create new, which makes a second pixel.

2Set data sharing to Maximum#

In the same section, under CHOOSE LEVEL, pick Maximum. Only Maximum turns on the Conversions API, which sends purchases past ad blockers. Shopify then fires PageView, AddToCart and Purchase itself.

3Fire a Lead event (form-based leads only)#

If a purchase is your lead, stop here, and check Purchases on your site (pixel) when you tell Madder what counts as a lead. If your lead is a contact or newsletter form, add a custom pixel:

  1. Settings › Customer events › Add custom pixel, name it “Meta Lead”.
  2. In the Code window paste only the lines between <script> and </script> of Madder’s code (Shopify’s pixel sandbox runs JavaScript only). Replace its fbq('track', 'PageView'); line, which the channel already sends, with:
analytics.subscribe('form_submitted', () => { fbq('track', 'Lead'); });
  1. Save, then Connect pixel.

This fires for every storefront form; filter on event.data.element.action if you have several.

4The Google tag#

Install the Google & YouTube channel from the same list and connect the Google Ads account Madder uses; it places the Google tag. See Install the Google tag on your website.

5Verify#

  1. Open your store with the Meta Pixel Helper Chrome extension; it should show one pixel, “Active”, with your ID.
  2. In Events Manager › Data sources › your pixel › Test events, enter your store URL and place a test order or submit the form. Purchase or Lead appears within about 30 seconds.
  3. In Madder, open the pixel window again with Set up tracking. Madder checks as it opens. “The pixel is live.” means you are done. Otherwise press Check again after a minute, and if Madder still can’t see it, press Mark as installed.

If it doesn’t work#

Pixel Helper shows two pixels
Old theme code plus the channel. Online Store › ⋯ › Edit code, remove the snippet from theme.liquid.
Purchase missing, PageView fine
Data sharing is Standard or Enhanced; set Maximum.
Lead never appears
The custom pixel is saved but not connected; click Connect. Or the form is a third-party app rendered in an iframe, which form_submitted does not see.
Events show but with a different pixel ID
The wrong pixel was connected in step 1; disconnect and reconnect using the ID from Madder’s pixel window.
Madder says the pixel isn’t on your site yet
The channel loads the pixel where Madder’s page check can’t see it. After Meta’s first event Madder says “The pixel is live.”; until then, press Mark as installed.