Custom Web Pixel Fetch Sending Origin: null

dev42
Shopify Partner
2 0 1

Hey Shopify Devs and Support,

 

     We are having an issue with our custom web pixel sending origin: null in the request headers. We are following the exact example from the docs here. Below is a screenshot of our custom web pixel, its log to the console, and the DevTools details for that request. Notice Null being sent by the requesting resource. This is what my server looks like. Origin is set by the browser, its not something that can be set by the client code. As you can see the reason this request does not fail CORS is because i have origin: true in my server. This essentially just repeats back the origin it received in the Access-Control-Allow-Origin header.

 

   Shopify sending Origin: null is new behavior and was not like this before. If anyone has some context on this or a solution to fix this, I would be greatly appreciative.

Screenshot 2023-11-01 at 8.36.48 AM.png

 

Screenshot 2023-11-01 at 8.27.59 AM.png

Screenshot 2023-11-01 at 8.24.27 AM.pngScreenshot 2023-11-01 at 8.28.09 AM.pngScreenshot 2023-11-01 at 8.32.52 AM.png

Replies 2 (2)

kbarber
Shopify Partner
2 0 2

Also looking for a solution here

00coder
Shopify Partner
2 0 2

Receiving the same error. I have seen in some non-Shopify forums that window.postMessage() may be a solution, but I am not sure if or how that can be implemented here. Is anyone able to assist?