[GTM - Custom Pixel] Blocked a frame with origin null from accessing a cross-origin frame

Topic summary

A user is attempting to implement Google Tag Manager (GTM) via Shopify’s Custom Pixel feature but encountering implementation issues.

Technical Problem:

  • GTM is not being detected despite inserting the standard GTM code snippet
  • Console shows a DOM Exception error: “Uncaught DOMException: Blocked a frame with origin ‘null’ from accessing a cross-origin frame”
  • Google Tag Assistant cannot find the GTM tag

Current Status:
The issue remains unresolved with no responses or solutions provided yet. The cross-origin frame error suggests a potential security/sandboxing conflict between Shopify’s Custom Pixel environment and GTM’s iframe-based implementation.

Summarized with AI on November 16. AI used: claude-sonnet-4-5-20250929.

I’m trying to implement the GTM through Custom Pixel, but there is no way to make GTM detect it.

I’ve inserted the following code:

//Google Tag Manager
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer',"MY-GTM-TAG");
// End Google Tag Manager

But Tag Assistant doesn’t find it. (Google Tag: MY-GTM-TAG not found)

If I take a look into the console, I see the following error:

Uncaught DOMException: Blocked a frame with origin “null” from accessing a cross-origin frame.

What could be wrong?