Custom Web Pixel Fetch Sending Origin: null

Topic summary

Developers are experiencing an issue where Shopify’s custom web pixel sends Origin: null in request headers, causing CORS complications.

Key Details:

  • The problem occurs when following Shopify’s official documentation for custom web pixels
  • Origin: null is set by the browser and cannot be modified by client code
  • This represents new behavior from Shopify that wasn’t present previously
  • One developer mentions working around it by setting origin: true on their server, which echoes back the received origin in the Access-Control-Allow-Origin header

Potential Solutions Mentioned:

  • Using window.postMessage() was suggested based on non-Shopify forums, though implementation details remain unclear

Current Status:

  • Multiple developers have confirmed experiencing the same issue
  • No official solution or response has been provided
  • The discussion remains open with participants seeking updates and assistance
Summarized with AI on November 1. AI used: claude-sonnet-4-5-20250929.

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?

2 Likes