• I have an issue in wordpress site, i have to use AMP Plugin for mobile page speed increase but,some javascript are blocked by AMP. I have to enable blocking javascript to unblocked what can i do.

    <script src=”https://api.deals.shermanstravel.com/assets/widget.js”></script&gt;
    <script type=”text/javascript”>
    new DealsWidget(‘dd8d7558591f09d26ff35ceb270042f4d606438516d9b9c17f57e46406abbc67’, { use_images: true, no_follow: true });
    </script>

    above js file use in widgets but still AMP Block this js how to unblock above js.

    Please Help this issue slove.

    Thanks, Sandip

Viewing 2 replies - 1 through 2 (of 2 total)
  • @sandip77 Custom JavaScript rendered in the front end of a website will result in validation errors. Whether it’s in widgets or within pages/posts you will need to use the amp-script component or find an AMP compatible replacement that provides the same or similar functionality.

    Thread Starter Sandip Parmar

    (@sandip77)

    Hi,
    Greeting of the day,

    @jamesosborne I have to use below script for amp-script but still not working.

    use this meta tag – <meta name=”amp-script-src” content=”sha384-YCFs8k-ouELcBTgzKzNAujZFxygwiqimSqKK7JqeKaGNflwDxaC3g2toj7s_kxWG” /> and <script async custom-element=”amp-script” src=”https://cdn.ampproject.org/v0/amp-script-0.1.js”></script&gt; added in header.

    <amp-script src=”https://api.deals.shermanstravel.com/assets/widget.js”></amp-script&gt;
    <amp-script script=”webSocketDemo”></amp-script>

    <script type=”text/plain” target=”amp-script” id=”webSocketDemo”>
    new DealsWidget(‘dd8d7558591f09d26ff35ceb270042f4d606438516d9b9c17f57e46406abbc67’, { use_images: true, no_follow: true });
    </script>

    Please help to this js allow in AMP Blocking js.

    Thanks,
    Sandip

    • This reply was modified 5 years, 2 months ago by Sandip Parmar.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘AMP Plugin Blocking JavaScript’ is closed to new replies.