|Average rating: Rate this article|
Not long ago Google Blogger platform added new widget-driven templates, which use different approach from the "Classic" template. Classic template was based on HTML, new Blogspot templates now are based on XHTML which is a branch of XML.
So, classic templates are incompatible with new Blogger templates. New Blogger templates use "Page Elements" (widgets) but the places where you can insert widgets are rather limited. So what about if you need more flexibility than they allow?
- Google Widgets are always separated by dashed horizontal rules, which can be inappropriate if you want to blend your ads.
- You cannot insert widgets inside your blog post, so you need to edit template HTML code.
Of course you can use standard Blogger feature for adding AdSense ads between your posts (Blogger - Template - Page Elements - Blog Posts - Edit - Show Ads Between Posts). After that you can move these ads position using this technique. But sometimes it is not enough: for example you cannot specify channel, you cannot insert AdSense for referrals code. Also you are not able to insert ads from other ad networks (YSM, AdBrite, Chitika) with this method.
Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
XML error message: The content of elements must consist of well-formed character data or markup.
So why your template could be not valid when something changed? Here is the some of XML requirements:
- Documents must be well-formed.
- In XHTML every tag should have a matching end tag.
- Ampersands (&) used for marking entity names, so you cannot use & in your code. Instead of it it must be written as &
- Element and attribute names must be in lower case
- In XHTML, the script and style elements are declared as having #PCDATA content. As a result, < and & will be treated as the start of markup, and entities such as < and & will be recognized as entity references by the XML processor to < and & respectively
- If you are interested in more, the full XHTML specification is here.
Basically, to make Adsense code, pasted into blogger template, valid, you need to replace several characters with their XML entities. They are:
Warning: Always back up your template html before changing into a new one!
This change could be quite annoying if doing manually, so we have an online tool for doing this: HTML Encoder. Frankly speaking, purpose of this tool is not only converting HTML for Blogger templates. It just replaces all special HTML characters into their entities. This is the case we need exactly the same.
If you view HTML source of resulting blog pages in a browser, you will find the exact same AdSense code that Google provides, without any modification.
Disclaimer: Use at own risk. If you have concerns about inserting more than maximum number of ads allowed, you could contact the AdSense team and let them get back to you on their official stand.
Maximum number of AdSense ads, per page (from AdSense Policy):
|Ad type||Max count|
|Context ad unit||3|
<div style="float: right; margin: 10px;">
Print this article Bookmark:
About The Author
Rate This Article
Use your mouse pointer to select as many stars as you want, and press the left mouse button to vote.
Other Adsense Articles
Rating: 3.5 stars
|4 Tips to Improve your AdSense revenue by C.Taylor (Sep 6, 2007)|
|How many times have you seen an ad campaign running for “Google Adsense” that makes it sound so easy to make revenue by just copying and pasting their code onto your website? After all the research I have done on Google Adsense, I finally realized how it is not that easy just to copy and paste...|
Rating: 5 stars
|AdSense optimization tips for forums by Mark Daoust (Sep 4, 2007)|
|Owning and operating a forum can be a tricky task. Not only do you have to struggle with the many obstacles of establishing the forum such as working on your initial member build up, getting rid of problem members early, and making sure your forum is easy to use, but there is also the major problem of monetization...|
Rating: 3 stars
|10 Adsense Tips for Maximum CTR by Christos Varsamis (Jun 27, 2007)|
|You should make your Adsense ads look as a part of your web page Text ads are better than image ads No Border ads No other advertisements Placement ... ..|
Rating: 2.6 stars
|10 Ways to Double Your AdSense Income Instantly by Nicola Deiana (May 11, 2007)|
|The principles I'm discussing here is about focus. Here are 10 ways in which you can improve your AdSense CPMs and CTRs....|
Rating: 3.7 stars
|10 Great things NOT to do with Google AdSense by Diane Nassy (May 11, 2007)|
|There is no question that you can make some good money with Google AdSense, but you're setting yourself up for disaster if you make any of these Top 10 mistakes.. ..|