Adding Google Adsense Ads Code Directly to Blogger XML Template

Advanced users of Blogger.com service may have tried to insert and put Google AdSense ad code which is actually a Java script directly into the blog pages by manually editing the XML-based template HTML coding interface. Actually, it’s possible add any ad code by using HTML/JavaScript page element within the Blogger new XML template system, but the place where you can place the new block is rather limited, i.e. above or below the post body, header, footer, within sidebar or between blog posts. In case you want to put the ads inside the post, or align the ads to float and wrap around the text, or just within the single individual article content view, you will have to edit directly the HTML coding of Blogger template.

Which Adsense Format & Color Scheme Will Work Best for You ?

Should I use the 300x250 Adsense Rectangle or the much wider 336x280 for maximizing clicks? What do I select - 4 or 5 ads per Adlink unit ? Will text only ads perform better than text+image ads ? Should I hide the colored border ?

These are some very common questions among web publishers especially those who have just gained admission to the University of Adsense. While the answer is to keep on experimenting, most Adsense experts employ a simple technique called "AB Split Testing" to optimize their Adsense Ads.

The basic idea is to display different Adsense formats at the same location simultaneously but randomly. [This is done using the random() function in Javascript that generates a number between 0 and 1 with equal probability]

google adsense reports

Show Google Adsense Ads Below Post Title and Post Body

In this tutorial I will explain how to place Adsense Ads below post title in Blogger Blogs with lots of customization tips. You might have noticed that most of the bloggers show Google Adsense ads below title to increase their "Click Through Rate" (CTR) and earnings.

According to Google Adsense help pages " Where to place Adsense Ads ?". Placing Adsense ads below title and above article content can bring high CTR and performance.


2. Click on the Edit link in the "Blog Posts' column [look at the below screenshot]

A pop up window opens ...

3. Check the box next to 'Show Ads Between Posts'

Next, Configure the Inline Ads, choose the Format, Colors etc and SAVE THE CHANGES.

That's it! Now your Adsense Ads will show between blog posts.


Showing Adsense Ad only in Post pages :-

1. Sign in to your Blogger Dashboard > Layout > Edit html

Check the box next to 'Expand Widget Templates'

2. Scroll down the window till you see this code

<b:if cond='data:post.includeAd'> <data:adEnd/> <data:adCode/> <data:adStart/> </b:if>


3. Replace that code in the template with the below code

<b:if cond='data:blog.pageType == "item"'> <b:if cond='data:post.includeAd'> <data:adEnd/> <data:adCode/> <data:adStart/> </b:if> </b:if>

4. Again, scroll down the template and find out data-post body tag

Copy the following code :-

<b:if cond='data:blog.pageType == "item"'> <b:if cond='data:post.includeAd'> <data:adEnd/> <data:adCode/> <data:adStart/> </b:if> </b:if>

If you want Ads to show above the Post Body after the Post Title, paste the code above that tag.




If you want Ads to show below the Post Body, paste the code below that tag.



If you would like to show them at both the top and bottom of your posts you should only show them on the post pages since we are only allowed to display a certain amount on each page so to get them at the bottom and top of your posts.

<b:if cond='data:blog.pageType == "item"'> <b:if cond='data:post.includeAd'> <data:adEnd/> <data:adCode/> <data:adStart/> </b:if> </b:if>


Paste the code above and below the <data:post.body/> tag so it should look something like the following screenshot



Save the template and view a post on your blog you should see Ads at the top and bottom of the Post Body.

Leave you comments if you like the post or if you have any questions doubts.

Pages (2)12 Next