The Inside AdSense team have just released an Activation Demo showing you how to add AdSense code to your Blogger/Blogspot template however they insist you revert to a classic template to do this.

This isn’t practical or desirable for some, including myself, so I’ll show you how to do it in the new and funky Beta templates, as seen on this very blog.

Although the beta tools allow you to add a block of AdSense Ads to the template in a nice web 2.0 style, you cannot add them to certain sections, for example between the post header and body text, as seen on this blog. For that level of control you need to manually edit the template itself and that’s what I’m going to demonstrate today.

First you need to generate your AdSense code, for this example I’m going to add a banner to the top of my blog, just underneath the page header/title.

First go to the settings screen of your blog and hit the template tab. We want to be editing the html, so hit the link. For ease of use you might want to download the template to your PC but in this example we’ll use the online editor.
Expand the widget templates (this allows you to put the AdSense anywhere on your blog) code and locate the header section like so:

Now scroll down to the last </div> and paste your AdSense code:

Now here comes the magic! (So to speak.) If you try to use the template like this most of the AdSense code will be stripped away and your ads will not show at all!
This is because AdSense makes use of the html comment marker and html comments are stripped out in the beta templates, taking the majority of our AdSense code with it!
To get round this (and so we don’t have to revert our template) we change the < and > of the AdSense code that uses the html comment marker into their respective HTML entities: &lt; and &gt; as seen highlighted in red in the picture:

Now hit the preview button to check on the brand new ads you’ve just installed:

Ok, so the positioning could do with a tweak, as could the colour scheme, but now you know the hardest part, getting the ads to show, you can tweak it til your hearts content! Don’t forget to save your template once you have positioned the ads to your liking.