Welcome to WebmasterWorld Guest from 3.80.4.76

Forum Moderators: martinibuster

Message Too Old, No Replies

AMP AdSense code - changes

Specific instructions for above and below the fold

     
6:25 am on Feb 23, 2017 (gmt 0)

Junior Member from AU 

10+ Year Member Top Contributors Of The Month

joined:June 28, 2003
posts: 178
votes: 24


When refreshing my AMP AdSense units today, I noticed that Google is now pushing responsive sizes for AMP, and their new amp-ad code for AdSense appears to have specific recommendations for above-the-fold and below-the-fold slots.

Both of these recommendations weren't in the amp-adsense code last year when I was last working on ad-code, so it might come as much of a surprise to you as it did to me.

The details are here: [support.google.com...]

Hope that's useful for people here. Most of my pages are now AMP-enabled (the pages themselves are AMP, rather than making a separate version) and I'm seeing good results from doing so.
6:11 pm on May 1, 2017 (gmt 0)

Senior Member

WebmasterWorld Senior Member Top Contributors Of The Month

joined:Apr 1, 2016
posts:2686
votes: 814


@James007 thanks for this. I actually can across this support page on my own. It is a useful resource. But I have some questions regarding the implementation described in it that hopefully you may have since found answers for.

I created an AMP test page with two ad units on it, one ATF and the BTF. I implemented the ad code exactly as recommended in this article. I am running the site on my localhost using python bottle server. Neither ad display (most likely due to the implementation of the ad-balancer), the backup color also doesn't display. On page load one sees the outline of the ad box show-up but disappears instantly, the ATF seems to be sized correctly but the BTF ad seems to size to 300 x 100, despite the fact that the code explicitly tells it to size to 300 x 250.

The page validates as an amp page, and everything seems correct. Is this simply due to no ads appearing because of the ad-balancer? What was your experience?
10:30 pm on May 1, 2017 (gmt 0)

Junior Member from AU 

10+ Year Member Top Contributors Of The Month

joined:June 28, 2003
posts: 178
votes: 24


You'll probably see errors if you open the console - have you tried doing that? But my guess is that ads probably won't show on localhost - they take a few hours to configure themselves on my (publicly-viewable) development site. Testing is really quite hard.

I have seen ads resize themselves automatically on mobile; but I use the MEDIA attribute in amp-ad to set different sizes on different screens. I'm not allowed to link to my site, but if I could (it's two words - media and info - with a dot in the middle) you could view the source and see how I specify the different sizes.
1:33 am on May 2, 2017 (gmt 0)

Senior Member

WebmasterWorld Senior Member Top Contributors Of The Month

joined:Apr 1, 2016
posts:2686
votes: 814


@James007 thanks for the quick response.

they take a few hours to configure themselves

That seemed to be the problem. I tried it again everything is working as expected. No ads show, but the backup colors show which confirms that it is working.

And, yes I did check in the console and no errors show-up and the page validates as AMP.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members