Setting up Drupal AdSense

Step 1. Setup & register your http://www.google.com/adsense account first. At the end of the wizard cut and paste the code generated. You will need this later. You will need all the code plus the google_ads_slot value.

Step 2. ( get the installation kit) for 6.x
Note the Publisher ID: ( top right corner begins with pub-xxxxxxxxxxxxxx

Download the following modules;

AdSense http://drupal.org/project/adsense
AdSense Injector http://drupal.org/project/adsense_injector

FTP over to your site into the module directory. Ensure all sub directories are copied. I have noticed that for some reason FileZilla sometimes doesn't copy sub directories so watch out!

Step 3:
Goto administer/site building and enable the following modules

Ads (old) 6.x-1.0
AdSense Click Tracking 6.x-1.0
AdSense core 6.x-1.0
AdSense Injector 6.x-2.7
CSE Search 6.x-1.0
Managed ads 6.x-1.0
Revenue sharing basic (old) 6.x-1.0
Search (old) 6.x-1.0

Step 4: ( configure drupal Adsense module)
Goto /administer/site configuration/adsense

a) Publisher ID
Add your google adsense publisher ID , begining with pub-xxxxxxxxx ( where x are digits)
b) Adsense Blocks
mine is set to 3
c) Custom Search
your preference
d) Click Tracking
your preference
e) settings
your preference

Step 5: ( AdSense Injector) configuration.

a) Click on Node body ad insertion - enable Insert inline ad in node body on page views.
b) Set the minimum node to what ever you like. Mine is set to 60.
c) Paste the code generated from the adsense wizward ( this is from the google.com/adsense account setup) into the Node body ad insertion template.
d) save configuration

Step 6: ( configure blocks)
Now goto admin/build/block page
locate the new AdSense disabled block and set a region. Then Click on configure.

a) Change the Block Description to something more meaningful ( this is not essential but worth it)
b) Leave the block title blank.
c) change the Adformat to whatever you defined in google adsense setup from google.com/adsense wizard. I have chosen 160x600 Wide skyscraper. See my ads on the left side.

THEN the important part. Put the Ad Slot ID . This is a different number from the published ID I have mentioned above ( step 3 part a). This is found when you complete the adsense wizard. The AdSense wizard generates html code. Inside that code you will see a section that defines the gloss_ad_slot value.

google_ad_slot = "xxxxxxxxxx"; where x is a 10 digit code. I don't know if it is always 10 digits!

All other settings on this page are for your preference.

Now save your work and log out of user Admin. Google AdSense does not display in user Admin mode. Now go back to your site and you should see the google AdSense displaying.
The ads might not display straight away. It does takes some time for Google to index new sites and show ads on them. For me it started working within 30mins. I have heard it can take up to 48 hours for the ads to start appearing.

Thanks for the tips

Thank you for explaining the google_ads_slot id. I didn't realise I needed it. I thought it was the same as the pub id !!!!

Maria.

I got it working

Hey frontmasters, I followed your instructions and it worked ! thanks for the web site. Keep up the good work.

Cheung , China