Sunday 19 April 2009

Embedding Google Adsense in Blogger Post

Embedding Google Adsense in Blogger Post

One thing that is important is the positioning of Adsense ads. By embedding Google Adsense in Blogger posts you have some control over positioning that is close to and/or directly above the post itself.

If you have a Google Adsense account, as you know, you can make a bit of dosh (money) by putting up Adsense on your Blogger website. The modern version of Adsense widget is excellent. It is very easy and Google matches the colors for you etc. The only criticism that some people might have is that the ads are placed in widgets (blocks of code around the actually post) rather than actually in the post. It is debatable whether this is important but some people think it is, hence this post. You can see the text adsense in this post and throughout the blog. I also have some adverts from an advertising agency. Why? Because with Adsense you can have only 3 pieces of Adsense on the page at one time. Using another form of adverts allows more advertising on the page.

The only places you can place the embedded code is at the top and/or bottom of the post. The top position as you can see from this post is just above the title, a place that cannot be missed by visitors. In order to achieve that two thing need to be carried out:
  1. (This is not in controvention of Adsense or Google rules) change the code. This means changing certain elements of the code and;
  2. Placing it in the right place in the template.
Both steps are relatively easy.

Embedding Google Adsense in Blogger Post - Changing the code:

Here is a piece of Adsense code (you will need your own, with your own account number in it so don't use this):

<div align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-9258716987841758";
/* 468x60, created 6/3/08 */
google_ad_slot = "2680821816";
google_ad_width = 468;
google_ad_height = 60;
<script type="text/javascript"

We need to change these elements:
  • <
  • >
  • "
This chart shows the substituted symbols:

What you want to showWhat you replace it with

Once you have done that you get what likes like a jumble of code like this:

&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;pub-9258716987841758&quot;;
google_ad_host = &quot;pub-1599271086004685&quot;;
/* 468x60, created 10/1/08 */
google_ad_slot = &quot;9782827967&quot;;
google_ad_width = 468;
google_ad_height = 60;
&lt;script type=&quot;text/javascript&quot;

Embedding Google Adsense in Blogger Post - Placing code in correct postion

Next go to Edit Html page of your blog. Save the template (download it) and open the widgets by clicking on Expand Widget Templates. Using the Ctrl F search facility paste into the search box this code: <data:post.body/>

The code should come up painted in green. Paste the modified code just below this line of code. You might need to put in a line break or two to lower the Adsense. This will place the Adsense at the base of the post. To place it at the top just above the header, for example, search for this code using Ctrl F: post-title entry-title. Then paste in the modified Adsense code just above the line of searched for code (the full line might look like this: <h3 class='post-title entry-title'>). You might put in a line break (<br/>) inbetween the post title code and the Adsense to separate it. Then review the changes.

Always review the template before saving. This works well and I have just checked it out on a new Minima template and it worked fine. Another point. You won't need to manually add Adsense as it will automatically come up in these places each time you make a post. If you put up two pieces of code this way you can use one more Adsense widget if you like, making three. Now the last point. If you request that Blogger show more than two posts on the home page at one time the third post will have gaps where the Adsense was as only three pieces of Adsense is allowed on the page at one time, as mentioned. If the Adsense is slim as is the case for me this doesn't matter.
Embedding Google Adsense in Blogger Post is pretty easy but go slow and check!


  1. thanks for the pointers. i am about to set up adsense on my blog, as well. this will definitely help! :)

  2. Hi, pleased to help a bit and good luck with it. Go slow and sure and check before saving.

  3. I think Adsense on the blog post is high CTR. but that is make a visitor avoid for click more on a blog or website.


Your comments are always welcome.

Featured Post

i hate cats

i hate cats, no i hate f**k**g cats is what some people say when they dislike cats. But they nearly always don't explain why. It appe...

Popular posts