Responsive AdSense

Responsive AdSense

The code goes in the ad_ templates.

The second example in the resource explains how to place an ad under the first post.
 
I'll be honest, I've been spending hours trying to wrap my head around all of this and I'm just really struggling.

I've got my ads setup great with conditionals on user groups, etc. but the whole responsive / mobile ads issue is still a problem. Here's my question:

Is there an easy way within the ad_ templates to do the following:

If screenwidth is > 400 show code_xyz
If screenwidth is > 400 show no_ad_code
 
I'll be honest, I've been spending hours trying to wrap my head around all of this and I'm just really struggling.

I've got my ads setup great with conditionals on user groups, etc. but the whole responsive / mobile ads issue is still a problem. Here's my question:

Is there an easy way within the ad_ templates to do the following:

If screenwidth is > 400 show code_xyz
If screenwidth is > 400 show no_ad_code

Don't get as confused as I did.......

Google is updating the code, it seems. If you create a responsive ad, you can paste the code right in there as it comes with the basic queries........ready to go! At least it worked for me.....

Here is what I am using for one and it seems to work - in fact, the first day shows no loss of revenues in terms of this compared to a static sized ad....

Everything in this code is stock from google except the two center tags around it.

Code:
<center>
<style>
.response-sample { width: 320px; height: 50px; }
@media(min-width: 500px) { .response-sample { width: 468px; height: 60px; } }
@media(min-width: 800px) { .response-sample { width: 728px; height: 90px; } }
</style>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- response sample -->
<ins class="adsbygoogle response-sample"
    style="display:inline-block"
    data-ad-client="ca-pub-3514#######23"
    data-ad-slot="560********"></ins>

<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</center>
 
Last edited:
Thanks craigiri!

I guess there isn't an easy way to manually do this just in a template and also show no ad placement for screens under xyz pixels?
 
I'm trying to instert ads to different locations like Sidebar Panel, has anyone added adsense on location "Sidebar Top"?
 
I want to add some advertising into the Header. But on 320 width no Ad should be displayed.
But from what i read @Brogan posted it´s against Adsense ToS?

Isnt there any (legal) way to not show ads on width 320?
e.g. empty Template?
 
Not sure if it's because I'm tired or because my coding skills are crap/non existant, but I'm not getting this other than "put it in the ad_templates" ;)

My actual question is is anyone familiar with "openx / revive" and is there a way to get it to work with this?

Sorry if this is the wrong place for this question.
 
This resource is specifically for AdSense.

You will need to contact those providers to see what solutions they have.
 
Either I'm being a dope, or I've had a wee bit too much to drink, or more likely both, but where do you actually put your Adsense code? I'm trying to use the 2nd example and put an ad after the first post, but not sure where to actually put my Adsense code

Any help would be awesome!
 
The blue text? Do I need to create an ad with the 3 different dimensions then paste the code instead of the blue text?
 
You need to read the whole resource - it explains what you need to do.

The first thing you need to do is create the ad slots via your Google AdSense account.
 
Top Bottom