Skip to content
English
  • There are no suggestions because the search field is empty.

How to Install the Pixel Using Theme Code or Google Tag Manager

This guide is for non-Shopify stores and headless (Shopify Hydrogen) storefronts. 

 This guide is for stores that aren't on Shopify and for headless Shopify (Hydrogen) storefronts. Standard Shopify stores should use How to Install the PostPilot Web Pixel instead. The pixel only supports visitors in the US.

Step 1: Copy your pixel code

  1. Log in to PostPilot and go to Integrations.
  2. Click Manage under PostPilot Tracker.
  3. Find the script on your store's card:
    • If you see Install the theme script: click Copy script.
    • If you see Legacy install: theme script: click the arrow next to it to open the section, then click Copy.

If you don't see a script, contact your PostPilot account manager.

Option A: Install via Google Tag Manager

  1. Log in to Google Tag Manager and select your website's container.
  2. Click Add a new tag, then Custom HTML Tag, and name it.
  3. Paste the code you copied from PostPilot into the HTML field.
  4. Under Advanced Settings → Tag firing options, select Once per page.
  5. Under Fire On, select All Pages.
  6. Click Create Tag, then Submit to publish.

Option B: Install via theme code (if you don't use GTM)

Shopify stores
  1. In Shopify Admin, go to Online Store → Themes, click the ⋯ menu next to your theme, and select Edit code.
  2. In the Layout folder, click theme.liquid.
  3. Find the </head> tag near the end of the file.
  4. Paste the code you copied from PostPilot on a new line just above </head>.
  5. Click Save.
Sites not on Shopify
Paste the code into your site's global header, with your other tracking scripts, so it loads on every page.

Check that it's collecting data

Go back to Integrations → PostPilot Tracker → Manage and look at the Tracking status on your store's card. Once PostPilot receives site activity, it changes to Receiving site activity from this store, and the badge changes to Tracking active.

Site activity is updated once a day. Right after you install, the card can show Not receiving events yet or Action needed for up to a day. Visitor data can take up to 24-48 hours to fully sync.

Things to know about the theme script

  • Checkout pages aren't tracked: Theme scripts don't run on Shopify's checkout pages, so some checkout activity may not be tracked.
  • Don't use Shopify's Customer Events: The script can't run inside Shopify's Customer Events (web pixel) sandbox. Use theme code or Google Tag Manager.
  • On a headless Shopify store: If your store's card ever shows the Web Pixel installed, click Uninstall Web Pixel. The Web Pixel can't track a headless store, and uninstalling it switches the theme script back on.