Safeguard
Supply Chain•

Do sandboxed web pixels reduce tracking script risk on a store?

Sandboxed pixels run in a web worker with limited globals, unlike classic tags that can touch the page. What changes for risk and what does not.

Safeguard Security Team
3 min read

Yes, a sandboxed pixel has less reach than a classic tracking tag, because it runs in a web worker with limited globals and no page access. It can still send the events it receives to an outside endpoint, so you must still decide which pixels to allow and what data they get.

What a sandboxed pixel is

Shopify's documentation describes pixels as JavaScript snippets that run on the online store and collect behavioral data, called customer events. Web pixel app extensions load in a strict sandbox using web workers. Shopify only guarantees a few globals: self, console, timer functions, and fetch with related globals. Many other globals are overwritten to be undefined. Features that scrape or write to the DOM do not work, and traditional pixels that use browser APIs such as window.document will not run in this environment.

The documentation says the sandbox is designed to give merchants and customers control over what data is accessible to app developers. It also says pixels honor the customer's consent signals. In regions that require consent, callbacks run only after consent is given and earlier events are replayed.

Classic tag versus sandboxed pixel

AspectClassic tag in pageSandboxed pixel
Runs whereMain page contextWeb worker
Can read page fieldsYesNo, by design
Can write to the pageYesNo
Can send data outYesYes, via fetch with CORS
Consent handlingLeft to each tagFollows the platform's consent signals

What risk remains

The sandbox limits what a pixel can read from the page. It does not remove the data it is given. A pixel subscribed to purchase events receives order values and product details, and it can send them anywhere that allows cross origin requests. So the approval decision is still yours.

Steps for a store owner

  1. List all pixels and tags, noting which are sandboxed and which are classic scripts.
  2. Prefer the sandboxed form where a vendor offers one, and retire old copy and paste snippets.
  3. For each pixel, write down the events it receives and what each event contains.
  4. Remove pixels for campaigns that ended.
  5. Re-check after app updates, since a pixel can change what it sends.
  6. Never place classic tags on payment steps. See what a third party script can do on your page.

Try it yourself

Click through it at your own pace, or open it full screen. Look at how an inventory lists what a project pulls in.

Quick check

Does the sandbox mean a pixel cannot leak order data?

No. It limits page access, but the pixel receives event data and can send it out through fetch.

Do pixels respect cookie consent?

Shopify documents that they follow the customer privacy signals. Test your own consent settings to confirm.

Sources

Safeguard can inventory the dependencies and scripts a web app loads, and you can run the free scan at gold.safeguard.sh/scan.

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.