Google Adsense Code in Drupal 6

I have another sites,, and it was build using Drupal 6.2. I thought Drupal 6 must be better than the previous versions so I decided to use it. But that's wrong -- perhaps until right now,  we can't find contributed modules in Drupal 6 as much as in Drupal 5. For example adsense modules. Until today in Drupal site, adsense modules only available for drupal 4 and 5.

So, I decided to use a block and put manually my adsense code there.

Administrator >> Site building >> Blocks >> Add Block

Then activate the block. But it not working. The adsense code show as a text in a block.

After read some other user experience in Drupal forum who had same problem like me, I found an answer. Input format in Drupal 6 is a little bit different with Drupal 5. Default input format in Drupal 5 and 6 is Full HTML, but the difference is in Drupal 5 Full HTML mean PHP code also included, so if we use Drupal 5 and put adsense code using Full HTML format then it should be working. If we do that in Drupal 6 then it wont working. That's the difference.

To make adsense work on Drupal 6.2 :

1. First I have enabled PHP Filter module.

Administrator >> Site building >> Module >> PHP Filter

2. Create a block and paste my Google Adsense code in block body.

3. Select PHP code as Input Format not Full HTML.

4. Save and activate the block.

And now it work. You can see it here.

Note : We can use this method until adsense module for Drupal 6 are available.


The content of this field is kept private and will not be shown publicly.
If you have a Gravatar account, used to display your avatar.
  • Lines and paragraphs break automatically.

More information about formatting options

This blog uses the CommentLuv Drupal plugin which will try and parse your sites feed and display a link to your last post, please be patient while it tries to find it for you.
Jawab pertanyaan ini untuk membedakan apakah anda pengunjung atau spam.
6 + 7 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.