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

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.

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

Hey all :waving_hand: - 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

Like Luke mentioned though, we do offer Web Pixels as part of our Extensibility framework here which might work: Build web pixels

Hope this helps a bit.

1 Like

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.






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

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