How to put Google adsense (ads) code block in the middle of blogger blogspot blog post

71

By almirah

Can you put Google adsense in the middle of your post?

The answer is yes. You can display Google adsense in the middle of your Blogger Blogspot post. The way to do this is a bit more compilcated than displaying the adsense in other parts of post mentioned in other hub. That is probably why not so many bloggers have implemented this technique for their blogs, compared to the other techniques. However, if you are looking around, you can see few bloggers have used this technique to display Google adsense.

The only thing to bear in mind is that, Google adsense in the middle of post will break the flow of your post information. Your readers may not so like this and therefore may affect your presence online. However, it is all you to decide whether to display Google adsense in the middle of your post or prefer other more common techniques such under post title or in the beginning of post.

Google Apps: The Missing Manual
Amazon Price: $12.65
List Price: $39.99

Steps to display Google adsense in the middle of post

Here is the first method on how you can put Google adsense in the middle of your Blogspot post.

  1. Log in to your Blogspot dashboard
  2. Go to Layout and Edit Html of your template and select Expand Widget
  3. Find this code: <data :post.body/>
  4. Replace the above code (#3) with the following new code:

    <div expr:id=’&quot;aim1&quot; + data:post.id’></div>
    <div style=&quot;clear:both; margin:10px 0&quot;>


    <!– Your parsed Google AdSense code here –>

    </div>

    <div expr:id=’&quot;aim2&quot; + data:post.id’>
    <data :post.body/>
    </div>

  5. Save your template. Done.
  6. Now, everytime your write a new post, put this code <!– adsense –> in the middle of the post at location where you want the adsense to appear.

So, you have actually a choice to minimize te breaking effect of the adsense to the post flow you are presenting to your reader. It is best to put the adsense after a block of information flow is completed before the next one. In other words, avoid placing the adsense in the middle of an information block that will distract your reader attention.

Second technique to put Google adsense in the middle of post

Below are steps you can follow to put Google adsense in the middle of your post.

  1. In your template html, find this code: <data :post.body/>
  2. Replace that with the following:

    <div expr:id=’”aim1″ + data:post.id’></div><div style=”clear:both; margin:10px 0″>

    <!– Your 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>

  3. Save your template to finish.
  4. Now, everytime your write a post, put this code <!– adsense –> in the middle of the post where you want the ad to display.

Comments

tripzibit 13 months ago

Hi, i already tried but always got error message

Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.

XML error message: Open quote is expected for attribute "{1}" associated with an element type "expr:id".

Please help me how to fix it

john 11 months ago

ok thanks fot this informations

edy s 11 months ago

nice tips, i want to try right now.

thank you.

Submit a Comment
Members and Guests

Sign in or sign up and post using a hubpages account.



    • No HTML is allowed in comments, but URLs will be hyperlinked
    • Comments are not for promoting your Hubs or other sites

    Please wait working