Skip to main content

How to Add Adsense Ads In the Middle or Anywhere inside Blogger Posts

In a previous post we saw how and where we can place Adsense ads on our blog; however, these methods would only work when we place the ads on predetermined and fixed locations. For posts area, the most common places are below the title, at the beginning of the post or at the end of the post.

But what if we want to display an AdSense ad in the middle of a post?
We can manipulate the location of the ads to be displayed by adding a script inside the template and using a tag inside our post to where we want the AdSense ad to appear. Once added, we can place the ads anywhere, be it between paragraphs or in the middle of the content etc.
Manually inserting Adsense ads in the middle of posts in Blogger is pretty simple, just follow these steps below:
Before proceeding, it is recommended do backup your template (go toTemplate > click on the Backup/restore button)
Step 1. First thing we need to do is to "parse" the AdSense code, in other words, convert it to plain text. Then go to Template, click on the Edit HTML button, click anywhere inside the code area and look for this tag (CTRL + F):


<data:post.body/>
Note: you may find it several times, but we need to stop at the second one or if you can't see any changes, test the third one
Screenshot
Step 2. Replace the <data:post.body/> tag with this code:
<div expr:id='"adsmiddle1" + data:post.id'></div>
<b:if cond='data:blog.pageType == "item"'>
<b:if cond='data:blog.pageType != &quot;static_page&quot;'>
<div style="clear:both; margin:10px 0">
<!-- Add here the code of your ad -->
</div>
</b:if>
</b:if>
<div expr:id='"adsmiddle2" + data:post.id'>
<data:post.body/>
</div>
<script type="text/javascript">
var obj0=document.getElementById("adsmiddle1<data:post.id/>");
var obj1=document.getElementById("adsmiddle2<data:post.id/>");
var s=obj1.innerHTML;
var r=s.search(/\x3C!-- adsense --\x3E/igm);
if(r>0) {obj0.innerHTML=s.substr(0,r);obj1.innerHTML=s.substr(r+16);}
</script>
Step 3. Put the converted Adsense code to where you see the <!-- Add here the code of your ad --> annotation, then save the changes by clicking on the Save template button.
Note: For centering ads, add the center tag before and after the AdSense code, like this:
<div style="clear:both; margin:10px 0">
<center>
<!-- Add here the code of your ad -->
</center>
</div>
Step 4. When you create a New Post, add this tag inside the HTML section to where you want the Google AdSense ads to appear:
<!-- adsense -->
For example:
<div>This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text.</div>
<!-- adsense --><div>This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text.</div>

Screenshot
Note: If you don't add the label to bring up the ad, then the ad will appear below the title by default.
And you don't have to worry about violating the Google's Terms of Service because applying this method we are not changing the structure of the ad

(Author can be reached at By- Sonu Mehla Mobile- 8285910007 E-Mail- sonuandfirm@gmail.com)

Popular posts from this blog

Date Extended for filing Form 10B/10BB and Form ITR-7 for the Assessment Year 2023-24

The CBDT issued  Circular No. 16/2023 dated September 18, 2023  regarding the extension of timelines for filing of Form 10B/10BB and Form ITR-7 for the Assessment Year 2023-24. On consideration of difficulties reported by the taxpayers and other stakeholders, the Central Board of Direct Taxes (CBDT), in exercise of its powers under Section 119 of the Income-tax Act, 1961 (Act), provides relaxation in respect of following compliances: The due date of furnishing Audit report under clause (b) of the tenth proviso to clause (23C) of section 10 and sub-clause (ii) of clause (b) of sub-section (1) of section 12A of the Income-tax Act, 1961, in the case of a fund or trust or institution or any university or other educational institution or any hospital or other medical institution in  Form 10B/Form 10BB  for the Previous Year 2022-23, which is September 30, 2023, is hereby  extended to October 31, 2023. The due date of furnishing of Return of Income in  Form ITR-7  for the Assessment Year 202

Here is a list of such common ITR documents that are required to file ITR in FY 2022-23 (AY 2023-24)

Income Tax Filing Online Toggle navigation ITR Filing ITR filing deadline missed? Don't Worry you still have a chance! File a Belated ITR for AY 2023-24 File ITR Now *Late fee applicable Trusted by 1 MillionTrusted by 1 Million+ Secure & SafeSecure & Safe 4.8 Star User Rating4.8 Star User Rating HomeIncome TaxE-Filing of ITRDocuments Required for Income Tax Return (ITR) Filing in India FY 2022-23 (AY 2023-24) Documents Required For Income Tax Return (ITR) Filing In India FY 2022-23 (AY 2023-24) Updated on: 03 Aug, 2023 01:04 PM To file Income Tax Returns in India, there is a list of preparations you need to make so that you can make your ITR filing process hassle-free. Considering this, the Government of India gives taxpayers sufficient time to compile their documents, like the bank statements, salary/income details, previous year's tax statements, etc. Every individual liable to file taxes is required to possess these documents for hassle free filing. The process of fi

GST Invoice Format for Services in Excel, Download GST Invoice Format

GST Invoice Format for Services in Excel, Download GST Invoice Format in MS Excel Format. GST Invoice Format Service Provider in Excel. “invoice” or “tax invoice” means the tax invoice referred to in section 31 of CGST Act 2017. In respect of services: A tax invoice for supplying services should be issued within 30 days from the date of supply of the taxable service. However, the Government is empowered to notify certain categories of services wherein any other document relatable to the supply would be treated as the tax invoice, or for which no tax invoice is required to be issued at all. Download GST Invoice  Form in XLSX Format . Now scroll down below n download GST Invoice Format for Services in Excel format...Please check mored details for " GST Invoice Rules 2017 " &  GST Invoice Formats  2017.. Download Now Download Count62Category GST Size184 KBTotal Files1Upload DateMay 29, 2017Last UpdatedMay 29, 2017