Custom Javascript is not allowed in AMP pages unless it is AMP compliant. It is one of the restrictions of the AMP framework. That's is one of the reasons why an AMP page is very fast. Please do note that in some cases the custom code will work, but the page published will not be a valid AMP page. Only valid AMP pages are served through Google CDN so its important that your landing pages are AMP validated, you can check this here . If the custom javascript is a must, I recommend you to use Standard pages as its more versatile and allows customizations. You can create a Standard version of the your AMP landing page using the "Create Standard Version" option

Did this answer your question?