For discussing the development and usage of Checkout UI extensions, post-purchase extensions, web pixels, Customer Accounts UI extensions, and POS UI extensions
Hello guys, I'm running into issues trying to extend the Pixel Extension features.
Basically I've created a custom Pixel Extension with the objective of extending the information that is sent to my Analytics events. I know inside the Pixel Extension we have access to the "analytics" object and its "event" object as well, but the information provided by the event object is not enough as I need to get also information such as customer's first and last purchase date, customer tags, checkout shipping method and payment methods selected, customer's total value in purchases, etc.
I was reading on the docs that we could use the GraphQL Admin API to extend this functionality but I couldn't make it work, and I didn't find any resource or forum talking about it.
So what I've decided to try next is calling Shopify API from my Pixels Extension expecting to get the mentioned extra data but it seems Pixels Extension doesn't provide a way to call Shopify API directly neither, so finally I've decided to use Proxy API in order to authenticate to my App and then be able to call Shopify API, but it's likely the Proxy API is also blocked for Pixel Extensions. What I'm getting every single time I use Proxy is a "CORS same origin error" rule. Check the image below.
Following the code and Proxy configuration I'm using:
Following the Pixel Extension code call:
Following my App's /api/getData endpoint code:
As a note I've already enabled the Pixels Extension App so it is already triggering the call when "all_events" event happening.
Also need to mention that I tested the same call to /apps/app-proxy/api/getData endpoint from different Extensions like Theme Extension and the response was successful, so it makes me thing it is a blocker happening only with Pixel Extensions.
This is a new feature we're building based on a resource tutorial as mentioned above the purpose is basically to extend the Pixels functionalities we get if only using Shopify Pixels default feature, it makes me think why should we bother in creating a custom Shopify Pixels Extension if basically the functionalities are the same as default ones and we can't extend more?. What is the purpose of creating a Pixel Extension?.