# Looking for GraphQL or REST API to Create Custom Pixel in Settings \> Customer Events \> Custom Pixel

**URL:** <https://community.shopify.dev/t/looking-for-graphql-or-rest-api-to-create-custom-pixel-in-settings-customer-events-custom-pixel/15419>\
**Category:** GraphQL Admin API Troubleshooting\
**Tags:** rest-migration, general-gql-troubles\
**Created:** [May 16, 2025, 6:34am UTC](https://community.shopify.dev/t/looking-for-graphql-or-rest-api-to-create-custom-pixel-in-settings-customer-events-custom-pixel/15419 "2025-05-16T06:34:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Viral\_Mandaliya](https://sea1.discourse-cdn.com/shopifycommunity/user_avatar/community.shopify.dev/viral_mandaliya/32/6669_2.png) [@Viral\_Mandaliya](https://community.shopify.dev/u/Viral_Mandaliya)\
**Post date:** [May 16, 2025, 6:34am UTC](https://community.shopify.dev/t/looking-for-graphql-or-rest-api-to-create-custom-pixel-in-settings-customer-events-custom-pixel/15419/1 "2025-05-16T06:34:44Z")

</div>

Does anyone know if there is a GraphQL or REST API available to create a Custom Pixel under **Settings \> Customer Events \> Custom Pixel**?

Any guidance or documentation would be greatly appreciated.

 ![GSF-Store-v3-a-·-Customer-events-·-Shopify](https://global.discourse-cdn.com/shopifycommunity/original/2X/5/5cdd731735febf472e6b7540fd91086d8302d3a1.png)

---

<div class="post-metadata">

**Author:** ![Luke](https://sea1.discourse-cdn.com/shopifycommunity/user_avatar/community.shopify.dev/luke/32/22023_2.png) [@Luke](https://community.shopify.dev/u/Luke)\
**Post date:** [May 16, 2025, 8:29am UTC](https://community.shopify.dev/t/looking-for-graphql-or-rest-api-to-create-custom-pixel-in-settings-customer-events-custom-pixel/15419/2 "2025-05-16T08:29:02Z")

</div>

Most likely not, its the whole point of a ‘Custom’ pixel. You need to look at a Web Pixel instead at best guess.

> **[Web Pixels API](https://shopify.dev/docs/api/web-pixels-api)**
>
> The Web Pixels API gives you access to a set of controlled APIs for accessing browser APIs and subscribing to customer events, within one of our Lax or Strict sandboxes.

---

<div class="post-metadata">

**Author:** ![Alan\_G](https://sea1.discourse-cdn.com/shopifycommunity/user_avatar/community.shopify.dev/alan_g/32/5321_2.png) [@Alan\_G](https://community.shopify.dev/u/Alan_G)\
**Post date:** [May 16, 2025, 7:35pm UTC](https://community.shopify.dev/t/looking-for-graphql-or-rest-api-to-create-custom-pixel-in-settings-customer-events-custom-pixel/15419/3 "2025-05-16T19:35:33Z")

</div>

Hey all 👋 - just confirming that @Luke is on point here, there isn’t currently an API endpoint that can create a custom pixel on a shop. At the moment, Custom Pixels can only be created via the Admin UI:

[https://help.shopify.com/en/manual/promoting-marketing/pixels/custom-pixels/manage](https://help.shopify.com/en/manual/promoting-marketing/pixels/custom-pixels/manage)

Like Luke mentioned though, we do offer Web Pixels as part of our Extensibility framework here which might work: [Build web pixels](https://shopify.dev/docs/apps/build/marketing-analytics/build-web-pixels)

Hope this helps a bit.

---

<div class="post-metadata">

**Author:** ![Viral\_Mandaliya](https://sea1.discourse-cdn.com/shopifycommunity/user_avatar/community.shopify.dev/viral_mandaliya/32/6669_2.png) [@Viral\_Mandaliya](https://community.shopify.dev/u/Viral_Mandaliya)\
**Post date:** [June 9, 2025, 7:36am UTC](https://community.shopify.dev/t/looking-for-graphql-or-rest-api-to-create-custom-pixel-in-settings-customer-events-custom-pixel/15419/4 "2025-06-09T07:36:19Z")

</div>

Hello @Alan_G

Thank you for the information. We had researched this earlier as well but were unable to find a workable solution at that time.

We have now revisited the issue and conducted further research, as outlined below:

We attempted to load the Google Ads JavaScript file, which is needed to track conversions, but it is not working. We tried several approaches to load JavaScript files; however, due to DOM restrictions within Web Pixels, we are unable to load external JavaScript files directly.

**Approaches we tried to load JS:**

1. `document.createElement('script')`
2. `import()`
3. `fetch()`

**Note:** Only `fetch()` works within Web Pixels to retrieve the JavaScript file, but it does not trigger `gtag` events and does not show any errors in the console.

We tested the following scenarios:

- **Case 1:** Loading via a proxy URL
- **Case 2:** Loading the original Google Tag URL

Both approaches resulted in the same outcome the script could not execute as expected. Hope you can guide further for solution on it.

Thanks in advance.

 ![case 1 - console](https://global.discourse-cdn.com/shopifycommunity/original/2X/2/251d49ad3bfe1759f72b2d91abd93f00b889dac3.jpeg)  
 ![case 1 - code](https://global.discourse-cdn.com/shopifycommunity/original/2X/0/0260f1b85ef4dcedf2d20a112fd198b6d6bc33da.jpeg)  
 ![case 2 - network GT tag](https://global.discourse-cdn.com/shopifycommunity/original/2X/5/5f05e7ba0bf1f1c4c252e841a71c3e06869c828b.jpeg)  
 ![case 2 - console](https://global.discourse-cdn.com/shopifycommunity/original/2X/4/46da461d33e76bf3d0d4e9b6dcafc5a4398f6274.jpeg)  
 ![case 2 - code](https://global.discourse-cdn.com/shopifycommunity/original/2X/6/6ffa8c2a974e29839c9e70cd69556a7b9f873771.jpeg)  
 ![case 2 - network AW tag](https://global.discourse-cdn.com/shopifycommunity/original/2X/0/0a0dc2ab305548606b715fd8640dc7e40d547935.jpeg)

---

<div class="post-metadata">

**Author:** ![Luke](https://sea1.discourse-cdn.com/shopifycommunity/user_avatar/community.shopify.dev/luke/32/22023_2.png) [@Luke](https://community.shopify.dev/u/Luke)\
**Post date:** [June 9, 2025, 9:17am UTC](https://community.shopify.dev/t/looking-for-graphql-or-rest-api-to-create-custom-pixel-in-settings-customer-events-custom-pixel/15419/5 "2025-06-09T09:17:53Z")

</div>

I’m not quite sure why you’re trying to load GTM like that.

I suggest looking at this guide:

[https://help.shopify.com/en/manual/promoting-marketing/pixels/custom-pixels/gtm-tutorial](https://help.shopify.com/en/manual/promoting-marketing/pixels/custom-pixels/gtm-tutorial)

---

<div class="post-metadata">

**Author:** ![Viral\_Mandaliya](https://sea1.discourse-cdn.com/shopifycommunity/user_avatar/community.shopify.dev/viral_mandaliya/32/6669_2.png) [@Viral\_Mandaliya](https://community.shopify.dev/u/Viral_Mandaliya)\
**Post date:** [June 9, 2025, 9:28am UTC](https://community.shopify.dev/t/looking-for-graphql-or-rest-api-to-create-custom-pixel-in-settings-customer-events-custom-pixel/15419/6 "2025-06-09T09:28:09Z")

</div>

We are using **Custom Pixel** only at the moment for all kind of conversion tracking that is working fine via Shopify \> Custom Pixels.

Custom Pixel is manual way that merchant has to copy & paste code inside custom pixel in their store while using **Web Pixels** we can make this process automated.

So I am looking for support for **Conversion Tracking** scripts in **Web Pixels**.

Hope you understand @Luke

---

<div class="post-metadata">

**Author:** ![emroking](https://avatars.discourse-cdn.com/v4/letter/e/898d66/32.png) [@emroking](https://community.shopify.dev/u/emroking)\
**Post date:** [September 24, 2025, 9:25am UTC](https://community.shopify.dev/t/looking-for-graphql-or-rest-api-to-create-custom-pixel-in-settings-customer-events-custom-pixel/15419/7 "2025-09-24T09:25:38Z")

</div>

Hi @Viral_Mandaliya , I’ve just stumbled upon your post and I have similar issue. Did you actually find any solution to programmatically create/update code in the custom pixels?

---

<div class="post-metadata">

**Author:** ![Viral\_Mandaliya](https://sea1.discourse-cdn.com/shopifycommunity/user_avatar/community.shopify.dev/viral_mandaliya/32/6669_2.png) [@Viral\_Mandaliya](https://community.shopify.dev/u/Viral_Mandaliya)\
**Post date:** [October 27, 2026, 8:05am UTC](https://community.shopify.dev/t/looking-for-graphql-or-rest-api-to-create-custom-pixel-in-settings-customer-events-custom-pixel/15419/8 "2026-10-27T08:05:27Z")

</div>

> [@emroking](#):
>
> I’ve just stumbled upon your post and I have similar issue. Did you actually find any solution to programmatically create/update code in the custom pixels?

Hello @emroking  
Sorry for the late response!

As of now, Shopify does not provide an API to programmatically create or update the code of custom pixels. However, you can consider using **Web Pixels in Lax mode** as an alternative, depending on your requirements.
