How to Add a Custom Pixel to Shopify Without an App
Canonical: https://joinagentready.com/blog/add-custom-pixel-shopify-without-app
By Dylan Hunt May 5th, 2026 How-to notes
Written by the Caffeine and Commerce team. For build work, see caffeinecommerce.com.
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:
- Open your storefront with the browser console open.
- Browse a product, add to cart, start checkout.
- Watch your
console.loglines (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.
Quick answers
Frequently asked questions
Where do I add a custom pixel in Shopify?
Shopify admin > Settings > Customer events > Add custom pixel. Name it, paste your code, set the privacy permissions, and click Connect. No app or theme edit is required, and it works on every plan.
Do custom pixels run on the checkout pages?
Yes, and that's their main advantage. Theme code and ScriptTags never ran on the new checkout. A connected pixel receives events from the storefront and the entire checkout, including checkout_completed.
Can I remove a custom pixel later?
Yes. In Settings > Customer events, open the pixel and disconnect or delete it. Disconnecting stops it immediately across the whole store, which is much cleaner than hunting tracking snippets through theme files.
Dylan Hunt
Author
Builds Shopify catalog readability and AI answer visibility at AgentReady and Caffeine and Commerce.
Comments
Every comment here comes from a verified email. Write yours, confirm from your inbox, and it's live.
Loading comments…
Written by Dylan Hunt, Founder, AgentReady. AgentReady audits Shopify structured data and checks approved changes on the live storefront. See plans.
For Shopify today
Schema for AI
Make your Shopify catalog easier for AI to understand.
From $9/mo
Run free audit → Explore Schema for AI
Free guide
The Shopify Functions Playbook
25 real things you can build with Functions, with the plan requirements and limits stated plainly. Emailed to you, readable immediately.
More in How-to notes