One of the more common questions are due to ad code breaking when using WYSIWYG editors or online AJAX editors in HTML mode. The WYSIWYG editor creates safe code and the code looks like this when viewing the source:

&lt;script type=&quot;text/javascript&quot;&gt;&lt;!– <br />
google_ad_client = &quot;pub-********************&quot;; <br />
google_ad_slot = &quot;***********************&quot;; <br />
google_ad_width = 120; <br />
google_ad_height = 240; <br />
//–&gt; <br />
&lt;/script&gt; <br />
&lt;script type=&quot;text/javascript&quot; src=&quot;http:// <br />
pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt; <br />
&lt;/script&gt; <br />
&lt;/pre&gt;

Adding the code using an AJAX editor spaces and <br /> are removed so the code looks like this:

<script type=”text/javascript”><!–google_ad_client = “pub-********************”; google_ad_slot = “***********************”; google_ad_width = 120; google_ad_height = 240; //–> </script> <script type=”text/javascript” src=”http:// pagead2.googlesyndication.com/pagead/show_ads.js”> </script>

This code dont work, some users have explained that removing the <!– and //–> makes the ads show up. I reccomend against it because it’s against policy to edit the ad code.

Correct code:

<script type=”text/javascript”><!–
google_ad_client = “pub-********************”;
google_ad_slot = “***********************”;
google_ad_width = 120;
google_ad_height = 240;
//–>
</script>
<script type=”text/javascript”
src=”http:// pagead2.googlesyndication.com/pagead/show_ads.js”>
</script>

There are a lot og great AdSense Support topics here…

Tags: , ,

2 Responses to “Adding AdSense code failed using WYSIWYG editor”

  1. Good post.

  2. Thank you Marina, it’s one of the questions we see most often on “AdSense Help”. Maybe it will help someone.

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>