AdSense Responsive Ads

What CSS did you use, and how did you add/enable it? Which ad units are you trying to limit the height?

It should be this if you want it to be 100px height of the ad unit above the topic lists:

.adsense-topic-list-top.adsense-responsive {
  height: 100px;
}
3 Likes

Thanks, I’ll give that a try tomorrow or later this week.

Been using the responsive ads for a full year, since my earlier praise in this thread. For some reason the large square ad format has increased popularity as time went by. Originally I got the large mobile banners, but now more squares.

Thanks, I’ll report back later.

3 Likes

@neil

Now I just realized that the code you pasted above was identical to the earlier. The reason I had issues implementing was that for some reason it does not work correctly in the Chrome Inspector / Mobile mode (the ad remains square and topics flood over it), but now when I implemented it again and verified on real devices, the results look as expected.

I’ll ask my community to verify this to get some device diversity.

Update: Well, our community is the best and had already spotted layout breakage. This happens on some Android devices at least.

I can see square ads in Chrome on Android too, and sometimes banner ads. I don’t see it underneath the topic list content though… Which devices are people seeing layout problems?

Also, I don’t see the CSS to control height, which would prevent the square ads.

1 Like

Sony XZ, Honor 7 and OnePlus 5T were used by those who reported. The screen capture was taken with the Sony phone.

And you want to allow square ads, which is why you didn’t add the custom css with height?

2 Likes

I’ve got this code in Google AdSense.

But I couldn’t understand in which field in the ‘Admin Settings> Settings> AdSense’ do I fill this code. And do I fill this entire code snippet (as google has asked) or only the 16 digit code?

And since there are several empty fields in my AdSense settings, do I leave them blank?

You don’t add the javascript code. Enter your ID as described.

4 Likes

Add the publisher ID and ad unit ID, but got the issue below :

I was having similar issues, and upon viewing the source of the page served, found that Discourse was stripping out the inline Javascript entirely.

This post mentions it:

but I don’t see a solution there.

Fair to note we should mention the specific CSP policy changes needed in the first post, can you take that @tshenry

4 Likes

I am guessing this is why I cannot get my Adsense to work at all. I am getting errors that it is blocking inline Javascript, even when CSP is disabled. Does Adsense work for anyone else, and if so, how are you getting around this issue?

Recently, AdSense did not show ads? Could you advice to fix it?

@bck055 Can you please provide more information.

1 Like

Hello @neil, here is our URL.
Could you advise issue?

@bck055 Did you follow the first post in this topic? See this section:

3 Likes

@neil Once again thank you for this plugin - this single component is a make-it-or-break-it feature for our community that runs without any other funding.

I have been running AdSense banners with the Responsive setting ever since this feature was introduced to the plugin. Recently however the Responsive ads have started misbehaving – I seem to be getting larger ad units that break the intended UX (too much ad content above the fold). I also get ads that are too big for my iPhone SE – they produce a large white space on the screen unless I turn the device landscape.

I had a look at the settings and noticed that ad size is now a multi-select option. I tried searching here but I failed to find information how does this multi-select feature actually work – what ad sizes are shown and when if I choose more than one?

1 Like

If you choose multiple sizes, the ad units will alternate between them evenly. So you could alternate between banner ads and square ads in the same ad slot, for example.

As for the ad height problems you’re seeing, you can try to add height rules to the ad slots like the first post in this topic shows:

2 Likes

I followed your instruction.
The issues are not fix!!!

It’s working for me (Linux, Firefox with content blocking disabled, no ad blocker extension installed). What errors do you see in your web browser’s javascript console?

4 Likes