Zaraz AMP issue

Hi when enabling Zaraz Custom HTML on Google Search Console get a message

“Top critical issues*
Custom JavaScript is not allowed.”

when looking at sources have

<script nonce="8f20af97-f549-459f-a306-1c5ad67d7f07">(function(w,d){!function(a,e,t,r){a.zarazData=a.zarazData||{};a.zarazData.executed=[];a.zaraz={deferred:[],listeners:[]};a.zaraz.q=[];a.zaraz._f=function(e){return function(){var t=Array.prototype.slice.call(arguments);a.zaraz.q.push({m:e,a:t})}};for(const e of["track","set","debug"])a.zaraz[e]=a.zaraz._f(e);a.zaraz.init=()=>{var t=e.getElementsByTagName(r)[0],z=e.createElement(r),n=e.getElementsByTagName("title")[0];n&&(a.zarazData.t=e.getElementsByTagName("title")[0].text);a.zarazData.x=Math.random();a.zarazData.w=a.screen.width;a.zarazData.h=a.screen.height;a.zarazData.j=a.innerHeight;a.zarazData.e=a.innerWidth;a.zarazData.l=a.location.href;a.zarazData.r=e.referrer;a.zarazData.k=a.screen.colorDepth;a.zarazData.n=e.characterSet;a.zarazData.o=(new Date).getTimezoneOffset();a.zarazData.q=[];for(;a.zaraz.q.length;){const e=a.zaraz.q.shift();a.zarazData.q.push(e)}z.defer=!0;for(const e of[localStorage,sessionStorage])Object.keys(e||{}).filter((a=>a.startsWith("_zaraz_"))).forEach((t=>{try{a.zarazData["z_"+t.slice(7)]=JSON.parse(e.getItem(t))}catch{a.zarazData["z_"+t.slice(7)]=e.getItem(t)}}));z.referrerPolicy="origin";z.src="/cdn-cgi/zaraz/s.js?z="+btoa(encodeURIComponent(JSON.stringify(a.zarazData)));t.parentNode.insertBefore(z,t)};["complete","interactive"].includes(e.readyState)?zaraz.init():a.addEventListener("DOMContentLoaded",zaraz.init)}(w,d,0,"script");})(window,document);</script></head>
<body>

How can solve that?

Greetings,

Thank you for asking.

Yes, correct. We cannot add some 3rd-party JS code into the AMP HTML page just as we’re used to have in HTML page.

However, there is some way for amp-script support, but I am afraid currently not possible via Zaraz, at least not directly:

I remember I’ve done it back a while ago, using Page Rules and since my AMP URLs were like https://example.com/article-title/amp/ → the /amp part in the end, then simply with matching example.com/*/amp* with the option “Disable Zaraz” worked fine.

Otherwise your URLs might be kind of like example.com/article?amp?amp part or some different?

Below article also suggest this approach:

Hello! The same thing is happening to me, I have applied “deactivate Zaraz” in the rules configuration, but I don’t know if it is working for me since in my AMP pages checking in the browser it still loads Zaraz. Could you help me check if my rule is correct?
full URI = https:// qualityassist.mx//amp I also tried Ruta URI = /?amp


Thanks!