In this post, we like to show you how to place Adsense ad code in the
So in this post, we gonna use a
Okay, Lets find out!
How use Ad Inserter to place Adsense code on WordPress site
Beforehand make sure you have installed Yoast SEO + Glue for Yoast SEO & AMP and of course AMP for WordPress by Automattic on your site.
We start with how to place Adsense code on WordPress site AMP version.
How to setup Adsense ad on AMP WordPress
First, you need to install the Ad Inserter plugin, the easy way to do it is go to the
When plugins activated, go to Settings > Ad Inserter in WP Admin to access the plugin settings page.
Inside Ad Inserter plugins page paste Adsense code from your Google Adsense account to Ad Inserter block, in this example I use block 1. Also, make sure you have create a custom ad unit for AMP version.
Next, click on the
Once you import the Adsense code, enable AMP Ad by choosing it Above or Below the fold, in Ad Type choose Standard, and in size choose the Responsive.
When done, click the Arrow down button to generate the Adsense code for AMP page of your site.
Below is the
Click Save All Settings to save the block setting.
We don’t finish yet ladies and gentleman, in order to make Adsense ad works on AMP site version you need to put AMP Ad / AMP embedded script inside your site header.
To do that, after you save the block setting copy the AMP Ad embedded code and paste it to site Header. Luckily you can do that with Ad Inserter.
Just go to Settings by clicking the ‘Gear’ button in the top right at the and of block numbers. And choose the ‘Header’ tab. Paste the script there then turn on the Header setting by
Tips #1 If you want to activate the Auto ads you also can put the code here.
Tips #2 For you, who just sign up to Google Adsense, you can also put Page Level Ads code here 🙂
Okay! when done, don’t forget to Save settings
The AMP Ad setup
For the final steps, go back to block 1 where you set
Just like screenshot above;
In ‘Automatic Insertion‘ choose Before or After paragraph.
Mark down only in ‘Posts‘ pages.
In Paragraph(s) you can try my settings like in the screenshot. Or, follow the built-in hover guide of Ad Inserter when you place your pointer in the Paragraph(s) form.
In ‘Count’ you can set it from ‘Bottom’ or ‘Top’ is up to you.
In the ‘Insertion’ tab just check mark for Ajax requests.
Then Save All Settings ! and you are done!
Just closing words
Thanks for reading, until the next post about WordPress and Blogging categories.
Good luck! ?