Adsense, Amazon Within Blog Posts. ~ The Blog Doctor.

Adsense, Amazon Within Blog Posts.

New Visitor? Like what you read? Then please subscribe to my Blog Feed or sign up for Free Email Updates. Thanks for Visiting!

Ever since the debut of the New version of Blogger with the Layout Template, bloggers have been struggling to find ways of inserting Google Adsense and or Amazon Advertisements within blog posts.

The difficulty arose from the fact that most of the advertisements use Javascript code which needs to be pasted within the Blog Posts. In the New Blogger Layouts template Html/Javascript Page Elements were introduced so that Ads. could be put in them. These could then be added to the Header, Footer, Sidebar and the Main Posts column. However, the Blog Posts Page Element being a widget in it's own right does not accept another Html widget inside itself. Check out the Amazon Advertisement to the right --->. I have given it a title : "Amazon Ads." but that can be omitted to make it blend more with your post's content. You can see that it is not a picture/image by hovering your mouse cursor over the links. It will change to a hand icon and the amazon link to the product will be displayed in the status bar of your browser at the bottom.

Thus bloggers were able to add Google Adsense Ads. all round the blog posts and now in between ( Inline Adsense )the posts also. Some hacks were developed to incorporate Adsense within the blog post but most involved modifying the advertisement code which went against the Google Adsense TOS.

Here is a method to incorporate any advertisement within your blog post so as to fully blend in with your content without modifying the code..........


The first step is to get the code from the respective sites. For this login to your Google Adsense or Amazon account and navigate to the code generating section. Customize your advertisement to the size ( It should fit the width of your posts column. )and color you want and copy down the code provided. You can select the channels you want in Adsense and the Advanced Settings tab for Amazon Omakase Ads. allows you to set upto five keywords or phrases to target your Ads.


Paste the code obtained in a new Google Gadget. Follow the same steps as shown in "Increase Traffic | Create a Google Gadget". Load the sample "Hello World" Google Gadget and replace the "Hello World" with the code obtained from Adsense/Amazon. See picture below :

Delete "Hello World" and paste the code instead. Click on picture to enlarge it.
Save the Google Gadget and publish it to get the code. Copy the code for the Google Gadget which you have created.


Go to Blogger Home and login to the Blogger Dashboard. Click on 'Posts' link and it will open your list of Blog Posts. Click 'Edit' link next to the post you wish to insert the advertisement in. The post will open in Post Editor. Click on Edit Html tab in the top frame of Post Editor. Paste the Google Gadget code where you want it. If you wish to float it left use the following code :

<span style="float:left;">

To put it to the right of your text use 'right' instead of 'left'. Replace the CAPS with actual code for the Google Gadget. The gadget will not be seen on Preview. Publish the post and click on 'View Blog' to see your Advertisement. Check out my Google Gadget with Amazon Advertisements in this post. To blend it within the post content first make sure that you choose "No borders" while customizing the code for the advertisement in Step 1 above. Then when you generate the code for the Google Gadget you will get something like this :

<script src=";amp;amp;w=305&h=255&title=Amazon+Ads.&border=%23ffffff%7C1px%2C3px+solid+%23999999&output=js"></script>

Change the numbers for the borders to 0 px in the code above to delete the border for the gadget. This will make your advertisement blend in effectively within your posts.


1. The advertisement code need not be modified.

2. Advertisements blend in with the posts.

3. You can target each advertisement to the specific content of that post.

4. You can put Google Analytics within the Google Gadget to track it's statistics.


jeisea said...

Thanks Vin
Just wanted you to know I appreciate your simple, even I can do it, posts. You helped me more than once.

Ardegas said...

I tried to to do this trick with Adsense.

It didn't work.

My blog is in Spanish, and the ads were in English, and some of them related to the word "gadget" altough the post wasn't about gadgets at all.

vin said...


Optimize your blog for the search engines.

Anonymous said...

is this allowed by Google Adsense TOS?

Vin said...


Have a look here

Vin said...


Here is another article.

Anonymous said...

hi vin,

is there a way to put ono-adsense ads between posts?



Vin said...


Have a look at :

Inline Adsense Ads. for Blogger Blogs.

Sphurthy said...

very great blog, i think the size of the fonts must be reduced for more readability

Naveen Davis said...

I want to add my blog related books from amazon. From my adsense account I can't build the code for amazon. it asks channel. actually I didn't give channel .. Then how can I proceed??

Vin said...

Naveen Davis V,

Amazon is a different site. You need to first register as an Associate at their site to get the code for the books.

José Carrilho (Go Detail) said...


Even if one will do so, one can only have a certain number of ads.
So that would mean deleting previous ads before placing new ones on future posts.
Am I right on thyis one ?
Becuase recently I place another advertisement space on my blog and the one before got blank.
Then removed the latest one and the previous one started working again.
Of course that blending advertisements within posts is a good option and more likely to get clicks.

Kind regards,


Kind regards,


Vin said...


Depends on the TOS of the Ad. companies if they want only a certain number of ADs. on each page!

Anonymous said...

Just wanted to say this is great information thanks I love your site and have told many of my friends and family about it. Keep it up.

Anonymous said...

Hi dude.

Can I use same adsense ad(same code)in diff. pages of my blog.N if yes, then whatz better ?
Putting same adsense code in all pges or generating diff. code 4 each page ?

And dude,some pages get more views that others.So does posting ads in the pages which get less views affect earning ?

I mena, if I got few ads in blog which r not getting click, does this lowers my earning ?

Vin said...


You can try pasting adsense codes in a Html page element.

Then customize that page element to appear only on pages with large number of views.

Putting Ads on low pageview pages is like putting up billboards on empty rural roads.

Only difference is that putting up an Ad. on your page costs nothing while constructing billboards in the real world has a cost factor.

Anonymous said...

Good day Vin,
Your good works are appreciated.
I was trying to put adsense on my blog but on clicking SAVE on the CONFIGURE ADSENSE page it was telling me to CORRECT THE ERRORS ON THIS FORM.I have tried to see what needs to be corrected but all to no avail.What do i do? I'm using IE and my blog name is KEMFATLOSS.BLOGSPOT.COM

Vin said...


Use Firefox browser.

Instead of using Adsense gadget copy and paste the code in a Html gadget.

===> NAVEEN <=== said...

i did not know to create a adsense account please help to show me the adsense account creation steps

Vin said...

===> NAVEEN <===,

Go to Adsense site and follow the prompts.


Skip to top of post.

Search Blog Before Commenting


Post a Comment

Please use the above search box to search this blog before posting your valuable comments.

Comments posted on Dummies Guide to Google Blogger (Beta) are moderated and will be approved only if they are on-topic and not abusive. Try not to include website URLs/links in your comments. You can email me : drbhatns at gmail dot com for any blogging question. Thanks,


The Blog Doctor The Blog Doctor2 Blog Doctor Home


Tips On Blogger and Latest News.

Skip to top of post.