How to insert Google Adsense ads between posts in the form of an article



Google has recently made a lot of improvements that have been added continuously in recent times, including those that fall between posts to appear (as a post) I don't know what drives Google to such ways that ultimately lead to unintentional clicking on the advertisement despite its contradictory policy, especially since When applied, it will look like any article on the site, however when the user clicks on it, he will be directed to another site



Here is how to insert Google Adsense ads which are called feed ads.

  • 1. Log in to your Google Adsense account
  • 2. Click on " My Ads " and then choose " New Ad Unit "
  • 3. Choose In-feed Ads


  • 4. Choose the type of format required, according to the shape of your blog topics on the home page ( blog emails )



  • 6. Now go to your blog dashboard then appearance and then click on edit HTML
  • 7. Find the following code

<b:loop values='data:posts' var='post'>


then make it like this:


<b:loop values=' data:posts' var='post' index='x'>


i.e. index='x' should be added only for the above code


You will find many symbols


<b:loop values='data:posts' var='post'>


Replace the one that is only in the section:


<b:includable id='main' var='top'>...</ b: includable>


as in the following picture



  • 8. Then look for the following code

<div class='post-outer'>

and add the following code just below the code above:

<b:if cond='data:blog.pageType != "static_page" and data:blog.pageType != "item"'>

<b:if cond='data:x==1'>

<div class='post'>

Put your ad code here by NiaDzgn

</div>

</b:if>

<b:if cond='data:x==3'>

<div class='post'>

Put your ad code here by NiaDzgn

</div>

</b:if>

</b:if>




Add the ad code that you created through the previous steps, after converting it from here using the AdSense Ads Code Converter tool. 

click on Save appearance to see the results on your site and show ads consistent with your blog topics.


Post a Comment

To Top