By Dylan HuntJune 2nd, 2026shopifypixelscustomer-events

How to Add a Custom Pixel to Shopify Without an App

You don't need an app to add tracking to a Shopify store. Custom pixels live in the admin under Settings → Customer events, take about five minutes to set up, and run on checkout pages. Nothing you paste into a theme can do that last part.

This is the short version. If you're moving a whole tracking setup off ScriptTags and theme snippets, start with the full Customer Events migration guide instead.

Step 1: Open Customer events

In the Shopify admin, go to Settings → Customer events. You'll see any app pixels your installed apps have registered (the Google and Meta channel apps add their own), plus a button to Add custom pixel.

That list matters. If your tracker's official app is installed and connected, it's probably already receiving these events, and a duplicate custom pixel for the same destination will double-count every conversion.

Step 2: Add the pixel

Click Add custom pixel and give it a name you'll recognize in a year. "GA4 backup" beats "test pixel 3".

Shopify opens a code editor. The smallest useful pixel is a subscription to one event:

analytics.subscribe("page_viewed", (event) => {
  console.log("Viewed:", event.context.document.location.href);
});

Before you save, check the Customer privacy section under the editor. This is where you declare what the pixel does: analytics, marketing, preferences, or data sale. Shopify uses those declarations to decide when the pixel fires for visitors who haven't consented under rules like GDPR. Declare honestly. A marketing pixel marked "not required" will fire for people who opted out, and that's on you.

Step 3: Connect and verify

Click Connect. A saved pixel that isn't connected does nothing, and this step is easy to miss.

Then verify it's firing:

  1. Open your storefront with the browser console open.
  2. Browse a product, add to cart, start checkout.
  3. Watch your console.log lines (or your tracker's debug view) light up at each step, including on checkout pages.

What you can subscribe to

The standard events cover the whole funnel: page_viewed, product_viewed, collection_viewed, search_submitted, product_added_to_cart, cart_viewed, checkout_started, and checkout_completed, among others. Each one delivers a structured payload, so there's no DOM scraping. Good thing too, because the pixel sandbox doesn't allow DOM access at all. The full list lives in Shopify's standard events reference.

For payload shapes and working GA4 wiring, the add-to-cart and checkout tracking deep-dive walks through each event with real code.

When you do want an app instead

Custom pixels are perfect for a destination you control. For ad platforms with server-side APIs (Meta CAPI, TikTok Events API), the official channel app usually does more than a browser pixel can: deduplication, server events, catalog sync. The setup I recommend for most stores is channel apps for the big ad platforms and custom pixels for everything else.

And if part of your reason for cleaning up tracking is making your store legible to AI shopping agents, that's the other half of the same project. AgentReady handles the structured data side the same way customer events handle measurement.

Make your store agent-ready

Get found and recommended by AI shopping assistants.

AgentReady adds Schema.org structured data, an llms.txt directory, and an AI-readability audit to your Shopify store, so ChatGPT, Perplexity, and Google can understand and recommend your products. Free for stores under 500 products.

Comments

Every comment here comes from a verified email. Write yours, confirm from your inbox, and it's live.

Loading comments…

Leave a comment

ShareXLinkedInFacebook

Written by Dylan Hunt, Founder, Caffeine and Commerce. We build Shopify stores that rank and that AI agents can read. Have a project? Get in touch.