Monday 4 February 2013

How to Put Google AdSense Ads Inside Blogger Posts (Wrapped in Text)

In this post I’m going to share you an AdSense trick which will allow you to place AdSense ads inside your blog posts. Also, you can Place your AdSense Ad in any part of your posts.Once Added you can place the ads anywhere in the post (whether between Paragraphs, Middle of your Content etc. etc.. Wherever you want). Cool.. Right?? So, Placing the AdSense Code experimentally into your Blog/website can make you Huge Income. What you have to do is simply follow my steps carefully so that you should not face any problem.

Before Making any changes to your Blog/Website, make sure to Backup Your Blogger Template.



Steps to Place AdSense Ads inside Blogger Posts


  • Go to Your Google AdSense account and choose the type of ad you want inside your blog posts and Get the Code for the AdSense Unit.
  • Since the AdSense Code will be used to place in your blog templates html; so your Ad Code must be Parsed. To do this, go HERE and Paste your AdSense Code and Click on Convert. After That Select all and Copy the Parsed Code.
  • Your AdSense Code is now Ready.


Now we will Place the AdSense Code to the Blog Template.
  • Go to Template –> Edit HTML –> Proceed.  Tick the ‘Expand Widget Templates’ Box.
  • Now Find the Following Piece Of code [Tip: Use Ctrl+F]
<data:post.body/>
  • REPLACE the Code i.e., <data:post.body/> with the Following Code:
<div expr:id='"aim1" + data:post.id'></div>
<div style="clear:both; margin:10px 0">
PUT YOUR PARSED ADSENSE CODE HERE </div>
<div expr:id='"aim2" + data:post.id'>
<data:post.body/>
</div>
<script type="text/javascript">
var obj0=document.getElementById("aim1<data:post.id/>");
var obj1=document.getElementById("aim2<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>

Note: Some Templates may have more than one <data:post.body/> Code. In this situation Replace all the <data:post.body/> code with the above Code.
  • Now, Replace PUT YOUR PARSED ADSENSE CODE HERE above with your Parsed AdSense Code.
  • Now Click ‘Save Template’.

In Order To place the Ad in any part of your blog post, Simply place the following piece of code in your post in the exact place you want the Ad to appear:

<!-- adsense -->
                                   
[Note: Place the above piece of code on the HTML of the Post.]


     So if you place the <!-- adsense --> tag at the top of your post the ad will appear there.




Float The AdSense Unit And Wrap In Text


If you want to either float your AdSense unit on the left or right or wrap it in text you can add another snippet of code.The code will be placed above the <!-- adsense --> tag and closed below.
This is the code you will add, it is set to float on the left wrapped in text with directions to change the position below:

<div style="float: left; margin-right: 5px;">
<!-- adsense -->
</div>

Note - To float the Unit on the right change the red text to float:right and margin-left.
That’s all for today. Leave a comment if you face any Problem. Please Do like Our Facebook Page.

8 comments:

Unknown said... [Reply]

Pretty good post. I just stumbled upon your site and wanted to say that I have really enjoyed reading your site. Any way I'll be subscribing to your feed and I hope you post again soon.

Social Media Marketing in Karachi

Unknown said... [Reply]

I would like to say this is an excellent site that I have ever come across. Very
informative. Please write more so that we can get more details.

Reseller Cloud Hosting
VPS Website Cloud Hosting

Computer Tips and Tricks said... [Reply]

nice tips..

photoshopcreation said... [Reply]

Thanks this code work. But its only showing on below the Post Title only. we can not give middle of the post. i tried changing all data.post body with your code and inset <-- adsense> whatever written on the above. its dont work. please try to solve it.
www.photoshopcreation.blogspot.com

shailendra gupta said... [Reply]

i am facing a prob.. actually the body text size is changed and it cannot be restored back

Hitesh said... [Reply]

@Kumar Ashish,
Didn't you backup your template first?

Tal Cual said... [Reply]

Thank you very much

Unknown said... [Reply]

Good Post.

Post a Comment

Facebook Twitter Subscribe

 
Twitter Bird Gadget