2

This is unusual. This code causes me to receive pennies per RPM for my website:

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"></ins>
<script> 
(adsbygoogle=window.adsbygoogle||[]).push({params:{data_override_format:"true",data_page_url:<url where ad is located>,google_ad_slot:"###",google_ad_client:"###",google_ad_width:<width determined by php>,google_ad_height:<height determined by php>}}); 
</script>

This code however causes me to receive far less RPM:

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"></ins>
<script> 
if (screen.width > <width determined by php - 1> || window.clientWidth > <width determined by php - 1> || window.innerWidth > <width determined by php - 1>){
(adsbygoogle=window.adsbygoogle||[]).push({params:{data_override_format:"true",data_page_url:<url where ad is located>,google_ad_slot:"###",google_ad_client:"###",google_ad_width:<width determined by php>,google_ad_height:<height determined by php>}}); 
}
</script>

Yet, when I tested both scripts on my computer, they executed with no problem. I even tested it on my mobile device and had no problem. The second code, I applied to the site for less than 24 hours. The first code I reapplied to the site after the second code and within 20 minutes from the switch, I immediately noticed an increase in RPM.

The reason why I did this is two-fold. One, to try to prevent bots from screwing around with adsense on my site, and Two, to eliminate scrolling on smaller devices just because of an ad.

The ad width and height is determined by a PHP script and is dependent on the page being loaded.

So my question is, Why should I suffer in earnings even tho I'm following adsense rules even more by clearly protecting artificial RPM inflation from happening? And if anyone knows a better script that the adsense ROBOT approves of that I can use to prevent random bots from clicking ads on my site, let me know.

3
  • I have some level of bot detection in my code that runs my sites. If I detect a bot, and I use relatively loose criteria for this, I do not show any Google code and tell them they are blocked from receiving content. I white-list search engines and they are completely excluded. I could be far more precise of course, but I was being lazy in writing code. Yes. Bots can be mistaken as a user by Google and skew numbers. However, this is fairly rare overall given the number of bots. RPM is a semi-complex number based upon bidding and CTR more than user/page counts (I could be wrong on this). – closetnoc Mar 26 '15 at 22:07
  • I use keywords and semantic clues to attract users that increase RPM. In this case, I had to pay attention to search keywords and tune the pages primary signals toward these to match user intent, but also tune lower value clues (h2, h3, ..., and content) toward those who are more likely to click on an ad. It is partially about chasing money keywords and splitting search into two markets- looky loo's and buyers. You want buyers. – closetnoc Mar 26 '15 at 22:14
  • BTW- This is a very interesting question. I up-voted it of course. I would have to think on this. I like the complexity and ingenuity. I would be interested in what others think. – closetnoc Mar 26 '15 at 22:41
1

Google has published their recommendations on how to implement responsive units along with a code sample on how to hide the ad unit for certain screen sizes. You can view it here: https://support.google.com/adsense/answer/3543893?hl=en&ref_topic=1307438 (Click on the heading titled Hiding an ad unit)

3
  • That makes me ask you something. What are the odds of someone owning a mobile device that does not have a display width of 320 hardware pixels? If the number is extremely high, then I could try your answer to block out oversized ads to see if my income improves – Mike -- No longer here Mar 31 '15 at 1:23
  • I design my pages for a minimum width of 320 pixels. The original iPhones had that physical pixel width. Newer iPhones still report that as their pixel width and then scale the page to be larger. – Stephen Ostermiller Apr 3 '15 at 15:30
  • @Mike this might be helpful: ux.stackexchange.com/questions/74798/… (I think devices under 320px are very rare) – MichelleMaBelle Apr 4 '15 at 19:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.