Google Adsense In Blogger Beta XML Update

Posted: Mon Jan 15, 2025 7:23 pm | Reply with quote |

As previously posted, the only way to insert adsense into the body of the post is to escape the Adsense code; meaning replace all the special characters with HTML entities, for example '<' with < | '>' with > So, your Adsense code may look like this in the beginning:

code beginning wrote:


<script type="text/javascript"><!--
google_ad_client = "pub-XXXXXXXXXXXXXXX";


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>


And end up look like to be accepted by Blogger XML Template:

code after wrote:


<script type="text/javascript"><!--
google_ad_client = "pub-XXXXXXXXXXXXXXX";


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>


I have a special web application specifically designed to do this, see my HTML Parser here.

There are some concerns though both from other bloggers as well as myself as to if the above would be violation of tempering Adsense code as state in the TOS. So, I contacted Google Adsense Team through several emails and here they are in chronological order:

First Email wrote:


Hello Adsense Team:

This question is regarding putting Google Adsense code in new Blogger(owned by Google) into new XML templates. In order for Blogger to parse the Adsense Code in XML template, the Javascript has to be escaped, meaning replacing all the '<' with '<', '>' with '>' etc. After you publish you blog, and view the HTML code produced by the blogger, it would be the exactly the same as given from the Adsense generator. Would this be tampering of code even if the final displayed Adsense code is the same?

Thank you,
Regards


Initial email, stating the issue

First Email Response wrote:


Hi,

You are permitted to make minor edits in Blogger Beta. However, please keep in mind that in general publishers are not allowed to alter the AdSense ad code for any reason. Once you've generated the ad code in your AdSense account pages, you may not alter any portion of the code or manually change the layout of the ads.

Thanks for your understanding.
Sincerely,

The Google AdSense Team


mmm, kind of ambiguous, what exactly are the minor edits? So here is the follow up email

Second Email wrote:


Hello:

Thank you for your reply, however I find your answer ambiguous. First you
mentioned minor edits for BLOGGER BETA is allowed and then GENERAL PUBLISHERS are not allowed to alter the generated Adsense code.

Is the 'minor' edits of escaping HTML entities for XML parsing allowed as long as when displayed in HTML the adsense code is exactly the same as given from the Adsense generator?

Sorry for asking again, I just don't want to violate the Google Adsense TOS. Thanks for you consideration and all your help.

Thank you
Regards


And this is the answer

Second Email Response wrote:


Hi,

To clarify, while you are permitted to make minor edits in Blogger Beta, to allow the ad implementations to function properly, you are not permitted to alter the code for the purposes of changing size, font or hiding the Ads by Google logo.

Thanks for your understanding.
Sincerely,

The Google AdSense Team


There you go, AdSense does not clearly state anything however '[you are] allow the ad implementations to function properly' probably refer to escaping the Adsense Code but nothing else. Since Adsense won't give a clear rule, here is my own:

Minor edits on Google Adsense Code for Blogger Beta/XML are allowed as long as the resulting Adsense Code generated by Blogger is exactly the same as given from Google Adsense Code Generator.

This means if you goto your blog, eg. http://customtemplates.blogspot.com/
and click View --> Page Source (Firefox) or View --> Source (IE), the Adsense Code there should be exactly the same as given from Google Adsense Code regardless of what you put in your Edit HTML section in Blogger.


To parse your Adsense click here and for information on adsense placement see this article. More information & placement positions are coming.

Stavanger

Site Admin

Joined: 05 Jul 2025

Posts: 1978

Posted: Wed Jan 17, 2025 7:57 am | Reply with quote |

That's clear answer!

haris

Joined: 03 Jan 2025

Posts: 14

Location: Germany

Posted: Sat Jan 27, 2025 9:29 pm | Reply with quote |

Hi Stavanger,

Thanks for this tip and for taking the trouble of clarifying matters with AdSense Help Center. I have done a post on your tip at Incorporate AdSense ads in your New Blogger blog with a link to this post.

Here are 2 blogs using your tip, one with the ads above the post body and one at the bottom:

Recreation and Sport and

Good Parenting Practices

Peter
Blogger Tips and Tricks
Testing Blogger Beta
Blogger for Dummies

_________________
Peter
Enviroman Says
Descartes said: "I think therefore I am"
Enviroman says: "I think therefore I reduce, reuse and recycle"

enviroman

Joined: 11 Dec 2024

Posts: 35

Location: Our one and only Spaceship Earth

Posted: Fri Dec 26, 2024 10:11 am | Reply with quote |

In fact I implemented HTML entities version of AdSense Tag in Blogger blog wondering if it violated TOS or not. I'm happy to know the clear answer here now. I'll let my folks know this info in my blog refering this thread.
http://blogger-customize-tips.blogspot.com/
Many thanks and great job.

_________________
Asuka Cheung

Asukac

Joined: 17 Apr 2025

Posts: 1

Location: Hong Kong

Display posts from previous:

Jump to:

All times are GMT - 5 Hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Login

Username:

Password:

Login automatically

Register

Sponsors