Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Google Ads width

  • Hi,

    In mobile view the width of the Google Ads are sometimes higher then the overall width of the page. So this does not create a good experiences e.g., scrolling left and right.

    How can I ensure that the ads shown are always within the width limit?

    Thanks,

    Example here: https://ibb.co/7xVTKmCY

  • Hi there,

    Are you using Auto Ads? If so, those are inserted dynamically by Google and can appear in different parts of the HTML. Unfortunately, their placement isn’t something the theme can control.

  • Nope, I am not using Auto Ads. I generated a specific one.

    
    My Google Ads code:
    
    <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6757953720241725"
         crossorigin="anonymous"></script>
    <ins class="adsbygoogle"
         style="display:block"
         data-ad-format="autorelaxed"
         data-ad-client="ca-pub-6757953720241725"
         data-ad-slot="2398160791"></ins>
    <script>
         (adsbygoogle = window.adsbygoogle || []).push({});
    </script>
  • Try this CSS:

    ins.adsbygoogle * {
        max-width: 100% !important;
    }
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.