Insert Google Adsense Into Blogger XML Post Body

Have you ever tried to insert the Google Adsense code directly into your Blogger XML Template and get this error?

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 processing
instruction target matching "[xX][mM][lL]" is not allowed.



So, you resolve to insert the Adsense code using blogger widgets.
However that means your widgets can not appear within each post, the
best spots to place your ads. Don't worry, there is a way of inserting
Adsense code straight into your XML templates.

Since Blogger started using XML everything is more strict and
standardized. The above error simply mean the Adsense code is not
standized XML and solve it we need to replace all the html character such as '<' with '&gt;' '"' with '&quot;'. For example:

Quote:

<script type="text/javascript"><!--
google_ad_client = "pub-XXXXXXXXXXXXXXX";
google_ad_width = 336;
google_ad_height = 280;
google_ad_format = "336x280_as";
google_ad_type = "text_image";
google_ad_channel = "";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "000000";
google_color_text = "000000";
google_color_url = "000000";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>



would be

Quote:

&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;pub-XXXXXXXXXXXXXXX&quot;;
google_ad_width = 336;
google_ad_height = 280;
google_ad_format = &quot;336x280_as&quot;;
google_ad_type = &quot;text_image&quot;;
google_ad_channel = &quot;&quot;;
google_color_border = &quot;FFFFFF&quot;;
google_color_bg = &quot;FFFFFF&quot;;
google_color_link = &quot;000000&quot;;
google_color_text = &quot;000000&quot;;
google_color_url = &quot;000000&quot;;
//--&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;
src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
&lt;/script&gt;



You can use your text editor to replace all the HTML, but Blogcrowds also has an HTML parsed that takes care of everything for you. Now with the code you can paste it anywhere in your HTML code with no error at all.

Here are some tips for where in the XML Template you should paste the
parsed HTML code. I used a barebone Minima template so it should be
similar in all templates. Find the normal text and then add the bolded
code are added by me:


1)Next To The Post



<div style="float:left;">
<!--parsed Adsense code-->
</div>


<div class='post-body'>
<p><data:post.body/></p>
<div style='clear: both;'/> <!-- clear for photos floats -->
</div>


2)After Post Before Credits



<div class='post-body'>
<p><data:post.body/></p>
<div style='clear: both;'/> <!-- clear for photos floats -->
</div>

<div><!--parsed Adsense code--></div>

<div class='post-footer'>
<p class='post-footer-line post-footer-line-1'>
<span class='post-author'>
<b:if cond='data:top.showAuthor'>
<data:top.authorLabel/> <data:post.author/>


3)After Credits



<p class='post-footer-line post-footer-line-3'/>

<div><!--parsed Adsense code--></div>

</div>
</div>
</b:includable>
</b:widget>
</b:section>

If you worry this method may violate Google Adsense TOS continue reading this update.

Thanks Stavanger for sharing this. Want to read the Original Article?

22 comments:

Anonymous said...

Hi

What do you thing about below diet supplement? I'm going to buy something good for muscle growth. Please give me a piece of advice.

[url=http://www.hmb.odzywki-dla-sportowcow.com.pl/dla-kogo-hmb]odzywki[/url]

Anonymous said...

[url=http://ivlkrwnnz.com]AsqIyBbL[/url] , VWGPOlAC - http://yuxeflk.com

Anonymous said...

I'm sure the best for you ENtxEAdW [URL=http://www.chanel--online-shop.net/]chanel bags online shop[/URL] to your friends uIqtEEDt [URL=http://www.chanel--online-shop.net/ ] http://www.chanel--online-shop.net/ [/URL]

Anonymous said...

Hello. Facebook takes a [url=http://www.freecasinobonus.gd]online baccarat[/url] venture on 888 casino freight: Facebook is expanding its efforts to introduce real-money gaming to millions of British users after announcing a practise with the online gambling toss 888 Holdings.And Bye.

Anonymous said...

buy a dUAErQCG [URL=http://www.burberry-outlet2013.com/ - burberry coat[/URL - with confident ELKZuGhk [URL=http://www.burberry-outlet2013.com/ - http://www.burberry-outlet2013.com/ [/URL -

Anonymous said...

click GjNxAenL [URL=http://www.louis--vuitton--online--shop.org/]where to buy louis vuitton online[/URL] for gift fsgkqget [URL=http://www.louis--vuitton--online--shop.org/ ] http://www.louis--vuitton--online--shop.org/ [/URL]

Anonymous said...

buy best wJtzaLLq [URL=http://www.ugg-boots-uk2013.com/ - cheap ugg boots uk online[/URL - to take huge discount CeIRqvVn [URL=http://www.ugg-boots-uk2013.com/ - http://www.ugg-boots-uk2013.com/ [/URL -

Anonymous said...

must check rsJnqxnx [URL=http://www.louis--vuitton--online--shop.org/ - louis vuitton outlet online[/URL - online shopping GFcJjKJK [URL=http://www.louis--vuitton--online--shop.org/ - http://www.louis--vuitton--online--shop.org/ [/URL -

Anonymous said...

simply stopping by to say hey

Anonymous said...



Feel free to visit my web site :: how to win the lottery
My site: lotto

Anonymous said...

look at NbnSpppe [URL=http://www.cheapguccireplica.tumblr.com/]gucci outlet online[/URL] , just clicks away vtuCHgVa [URL=http://www.cheapguccireplica.tumblr.com/ ] http://www.cheapguccireplica.tumblr.com/ [/URL]

Anonymous said...

[url=http://sneakersonline.webs.com]isabel marant etoile[/url] 锘縤sabel marant sneaks good game, do you.As far as the shaft length factor, the longer the shaft the more is the speed.If you choose to take them with you, you will need to think about the arrangements a bit.This is since acrylic is a nice materials that shows elegance and durability.You will find you will be in a clear fresh and alert state to practice the violin.Instead, he isabel marant nyc or she can focus on getting their swing down just right to really bring out their best golf game.Perimeter Weighting: isabel marant shopping In simple words perimeter weighting indicates that the weight of the golf club is not positioned at the center and the head is positioned around the perimeter of golf club.Inspiration can come from anywhere at an. [url=http://lvhandbagstore.blinkweb.com]lvhandbagstore.blinkweb.com[/url]

[url=http://sacsonline4u.webnode.fr]sac longchamp[/url] 锘縭e ou votre boutique longchamp s.Et, ce qui a certainement inspir茅 la nouvelle g茅n茅ration de sac longchamps candidats 脿 tenter leur chance dans ce secteur en constante qui se passe.En 2002, le cr茅ateur am茅ricain James Aguiar est devenu concepteur en chef, la conception pour deux saisons.Les familles veulent pas 锚tre.Lorsque vous choisissez une tenue et les accessoires, assurez-vous qu'ils refl猫tent qui vous 锚tes mais toujours laisser un peu de place pour vous raconter le reste de l'histoire vous-m锚me.Les achats en ligne est tout simplement g茅nial, vous pouvez 茅conomiser jusqu'脿 la moiti茅 du prix d'achat sur les articles avec la livraison gratuite, pour ne pas cartable longchamp mentionner que c'est super rapide, pratique avec toutes les principales ca.
[url=http://sacssolde.webnode.fr]longchamp[/url] 锘縭cueil.Bien, vous pourriez lompchamps sac vous sentir que les robes du soir sont une pertinence 脿 l'heure actuelle.Bottes Uggs sont en train de devenir un article de mode chaud aux 茅tats-Unis et au Canada, et pour sacoche longchamp une bonne raison.Montage 脿 droite est 脿 la base de vinaigrette.En g茅n茅ral, la maxis air bien sur ceux qui sont grands et minces.t des derni猫res tendances en mati猫re longchamp sac prix de mode et d'accessoires.le est techniquement que d'un courtier pour le site du vendeur et vous fournir un lien vers le site sur votre site web.Organiser une collecte de fonds avec les enfants de l'茅glise esp猫re soutenir.Les achats en ligne dans le pays est l'une des derni猫res tendances et le pays est sur le point de.
[url=http://sneakersshop.blinkweb.com]isabel marant[/url] 锘縡eatures, the prices isabel marant outlet of carts vary for a large scale.Right now I am speaking of women鈥檚 fashion boots that lean more to the dress up style but of course then there are the functional women鈥檚 boots as well such as the casual flats or the sturdy durable work boots that are made for isabel marant skirt all day walking.This has become the destination for golfers over the past five or six years when golf tourism began to sky rocket in the area.The muscle back lines and edges however are smoother on the MP-68 than the MP-37 and some in Japan have said it reminds them of the classic golf with its curved muscle back and sharp toe.4.Excellent Used marants sneakers Golf Clubs These clubs are very playable, but show.
[url=http://lvhandbagstore.blinkweb.com]lvhandbagstore.blinkweb.com[/url]


[url=http://phuquoctoday.com.vn/showthread.php?66-Th8-http-bootsforsales.webs.com-ugg-montclair-37353&p=22915#post22915]sneakersonline.webs.com/Hz4[/url]
[url=http://www.virtualizor.com/forums/index.php?action=profile;u=161594]sneakersonline.webs.com/Xp1[/url]
[url=http://zx6r.btodoli.net/contenido/foro/profile.php?mode=viewprofile&u=172616]sneakersonline.webs.com/Oi4[/url]

Anonymous said...

Gοod pοst. I leаrn something new anԁ
chаllenging on webѕites I stumbleuрon every day.
It's always useful to read through content from other authors and use something from other web sites.

Visit my web page - hcl
Also see my web site: buy pure ephedrine

Anonymous said...

Waу cool! Some еxtrеmely vаlid pointѕ!
I appreciаte you ωriting this poѕt аnd alѕο the rest οf the websitе is also ѵeгy good.



Fеel free to surf tο my page - black widow ephedra

Anonymous said...

must check rkKHbbCo [URL=http://www.aaareplicahandbags.weebly.com/]faux designer handbags[/URL] with confident bBxXhZaI [URL=http://www.aaareplicahandbags.weebly.com/ ] http://www.aaareplicahandbags.weebly.com/ [/URL]

Anonymous said...

I like [url=http://www.nikeshop.ca/]Nike[/url] and http://www.nikeshop.ca/0oadalqr

Anonymous said...

Everything is very open with a precise clarification of the issues.
It was truly informative. Your website is very useful.

Thank you for sharing!

My blog ... mederma stretch mark Therapy

Anonymous said...

I know this if off topic but I'm looking into starting my own blog and was curious what all is needed to get set up? I'm assuming having a blog like
yours would cost a pretty penny? I'm not very web savvy so I'm not 100% sure.
Any recommendations or advice would be greatly appreciated.
Thank you

My web page ... Sturling Watches For Women

Anonymous said...

Hello, I would like to subscribe for this webpage
to get hottest updates, thus where can i do it please assist.


Feel free to visit my web-site ... guardianproject.info

Anonymous said...

Hi! I know this is somewhat off-topic but I had to ask. Does operating a well-established blog such as yours require a lot
of work? I am brand new to blogging however I do write in my journal on a daily basis.
I'd like to start a blog so I can share my personal experience and thoughts online. Please let me know if you have any recommendations or tips for brand new aspiring bloggers. Appreciate it!

Also visit my weblog ... akribos for women

Anonymous said...

hello there and thank you for your info – I've definitely picked up anything new from right here. I did however expertise a few technical points using this website, since I experienced to reload the site many times previous to I could get it to load properly. I had been wondering if your web hosting is OK? Not that I am complaining, but slow loading instances times will very frequently affect your placement in google and could damage your high-quality score if advertising and marketing with Adwords. Well I am adding this RSS to my email and can look out for much more of your respective exciting content. Make sure you update this again very soon.

Also visit my weblog ... seo skills

Anonymous said...

I reallу lіke your blog.. veгу nice colorѕ & themе.
Diԁ you make this website yourѕelf or did you hiгe somеone to do it for yоu?
Plz responԁ as I'm looking to create my own blog and would like to find out where u got this from. thanks

Take a look at my page; Resistor Code