{"id":3854,"date":"2017-11-21T12:02:34","date_gmt":"2017-11-21T06:32:34","guid":{"rendered":"https:\/\/bogusblogging.com\/?p=3854"},"modified":"2021-09-04T06:20:31","modified_gmt":"2021-09-04T00:50:31","slug":"amp-adsense-wordpress-guide","status":"publish","type":"post","link":"https:\/\/susanta.org\/amp-adsense-wordpress-guide\/","title":{"rendered":"AMP AdSense Guide: How to Display AMP Ads in WordPress"},"content":{"rendered":"

If you\u2019re planning to activate Google AMP on your WordPress site<\/a>, there\u2019s something you should know \u2014 you can\u2019t run Google AdSense ads of all formats.<\/p>\n

Google AMP is designed faster speed; therefore, it removes ads that are incompatible with the AMP standards. Normal Google AdSense ad code is essentially javascript that is not supported by the AMP project. Therefore, your ads won\u2019t appear on AMP-enabled posts\/pages.<\/p>\n

In fact, this is one of the major reasons why many webmasters are still not ready to switching to Google AMP. Many others are quickly undoing their AMP efforts<\/a> in a bid to get back their traffic and performance metrics.<\/p>\n

However, if you\u2019re willing to jump on the AMP bandwagon and still want your AdSense to appear, you need to use an AMP-compliant version of your AdSense ads.<\/p>\n

How to Make AdSense Ads AMP-Compliant<\/h2>\n

If you\u2019re using any WordPress plugin that helps you insert AdSense ad code into your site, this guide might become easier for you to follow.<\/p>\n

The best way to implement AMP-supported AdSense ads on your site is to add tag as recommended in Google AMP Project.<\/p>\n

Here\u2019s an example of the AMP Version of an AdSense Code<\/p>\n

\"\"<\/p>\n

Technically, you needn\u2019t create separate ads for your AMP-compliant pages unless you want to really track the performance of those Ads specifically.<\/p>\n

I personally recommend the following approach:<\/p>\n

Step #1:<\/strong> Go to the AdSense plugin you\u2019ve installed on your site. Click to modify the Ad Code.<\/p>\n

Step #2:<\/strong> Create an AMP version of the existing Ad Code and insert it below the standard AdSense code.<\/p>\n

This basically means both versions of your AdSense code will work based on whether you\u2019re viewing it on a Desktop Computer or Mobile Device.<\/p>\n

Convert Your AdSense Code to Its AMP Version<\/h2>\n

Here\u2019s what a standard AdSense code looks like. As you can see, I\u2019ve created a responsive ad format. Therefore, the data-ad-format is \u201cfluid\u201d. I\u2019d also recommend the same for your site unless you have found another way to make your ad behave responsively on your site.<\/p>\n

Also, the data-ad-layout is \u201cin-article\u201d which essentially mean this ad is designed to respond well within an individual post.<\/p>\n

The next two lines are essentially number related to your AdSense account. I\u2019ve inserted dummy numbers in the ad-client and ad-slot areas.<\/p>\n