Google Adsense Code in Drupal 6
I have another sites, www.erakomputer.com, 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.
- roemasa's blog
- Add new comment
- 479 reads