Reputation: 226
Responsive adsense ads are working fine on my responsive website but I would also like to add horizontal "ad links" to the website (to be shown only on desktop due to higher width).
So, what I want to do is place 728x15 ad link unit in the responsive site and make them visible only for large screens (read desktop). However, as per adsense policy, changing ads through media queries is allowed only in responsive ad units (through display: none) but there are no responsive ad for "ad links".
Any ideas how can I implement adsense "ad links" in a responsive website so these link ads are shown only on larger screens (say for min-width:800) without violating adsense policies.
Thanks.
Upvotes: 4
Views: 3052
Reputation: 1071
A solution called WURFL.js allows you to leverage WURFL at no cost (community edition)
The same framework with more WURFL properties and more features is available though the Business Edition of the same tool. To avoid doubt, I am affiliated with ScientiaMobile, the company that offers these tools.
Upvotes: -1
Reputation: 1106
You could also try a "device detection" solution like WURFL cloud, which at the time of writing this costs $40p.m.
With that solution, you can get things like "IS_DESKTOP" and "IS_MOBILE" and "IS_TABLET".
From there you can really customise your ads to your different devices. For example, on the desktop you can display the 728x15 block, and on mobiles you can display something smaller like 200x90, meaning you're not missing out on possible mobile based revenue.
It also allows you to test different ad blocks on different devices really well... what works best on tablets? Is it 728x15 or 468x15. Or what about normal ad blocks (not ad links) on mobile devices, is it text only, or image, or both? Does an ads perform better in different positions on different devices?
You can get really granular with this approach in an easily maintainable way. If you have a decent amount of traffic to your website you shouldn't have a problem making more than an extra $40p.m in adsense revenue, mitigating the cost of using a service like WURFL cloud (and no, I am in no way affiliated with then, it's just a solution I use, partially based upon my desire to have an easily maintainable way to get really granular with my adsense on different devices).
Good luck.
Upvotes: 1
Reputation: 2176
As far I can see display:none
method for not showing AdSense ad, does work with (asynchronous) link units and I think it does work for all asynchronous AdSense units. (For every AdSense snippet with adsbygoogle.js
in script src
.)
But, you are right: AdSense Help Center is not mentioning "asynchronous" and it explicitly says "Hiding ad units at anytime (e.g., display:none), unless you're implementing a responsive ad unit".
My wild guess is that might be because there are already @media
queries in original responsive code (code you get from the AdSense dashboard), and the risk of error and the number of modifications are minimal:
style
attribute from ins
tag style
tag ("first line") display:none
on ins
tag via custom class (.adlinkunit1
in example below) So this should work for you ("link ads are shown only on larger screens (say for min-width:800)":
<style type="text/css">
.adlinkunit1 { display:inline-block;width:728px;height:15px }
@media ( max-width: 800px) { .adlinkunit1 { display: none; } }
</style>
<ins class="adsbygoogle adlinkunit1"
data-ad-client="ca-pub-..."
data-ad-slot="..."></ins>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>(adsbygoogle = window.adsbygoogle || []).push({});</script>
(Please note max-width
is used for display:none
.)
Personally I think above example is not a violation of the AdSense policies, but also I'm not sure why Help Center says "responsive" and of course - what will happen if Google would ever decide (for some reason) to remove (undocumented) display:none
support from non-responsive asynchronous units.
Upvotes: 4