Manage custom pixels using REST API

Topic summary

Goal: manage and update Custom Web Pixels from a custom app via an API, migrating away from the REST ScriptTag endpoint used for injecting scripts.

Context and references:

  • Current implementation uses the REST ScriptTag resource to add custom scripts.
  • Shopify docs cited for Custom Web Pixels (Web Pixels API) and ScriptTag.

Key questions and uncertainties:

  • Whether Custom Web Pixels can be created/managed programmatically from an app (similar to an “App pixel”)—especially via REST—remains unclear from the docs referenced.
  • A developer is specifically interested in the “lax sandbox” behavior shown in Custom Pixel examples to load a tracking library, and hasn’t seen an example demonstrating similar capability with an App pixel.

Clarification sought:

  • One reply asked if the work is indeed with Custom Web Pixels per the developer documentation.

Status:

  • No confirmed method or code sample was provided for creating/updating Custom Web Pixels via REST.
  • Open items: confirmation of API support (REST vs. other) for Custom Web Pixel creation/management, and whether App pixels can safely load external tracking libraries with comparable sandbox constraints.
Summarized with AI on December 30. AI used: gpt-5.

Hi,

I have created a custom app for my store. I want to add/update custom pixels via this app.

As per Shopify documentation, it is possible with Web API but I need to do this with REST API.

Currently, I use script-tags endpoint to add the custom script. I want to upgrade to Custom Pixel.

Thank you,

Kashyap

Hi Kashyap,

Are you working with Custom Web Pixels, as described in our developer docs here?

I happened on this thread Googling, for the same reason as Kashyap.

I can’t really confirm or deny from the deep reading of Shopify docs that I can create a Custom Pixel from an App like I would an App pixel. The lax sandbox is the main thing I am interested in, because we need to load a tracking library, as in the Custom Pixel examples, but I have never seen an example of doing that with an App pixel.