• Resolved cvrle77

    (@cvrle77)


    I’ve managed to find a code, and insert ads on single post, on AMP pages, from a user that gave PHP solution to that. Other one didn’t work for me.

    Now, I am interested in solution, how can I insert ads on AMP category/tag/main page between list of posts. Each of them have 10 posts per page, including main page.

    I’ve been playing with plugin for hours to find a solution, and finally gave up.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter cvrle77

    (@cvrle77)

    I would like to insert code between 3rd and 4th post
    Page example: https://brzikolaci.com/amp/page/116
    Same for Home page https://brzikolaci.com/amp
    or tags https://brzikolaci.com/tag/kiselo-testo/amp
    categories: https://brzikolaci.com/kolaci/rolati/amp/page/7

    I am using this code, because it is the only one working for me, I did not understand your solution

    <?php
    if ( is_amp_endpoint() ) {
    echo '<div class="MyAdClass">
    <amp-ad width="auto" height="250"
            type="adsense"
            data-ad-client="ca-pub-xxxxxxx"
            data-ad-slot="xxxxxxxxx">
        </amp-ad>
      </div>';
    }
    else {
    echo 'your standard code';
    }
    ?>

    EDIT: figured out tags categories, and following pages for them.
    I cannot figure first and 2nd example. Home page and pages 2,3 etc following after you go to load more

    • This reply was modified 7 years, 10 months ago by cvrle77.
    • This reply was modified 7 years, 10 months ago by cvrle77.
    • This reply was modified 7 years, 10 months ago by cvrle77.
    Plugin Author Spacetime

    (@spacetime)

    General solution for AMP pages:
    https://adinserter.pro/settings#amp

    • Automatic Insertion: set as needed
    • Select No wrapping style
    • Whitelist url */amp/
    • Put AMP head script in the Header code block (tab *)
    • For all other ads on standard (non AMP) pages blacklist url */amp/

    To insert ads between posts on blog pages use Between posts automatic insertion.
    To insert only between 3rd and 4th post set filter to 3 (section Misc).

    Thread Starter cvrle77

    (@cvrle77)

    It doesn’t work. I did managed to insert ads in tags and categories.
    However, I cannot get ads on my Home page, and page 1, 2, 3…

    When I turn on debugging, and add ?ai-debug-positions=0 in AMP link for categories, or tags, or single page, I can see ad placeholders. But there is no placeholders on AMP Homepage of my site.
    https://brzikolaci.com/amp?ai-debug-positions=0
    https://brzikolaci.com/amp/page/2?ai-debug-positions=0
    and here is how it looks Main page

    and this is how categories look like: Categories

    Btw ad in footer is not an ad from Ad Inserter.

    • This reply was modified 7 years, 10 months ago by cvrle77.
    • This reply was modified 7 years, 10 months ago by cvrle77.
    • This reply was modified 7 years, 10 months ago by cvrle77.
    • This reply was modified 7 years, 10 months ago by cvrle77.
    Plugin Author Spacetime

    (@spacetime)

    Since you would like to insert between posts also on subpages you need to use url list: */amp*

    Thread Starter cvrle77

    (@cvrle77)

    I’ve tried, it doesn’t work. On these image I was trying to show you that. First image is main page. Debugger doesn’t show placeholders.

    Plugin Author Spacetime

    (@spacetime)

    Then please contact me.

    Plugin Author Spacetime

    (@spacetime)

    It was found out that for AMP version of homepage Ad Inserter is not called.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘AMP ads on main/cat/tag page’ is closed to new replies.