Having Trouble Inserting Adsense code in Blogger Post? An alternative to Inserting Adsense in Blogger Posts

I actually ran into problems inserting Adsense code and getting it to work on my posts on Blogger. I was trying to do it the popular and common way but that did not work for me so I decided to think outside the box and I was eventually successful at getting it to work for me. Read on to see how I did it.

How to display Adsense code in your Blogger posts:
  • Log in to your Blogger account
  • Click on Design and then Edit HTML





  • Click on Expand Widget Templates right at the top of the HTML edit area.

YOU SHOULD BACK UP YOUR TEMPLATE BEFORE MAKING ANY MODIFICATIONS
The logic behind this method is finding the area of your Blogger code where the post title is displayed and inserting your adsense code there. So look for something like this:
Use your browser's Find tool for faster results

<b:include data='post' name='postQuickEdit'/>
</div>

The Adsense code will be inserted below the code above
 If you cannot locate that code in your own template then look for this one

<div class='entry' expr:id='&quot;post-body-&quot; + data:post.id'>
<b:if cond='data:blog.pageType != &quot;item&quot;'>


The adsense code will be inserted above this code
Before you can insert your Adsense code into your Blogger template, you need to escape or parse it, else, it will not work.
You can do that using the Adsense Parser tool below
In order to parse your Adsense code simply copy it into the parsing tool below and click Parse It just once.

HTML Parser

Your adsense code is now ready to be inserted in your blog posts.
The next thing you might wanna do is to add some tweaking to your code to make it display only in posts.
To do this, insert you Adsense code in-between these codes:

<b:if cond='data:blog.pageType == &quot;item&quot;'>
Your Adsesnse code
</b:if>

So, from all the explanations, you must have located where to put your Adsense code, Parsed it, inserted it between the code above. The next thing to do is insert the final code where you want it to be.
The final result will look something like this:


<b:include data='post' name='postQuickEdit'/>
</div>
<b:if cond='data:blog.pageType == &quot;item&quot;'>
&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;pub-xxxxxxxxxxxxxxxxxxx&quot;;
google_ad_host = &quot;pub-xxxxxxxxxxxxxxxxxx&quot;;
/* Post Body, TechBase */
google_ad_slot = &quot;2587628236&quot;;
google_ad_width = 336;
google_ad_height = 280;
//--&gt;
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;
src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
&lt;/script&gt;
</b:if>
    <div class='entry' expr:id='&quot;post-body-&quot; + data:post.id'>
<b:if cond='data:blog.pageType != &quot;item&quot;'>
<b:if cond='data:blog.pageType != &quot;static_page&quot;'>
<div expr:id='&quot;summary&quot; + data:post.id'>

The codes in green is your Adsense code
You can now save your template and see what you've done.




Subscribe via RSS or Subscribe by Email.
Like TechBase on Facebook

0 comments:

Post a Comment

Post your comment or feedback