
So, follow the following steps to add adsense inside the blog posts wrapped inside text.
Add Adsense inside Blog Posts
1.Login to your Adsense account and select which type of ads you want (Recommended to get a large Rectangle of Image/Rich Media Ads. It has high cpc and ctr)
2.Get the ad code of your adsense unit (in JavaScript)
3. You need to parse your adsense code first to add into your Blog template. As the blogger template is XML, it won't allow HTML/JS scripts, so you needs to convert the code into pure text. ie, < is converted to < , > is converted to > and so on. Thus when it is converted into Webpage by Blogger on their server, it will be in the form of ordinary JS and outputs into your browser. Thus, Adsense is shown in your blog.
If you don't understand this, leave it. Just use the following tool to parse the code.
<script type="text/javascript"><!--
google_ad_client = "ca-pub-xxxxxxxx";
/* Hackers Admin */
google_ad_slot = "1031081357";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&∓gt;
</script>
If you want, you can use this code by replacing xxxxxxxx with your publisher id. This is 336x280 Large Rectangle Rich/media Ad.
Adding Code into Template
1. Go to Blogger Dashboard -> Design -> Edit HTML
2 Click "Expand Widget Templates"
3. Search for the following code (click CTRL+F for Find)
<data:post.body/>4. Now REPLACE <data:post.body/> with the code below :
<div style='float: left;'>
PARSED CODE
</div>5. Now paste your parsed adsense code in the place i marked as PARSED CODE
<p><data:post.body/></p>
If you dont want do display ads in the main page or front page
use this code instead of above one
<b:if cond='data:blog.pageType == "item"'>
<div style='float: left;'>
PARSED CODE
</div>
</b:if>
<p><data:post.body/></p>
Now save the template and save changes
Leave comments if you have any doubts....
Gud .
ReplyDeleteSuper post
I like it