Support » Plugin: AMP for WP - Accelerated Mobile Pages » More than one extension .jp script AMP warning after update

  • Resolved Chico

    (@blogginglife)


    I manually placed the following AdSense AMP ads.

    – AMP auto ads
    – AMP sticky ad
    – flying carpet

    After the recent update of AMP for WP plugin, we got the following AMP warning messages.

    The tag ‘amp-fx-flying-carpet extension .js script’ appears more than once in the document. This will soon be an error.

    The tag ‘amp-ad extension .js script’ appears more than once in the document. This will soon be an error.

    I took a look at the source code of AMP page, and found the following scripts inserted by AMP for WP.

    <script type=’text/javascript’ src=’https://cdn.ampproject.org/v0/amp-fx-flying-carpet-latest.js&#8217; async custom-element=”amp-fx-flying-carpet”></script>

    <script type=’text/javascript’ src=’https://cdn.ampproject.org/v0/amp-ad-latest.js&#8217; async custom-element=”amp-ad”></script>

    As a temporary fix, I deleted manually placed the following script for Flying carpet.

    <script async custom-element=”amp-fx-flying-carpet” src=”https://cdn.ampproject.org/v0/amp-fx-flying-carpet-0.1.js”></script&gt;

    It also looks like the plugin automatically inserts amp-ad script, and we got warning on The AMP Validator.

    <script async custom-element=”amp-ad” src=”https://cdn.ampproject.org/v0/amp-ad-0.1.js”></script&gt;

    After the temporary fix, the page passed AMP test, but I still got warning from the AMP validator.

    Can you please stop automatically inserting extension .js script for AdSense AMP ads, or add settings to prevent from insertion of AMP ads extension script?

    Thank you for your support and help in advance.

    Regards,

    Chico

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • I’m having the same issue since my last plugin update. Up until now, everything was fine but the issue just appeared in my Google Search Console.

    Here is the error message(s) in Firefox Developer Edition console: https://imgur.com/g2cvf4H

    Here it is as a cut and paste:
    amp-ad is already registered. The script tag for amp-ad is likely included twice in the page.
    v0.js:80:428
    ie
    https://cdn.ampproject.org/v0.js:80:428
    <anonymous>
    viewer-impl.js:272:15
    f.assert
    log.js:325:6
    Mh
    custom-element.js:845:8
    Nl
    vsync-impl.js:302:26
    Ml/<
    log.js:622:16
    Qd
    document-register-element.node.js:1244:17
    Ml
    vsync-impl.js:301:9
    f.addElement/<
    vsync-impl.js:285:13
    f.addDocFactory
    vsync-impl.js:355:12
    f.addElement
    vsync-impl.js:285:13
    f/<
    amp-ad.js:124:2
    f
    https://cdn.ampproject.org/v0/amp-ad-latest.js:106:2
    f.registerExtension
    viewport-impl.js:1127
    c/<
    viewer-impl.js:360:10
    [Show/hide message details.] Error: Doc factory failed: amp-ad: amp-ad is already registered. The script tag for amp-ad is likely included twice in the page.​​​ log.js:319:20
    f.assert
    log.js:319:20
    Mh
    custom-element.js:845:8
    Nl
    vsync-impl.js:302:26
    Ml/<
    log.js:622:16
    Qd
    document-register-element.node.js:1244:17
    Ml
    vsync-impl.js:301:9
    f.addElement/<
    vsync-impl.js:285:13
    Kl/</<
    vsync-impl.js:403:18
    forEach self-hosted:268:13 Kl/<
    vsync-impl.js:399:8
    Error loading remote config: https://www.googletagmanager.com/amp.json?id=GTM-KLHBNS&gtm.url=https%3A%2F%2Fwww.drbillsukala.com.au%2Fexercise%2Fslendertone-review%2Famp%2F Error: “XHR Failed fetching (https://www.googletagmanager.com/&#8230;): NetworkError when attempting to fetch resource.​​​”
    sahttps://cdn.ampproject.org/v0.js:8:169createExpectedErrorhttps://cdn.ampproject.org/v0.js:4:119fihttps://cdn.ampproject.org/v0.js:262:303 log.js:164:6
    ra
    log.js:164:6
    f.Ga
    log.js:219:6
    f.error
    log.js:234:18
    f/g.Xb/<
    amp-analytics.js:509:10

    • This reply was modified 3 years, 6 months ago by mesotu. Reason: added screenshot for clarity

    This happened for me too in terms of using amp-youtube. However, it is probably better to insert scripts automatically when a specific functionality is used for two reasons.

    Many people won’t know that if they use a specific function they will need to insert the script in the head and secondly, how would you manage to do it across very large numbers of pages or posts that need to be “amped”.

    It is going to be easier to remove the specific scripts you are using from the head on those pages where you have inserted them and let them be inserted automatically.

    I haven’t tested many cases but I see scripts only get inserted if they are being used and not sitewide.

    I’m thinking I’d have to dig into the bowels of the plugin files to make changes to the source code. This plugin was working fine for me up until the most recent updates. I’m seeing a lot of other people having this same problem all of a sudden, so it’s not an isolated incident. I don’t have any other plugins which would be adding AMP coding to my posts. When I disable this plugin and go to an AMP page (i.e., domain.com/post-title/amp) all error messages are gone. It there was another plugin introducing these duplicate entries, then I would assume I’d still be able to find the scripts in the source code, but I don’t. I’d welcome any insights on how to fix this.

    Plugin Contributor ampforwp

    (@ampforwp)

    Hello @blogginglife,@mesotu

    Can you please update the plugin to 0.9.96 and check if all your issue gets fixed or not.

    Please let us know.

    Thread Starter Chico

    (@blogginglife)

    Hi @ampforwp,

    I updated to 0.9.96, and it is fixed!

    The following .js script codes are no longer inserted. (and I placed .js script for amp-fx-flying-carpet and amp-ad manually.)

    <script type=’text/javascript’ src=’https://cdn.ampproject.org/v0/amp-fx-flying-carpet-latest.js’ async custom-element=”amp-fx-flying-carpet”></script>
    
    <script type=’text/javascript’ src=’https://cdn.ampproject.org/v0/amp-ad-latest.js’ async custom-element=”amp-ad”></script>

    Thanks for your quick support!

    I appreciate it.

    Regards,

    Chico

    • This reply was modified 3 years, 6 months ago by Chico.

    Hi @ampforwp and Chico (@blogginglife), I have just updated to 0.9.96 and can also confirm that the duplicate entries have cleared up. Thanks for this.

    However, I am still seeing a GTM issue on my end but I do not know for sure if this is something associated with the AMP plugin or if it is something else unrelated (i.e., my CDN or something). You can see the error message here: https://imgur.com/RUXHjHC

    Thanks again for the good work on the other duplicate amp entries.

    Hi @ampforwp, just adding to my last post, check out this link here related to this issue with the GTM: https://github.com/ampproject/amphtml/issues/13005
    Cheers

    Hi @ampforwp,

    I’m just following up to see if you were able to investigate further Google Tag Manager issues as per my above post (https://imgur.com/RUXHjHC). I’m working at the CDN and hosting level to see if there is something happening there, but so far no luck. My CDN and hosting provider were unable to locate anything on their end and suggested to speak with the plugin developer to further troubleshoot.

    I have disabled GTM in my settings and only activated the normal analytics. This fixed the problem, so I can confirm with reasonable confidence that something is still not right with the GTM configuration within the AMP plugin (or seems to be the case).

    I’d welcome your input and possible solutions for this issue. Thanks in advance.

    There appear to be two main issues related to GTM:
    1) Failed to load https://www.googletagmanager.com/amp.json?id=GTM-KLHBNS&gtm.url=https%3A%2F%2Fwww.my-domain-name.com.au%2post-name%2Famp%2F&__amp_source_origin=https%3A%2F%2Fwww.my-domain-name.com.au: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘https://www.my-domain-name.com.au&#8217; is therefore not allowed access. The response had HTTP status code 403. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.

    2) Error loading remote config: https://www.googletagmanager.com/amp.json?id=GTM-KLHBNS&gtm.url=https%3A%2F%2Fwww.my-domain-name.com.au%2Fpost-name%2Famp%2F Error: XHR Failed fetching (https://www.googletagmanager.com/&#8230;): Failed to fetch​​​
    at sa (log.js:505)
    at qa.f.createExpectedError (log.js:274)
    at custom-element.js:1380

    • This reply was modified 3 years, 6 months ago by mesotu. Reason: added more details

    Facing same issue, Version 0.9.96. The tag ‘amp-ad extension .js script’ is missing or incorrect, but required by ‘amp-ad’. This will soon be an error.

    URL: https://geekltd.com/tag/samsung-usb-driver-download/

    Screenshot: https://imgur.com/2sdrXMU

    Plugin Contributor ampforwp

    (@ampforwp)

    Hello @igeekyayush

    Can you please contact me on team@magazine3.com so I can check it personally and solve it for you.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘More than one extension .jp script AMP warning after update’ is closed to new replies.