Tuesday, April 24, 2018 04:29 am EDT

Configuring Drupal 6 With Google AdSense Module

Bri's picture

I had some trouble when I initially tried setting up AdSense ads on my drupal 6 site. Here are some instructions to help you get it working if you are experiencing trouble.

If you haven't already, download the AdSense module form http://drupal.org/project/adsense

Install the module in the same manner you would any other module. When you get to the modules page of your drupal install, you will notice there are a few options to enable. If you want to display ads like i have on this page, you will need to enable the AdSense core as well as Managed Ads. Tick those checkboxes and save the configuration.

Now you will have a new page at /admin/settings/adsense where you can configure some options. This page is listed under the "Site Configuration" heading of the administrative section.

When you get to the settings page, it looks like the following:

You can give your block a more meaningful description and optionally give it a title. You should choose the same ad format that you created when you you built the ads in Google AdSense. The most important part to fill in is the Ad Slot Id. This number can be found from inside you Google AdSense account.

This page has some information on help and instructions as well as some other settings. You can determine which pages your AdSense ads will display on, much like block settings. This isn't really that important since we will configure each AdSense block individually once they are created. More importantly are the other settings at the top of this page. At the top of the page click on the "PublisherID" link.

Now you will be taken to a page that looks like the following:

You need to provide your Google AdSense publisher ID in this box. Navigate on over to the Google AdSense page and login using your account credentials. Once you have logged in, take a look in the upper right corner. There you will find the publisher id that needs to be put in the PublisherID box of the AdSense module.

After going back and filling in the PublisherID, you will want to head over to the drupal blocks page. Locate one of the three Adsense:Unconfigured blocks. There should be 3 of them by default. If you have enabled the older code, make sure you are using the correct one. Click the configure link next to the block and you will get a page that is mostly familiar to most block settings pages.

Here you can provide a more meaningful block description and optionally add a block title. You will want to choose the same Ad Format that you chose when you set up the ads in your AdSense account. If you are not sure, login to AdSense and take a look. You will need the Ad Slot Id as well. Log in to your account and find the following:

Once you login, click on the "AdSense Setup" tab at the top as indicated by the first red ellipse. Next click on "Manage Ads" underneath, as indicated by the second red ellipse. This page will list all of your ads. The big red arrow shows where to find your Ad Slot ID. The size of each ad is also listed. Go back to the block page and enter this information. Once you have entered the info, place your block where you would like it and adjust the visibility settings like you would for any other block.

Your ads should start showing up after a few minutes. The ads are disabled for the site admin, so be sure to logout and see if they are working.