Support » Plugin: Ad Inserter - Ad Manager & AdSense Ads » Phone ads always with max width

  • Resolved encoresin

    (@encoresin)


    Hello,

    First of all I want to thank you for this great addon!

    Im using Ad Inserter on several sites and I always have problem with theme boxes. So everything work great on PC. But when I going to use my phone its not that good.
    I mean that theme showing all in boxes and Adsense res ads just dont care about this boxes width. Ads starting from left side to right side of the screen. I found one solution code but then I need to write all sizes for myself and its not really handy…

    When I using custom CSS in the addon and using preview wo change margins – nothing happens. On PC there is a correct margin in the boxes.

    Whats is wrong?

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

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

    (@spacetime)

    Recently Google changed behavior of responsive ads on phones.
    Now they use full screen width by default.

    This is the new code:

    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <ins class="adsbygoogle"
         style="display: block;"
         data-ad-client="ca-pub-xxxxxxxxxxxxxxx"
         data-ad-slot="xxxxxxxxxxx"
         data-ad-format="auto"
         data-full-width-responsive="true"></ins>
    <script>
    (adsbygoogle = window.adsbygoogle || []).push({});
    </script>

    If the attribute data-full-width-responsive is missing or set to true the responsive ad will occupy full screen width.

    You need to set it to false (simply add the line if it is missing):

    data-full-width-responsive="false"

    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <ins class="adsbygoogle"
         style="display: block;"
         data-ad-client="ca-pub-xxxxxxxxxxxxxxx"
         data-ad-slot="xxxxxxxxxxx"
         data-ad-format="auto"
         data-full-width-responsive="false"></ins>
    <script>
    (adsbygoogle = window.adsbygoogle || []).push({});
    </script>

    You can also use built in code generator to set Full width to false:
    https://adinserter.pro/documentation/adsense-ads#code-generator

    Thread Starter encoresin

    (@encoresin)

    I see. My code don’t have that line. And its not a box but fluid. Only one from my all 6 had similar code to this.

    Is that just enough if I add this line to code?

    If I use generator, firstly should I make ad# on my adsense account?

    Thank you very much!

    Plugin Author Spacetime

    (@spacetime)

    Yes, it should be enough – this is the easiest way.

    With the generator you can import existing code, change responsive width setting and then generate back the code.

    Thread Starter encoresin

    (@encoresin)

    Hey,

    It’s work fine now! Thank you!!!!!

    Plugin Author Spacetime

    (@spacetime)

    You are welcome 🙂

    If you like the plugin I would appreciate if you could write a short review here on WP:
    https://wordpress.org/support/plugin/ad-inserter/reviews/#new-post

    Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Phone ads always with max width’ is closed to new replies.