Support » Plugin: Ad Inserter - Ad Manager & AdSense Ads » Posts id causes ads to hidden in home page too

  • Resolved NUCUTA


    I have this article written about sex robots and artificial intelligence
    and even though it’s just a social discussion, google doesn’t allow their ads on pages like these, so I decided to use only amazon ads in it. I added this page’s ID in the “POST ID” field in adinsert and selected “blacklist” to make google ads to not appear in this page only, but for some reason the google ads now don’t even show in the homepage. yeah I selected the “homepage” checkbox, to overcome from this problem, currently I use the URL field instead of POSTID field. still I am wondering why postid field doesn’t work.

    • This topic was modified 3 years, 4 months ago by NUCUTA.
Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Author Spacetime


    well I posted all the data. perhaps you can go to this particular page and check? I dunno what else to post.

    Plugin Author Spacetime


    Remote debugging doesn’t seem to be enabled.

    Yeah I already enabled it, but forgot to clear the cache. now just did it.

    Plugin Author Spacetime


    Please disable caching otherwise it doesn’t work – we get cached normal page.

    You’ll enable it back after the check.

    When you log out, go to
    You should see debugging info at the bottom of the page source code.

    Okay done. 🙂

    Plugin Author Spacetime



       0  BLOCK 7 INSERTED
       0  BLOCK 1 INSERTED

    Block 6 can’t be inserted on homepage as you have defined post ID.

    It also makes no sense to define ID, url and category for the same block. ID or url uniquely defines post.

    Plugin Author Spacetime


    Available positions for automatic insertion on homepage

    Inserted blocks on homepage

    Make sure you are on the mobile view (use chrome’s f12), because I used some CSS rules to hide desktop ads in the mobile, and hide mobile ads in the desktop.

    Yeah the MobilePost is in the block 6. It works if I just blacklisted the URL, then the MobilePost ad only displays in the home page, but not in this AI article, but if I specified this particular article’s ID, then this ad doesn’t appear in the home page as well. Strangely, the block 7 which shows another ad (Mobile and Desktop Underslider) works just fine even if I just used the postID, perhaps because I only checked “Homepage” checkbox?

    I currently use both the ID and the URL in the block 6, but it doesn’t matter, if I just removed the ID, the ad starts appearing in the home page, and if I used just the ID, the ad doesn’t appear. The only thing that works is when using the URL of this particular article.

    Plugin Author Spacetime


    Regardless of the device used Show blocks shows all inserted blocks (even if they are hidden for current device – marked blue).

    Block 7 is enabled only for homepage and has no black/white lists. Inserted as expected.

    Url is the strongest filter for your purpose as the theme may process post excerpts for homepage and inadvertently insert ads configured for posts. So black list only url for this post.

    In general, you can’t use the same block for homepage and posts. Define two different blocks each with required settings.

    Plugin Author Spacetime


    I also noticed that you are not using client-side detection for different ads on mobile/desktop browsers.

    Since you are using caching you should use client-side device detection for proper display.

    Check also

    I am wondering why the block 6’s ad hides in the home page when the ID is specified, but not the URL? still it’s not supposed to hide right if I checked both “post/homepage” checkboxes? because I only blacklisted the “POSTID”. If “PostID” doesn’t work in this scenario, what is the purpose of the “postID” field? It appears as the “postID” only works when “homepage” checkbox isn’t checked, and only the “post” checkbox is checked. And like you said if we can’t use the same block for both homepage/posts, then why there are checkboxes? not radioboxes?

    • This reply was modified 3 years, 4 months ago by NUCUTA.

    I don’t use client side detection, because it’s done with custom codes (CSS). This is the block 6’s CSS.

    <style type=”text/css”>
    .small_mobile_main { display:inline-block;width:320px;height:100px; }
    @media (max-width:319px) { .small_mobile_main { display:none; } }
    @media (min-width:468px) { .small_mobile_main { display:inline-block;width:468px;height:60px; } }
    @media (min-width:728px) { .small_mobile_main { display:inline-block;min-width:617px;max-width:728px;width:100%;height:90px; } }
    @media (min-width:960px) { .small_mobile_main { display:none;} }

    oh I forgot to mention, block 1 works fine in the same settings (like in block 6 – only the ID is blacklisted, made to show in both POST/HOMEPAGE), but it’s inserted into the widget. So it appears as this problem is only when it’s inserted with PHP codes? I am not exactly sure, more testings are required.

    Plugin Author Spacetime


    You can always check debug info for the reason why some block was not inserted.

    For homepage (and all blog pages) Post ID is not defined so using it may cause unpredictable results.Post ID is defined only for posts and pages.

    Checkboxes because you need to specify on what page types you want insertion.
    In most cases you select either single pages (post or static page) or blog pages (home, category, archive,…). Usually more than one choice.

    On some themes and for some positions (e.g. Before/After Post) you can also select single pages and blog pages at the same time (multiple selections).

    Widget exists on all pages and on post the ID is defined and therefore block 1 is blacklisted, but on homepage ID is not defined (no post or static page) and insertion is unpredictable. Use url for reliable exclusion.

    • This reply was modified 3 years, 4 months ago by Spacetime.
Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Posts id causes ads to hidden in home page too’ is closed to new replies.