How I got responsive Adsense to work

  • Responsive Adsense will not show up on your WBB forum if you just paste you Adsense code into an ad slot because there are no defined widths for those ad slots. I was able to get Google Adsense to work on my site by placing the responsive ad code from Google within divs like so:


    Code
    <div id="respad">
    Google responsive Adsense code goes here.
    </div>


    Since I have my ads placed in the top and bottom content areas I made my width wide when defining them, you should adjust it for the sidebar area. Next I went to my ACP> Styles> List Styles> chose my default style and then went to Advanced Settings and added the following to the Individual CSS section:


    CSS
    #respad {
    width: 740px;
    }
    @Media only screen and (max-width: 990px) {
    #respad { width: 360px; }}


    The above is working for me :)

    Edited once, last by LogixX ().

  • Have tried using width: auto

    Not "auto" but I did try using a max-width and it didn't work, the responsive ads need a defined fixed width so they know what size to adjust to (I'm guessing that's the reason).

  • So the only way to use responsive ads is by making them non-responsive ...

    The advertisements themselves are set at fixed widths and placing them in containers that have a setting like max-width 100% doesn't give them a size they can adjust to.


    See Google Adsense widths https://support.google.com/adsense/answer/6002621?hl=en none of them are truly responsive.



    Automatic sizing based on the space available. To make your code simpler and save you time and effort, our responsive ad code automatically adapts the ad unit size to your page layout. We calculate the required size dynamically based on the width of the ad unit’s parent container, then determine what's the best standard height to go with that width.


    I haven't tried setting a container width with percentages to something less than max-width 100% so I'm not sure if the following works like they claim.



    For example, if you have a <div> with a width of 30% and you place our responsive ad code within the <div>, then depending on the width of the user's screen, we’ll automatically serve different ad sizes. If your page is viewed on a tablet with a width of 1024px, we'll serve a 307x250 ad, and if it's viewed on a 21" desktop PC with a 1680px width, we'll serve a 504x60 ad.

  • Well, no matter what I've tried, it won't work on my site... no big loss really. In 4+ years I think I've made around $70 USD on my sites. :rolleyes:
    There does need to be more thought put into the add system internally for the script though. It's very easy to embed the responsive adsense into XF into the appropriate ad templates and it work - in fact, it's fairly easy to get it very customized



    I haven't even contemplated doing this yet since the viewport isn't apparently passed to allow the responsive to work natively.

  • I can only choose between Asynchronous and Sychronous.

    Asynchronous


    3. Computers, Telecommunications. of or relating to operation without the use of fixed time intervals (opposed to synchronous ).

    Sychronous


    4.Computers, Telecommunications. of, relating to, or operating using fixed-time intervals controlled by a clock (opposed to asynchronous ).


    You would have to decide which is best for you.

  • Responsive Adsense will not show up on your WBB forum if you just paste you Adsense code into an ad slot because there are no defined widths for those ad slots. I was able to get Google Adsense to work on my site by placing the responsive ad code from Google within divs like so:


    Code
    <div id="respad">
    Google responsive Adsense code goes here.
    </div>

    LogixX where did you ad google adsense code in acp ? Google says in the header.

  • LogixX where did you ad google adsense code in acp ? Google says in the header.

    It goes in an advertisement slot, you choose which position on your forum where it should appear. You need to enable ads before you can add them, the screen shots are for WBB 4.1.