Using AdSense in Drupal
One thing many will want to do is add a block of Google AdSense ads to their Drupal sites. There are some modules available at drupal.org that will do it, but it's actually fairly simple to do without using any contributed modules.
The procedure I will describe will implement any service that is implemented by embedding javascript in your page, like Google AdSense or a weather widget from AccuWeather.
From your Drupal site, navigate to the admin section by clicking on "Administer" or by going to /YourSite/admin. (You must be logged in with whatever username and password you used when you created the site.)
You will then see the Administration page as shown here:
Step 1
Under the Site Administration section, click on Input Formats. Here you will see a couple formats listed (Filtered HTML and Full HTML). What we want to do is create a new input format that won't mangle the javascript AdSense code that Google provides. Click on "Add input format".
The page that comes up asks for a title. I usually give this format the title of "As is" but any name is OK. In the second section, "Roles," leave the checkboxes unchecked since this functionality will be reserved for the administrator alone. You don't want any other users embeddiing javascript on your site!
Under the "Filters" section, uncheck all the boxes, so no filters will be applied, and click on "Save Configuration".
Step 2
Navigate back to the Administration page, and under "Site Building" click on "Blocks". On the page that comes up, click on "Add Block". On the add block page, enter in the Block Description field "AdSense" or whatever you like. Leave the Block Title blank, unless you want a title above your block of ads.
In the Block Body field paste the javascript code that Google AdSense provided you when you set up your ad at www.google.com/adsense, or whatever code you want to embed.
Then, under "Input Format" choose "As is" which is the input format you created in step 1.
There are a few more options you can choose if you so desire, but you can safely ignore them. Finally click "Add Block" at the bottom of the page. You will then be sent back to the Blocks page with the message "The block has been created."
Step 3
Scroll down the Blocks page to the list of Disabled blocks. In the list you will the the block you created in step 2, "AdSense". From the select option drop-down next to it, choose "Right sidebar" and then click "Save Blocks" at the bottom of the page.
When you navigate to your home page, you will see the AdSense block you created in the righthand column, as shown below. (Google says there may be a ten minute delay if you just created the ad.)
Of course, you can place your block in whatever part of the page you want. And Google offers several sizes of ad blocks for you to choose from.


