Support » Plugin: Ad Inserter - Ad Manager & AdSense Ads » amp ad tag is automatically inserted.

  • Resolved squallhajime

    (@squallhajime)


    Hi,

    If you look at https://validator.ampproject.org/#url=https%3A%2F%2Fexopetguides.com%2Fhedgehog-care%2Famp%2F you will find that there are duplicate tags.

    May I know if adinserter automatically add amp script tags into the header? especially amp-stick-ads and amp-ads these are the 2 ads that I need to stop it from appearing twice.

    I have already turned off the misc > insertion > amp pages options. Why do i still see script tags? When I disable your plugin that goes away.

    I am using ur plugin and ampforwp. I have to insert codes from ampforwp header instead of yours for my amp-stick-ads to show. May I know how can i remove your plugin auto-inclusion of amp script tags?

    Thanks

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Spacetime

    (@spacetime)

    Ad Inserter inserts only the code(s) you configure.
    Make sure you have not configure the plugin to insert the script:
    https://adinserter.pro/documentation/adsense-ads#amp

    You can also use debugging functions to diagnose insertions:
    https://adinserter.pro/documentation/debugging

    I am using adinserter to add manual placements for amp pages. So i definitely added in codes from my adsense. But I dont need the amp script tags to be added into the header as they are already added from ampforwp plugin. Under the plugin settings > header I have already removed any codes there.

    If it is automatically added, does this mean that adinserter and ampforwp is not compatible?

    Thanks.

    Plugin Author Spacetime

    (@spacetime)

    The plugin is compatible also with ampforwp and inserts only codes you have configured.
    You can check this with debugging functions as explained above.

    You didn’t enable remote debugging so we can’t check your settings:
    https://wordpress.org/support/topic/ad-inserter-support-before-you-ask-for-help/

    Hi

    I have used debug mode to turn off header already. but the script codes as seen in screenshot: https://imgur.com/a/O4ZilHJ are still showing up. When i asked ampforwp support. they said it is adsinserter plugin automatically creating <script> tags in the header that are similar to ampforwp <script> tags. Hence, i am getting the following errors:
    – The tag ‘amp-sticky-ad extension .js script’ appears more than once in the document.
    – The tag ‘amp-ad extension .js script’ appears more than once in the document.

    To solve the issue I can only add amp <script> tags from one source. But I can seem to remove yours so I can only change everything from ampforwp to yours.

    I can switch over all my <script> codes in header over to adinserter but i also need to add the following code in the beginning of the body for all my amp pages:
    <amp-sticky-ad layout=”nodisplay”>
    <amp-ad width=”320″ height=”50″ type=”adsense” data-ad-client=”ca-pub-999999999999″ data-slot=”123456789″></amp-ad> (this is for my amp sticky ads)

    Is there an option for this? I can only find <header> but not <body>.

    Thanks

    Plugin Author Spacetime

    (@spacetime)

    That script is not inserted by Ad Inserter.

    When i asked ampforwp support. they said it is adsinserter plugin automatically creating <script> tags in the header that are similar to ampforwp <script> tags.

    As explained, Ad Inserter does not insert ad codes or scripts unless you configure it to do so.
    What you see is what will be inserted.

    I see amp-ad script inserted only once and amp-sticky-ad not inserted.
    None of the scripts you are mentioning are inserted by Ad Inserter automatically.
    For each code and script you need to configure block, header or footer code in order to insert.

    It is possible to insert after <body> tag (position Above header):
    https://adinserter.pro/documentation/automatic-insertion

    But you need to enable Output buffering for this:
    https://adinserter.pro/documentation/automatic-insertion#output-buffering

    But I would suggest to first figure out which plugin or theme is inserting those codes.

    Make sure you flush all the caches after making changes so that you see the actual page code and not some old cached page.

    Hi

    The problem of “The tag ‘amp-ad extension .js script’ appears more than once in the document. This will soon be an error.” is back. Test page: https://exopetguides.com/what-do-axolotls-eat/amp

    I added <script async custom-element=”amp-ad” src=”https://cdn.ampproject.org/v0/amp-ad-0.1.js”></script> from ampforwp header section. Now a duplicated is generated from adinserter. As the moment I disable the ad inserter plugin, error just went away.

    As you can see in the screenshot: https://imgur.com/a/hnqnYZS I didnt add any codes under ad inserter header.

    In this next screenshot is the AMPforwp plugin header: https://imgur.com/a/3M7YUWc where i only added amp-ad code once.

    The error disappears when the ad inserter plugin is disabled. Is there any way to find out how ad inserter is generating amp-ad header codes?

    Thanks

    Plugin Author Spacetime

    (@spacetime)

    Ad Inserter does not insert anything by itself.

    I suggest to use debugging functions to diagnose where this code is coming from:
    https://adinserter.pro/documentation/debugging#back-end

    Disable all code groups and then enable one by one.

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.