Adsense and more!

Alright, I finally got the Adsense plugin to work. Here’s how it goes:

1) Take your Adsense code, for example:

<script type=”text/javascript”><!–
google_ad_client = “pub-XXXXXXXXXXXXXXXX”;
/* xxx x yy, created MM/DD/YY */
google_ad_slot = “XXXXXXXXXX”;
google_ad_width = xxx;
google_ad_height = yy;
//–>
</script>
<script type=”text/javascript”
src=”http://pagead2.googlesyndication.com/pagead/show_ads.js”>
</script>

2) Remove the opening “<script type=”text/javascript”><!–” and the closing “//–>
</script> <script type=”text/javascript” src= “http://pagead2.googlesyndication.com/pagead/show_ads.js”></script>

So what you have left is:

google_ad_client = “pub-XXXXXXXXXXXXXXXX”;
/* xxx x yy, created MM/DD/YY */
google_ad_slot = “XXXXXXXXXX”;
google_ad_width = xxx;
google_ad_height = yy;

3) Add an opening <adsense> and a closing </adsense> so you have:

<adsense> google_ad_client = “pub-XXXXXXXXXXXXXXXX”;
/* xxx x yy, created MM/DD/YY */
google_ad_slot = “XXXXXXXXXX”;
google_ad_width = xxx;
google_ad_height = yy;
</adsense>

4) Make sure that there is not a new line between the opening <adsense> and the google_ad_client and the ending data and the closing </adsense>. Otherwise, there can be a couple issues.

Note that this only works for pages that have been purchased. I want to avoid having a Wild West of people changing Adsense codes every few seconds. If you have thoughts on how allowing Adsense on any page could work though, I’d like to hear about it.

Leave a Reply