Drupal 6: Integrating Adsense for Search
I’ve been using Drupal for almost a year and I find it very easy to customize and configure. In fact, Drupal is my second blogging platform after Blogger. The Drupal development and community is very active. In this post I will show you how to easily integrate Google’s ‘Adsense for Search’ into Drupal 6 so that the search result can be shown and contained on your Drupal site.
1. Download and install ‘Google Custom Search Engine’ module for Drupal 6 to your Drupal installation. If you don’t know how to install a Drupal module, extract and upload the content of google_cse-6.x-x.x.tar.gz to the sites/all/modules directory of your Drupal installation. Make sure the folder google_cse exists after you upload the files (1).
2. Go to Administrater panel > Modules and enable Google CSE and Google CSE search (2).
3. We need to create a search engine in order to get the Google Custom Search Engine ID. Login to your AdSense account. Go to AdSense Setup > AdSense for Search. Follow these settings (you can leave the unmentioned settings to the default value, or you can customize it if you want):
Choose Search Type
Search Type: The entire web
Optional Keywords: You can put some keywords if you want, or just leave it blank.
Search Results Style
Opening of search results page: Open results on Google in the same window
You can customize the color of the search result page. If possible, you can match the color with your Drupal theme.
You can just ignore the logo image URL and logo destination URL setting.
Give a name for your search engine (My Search Engine for example) and hit Submit and Get Code.
4. In the Search Box Code Page, copy your Google Custom Search Engine ID (the cx value). It should look like partner-pub-XXXXXXXXXXXXXXXX:xXXxxx-XXxx (3). Copy and save it somewhere else.
5. Go to your Drupal Administer panel. Click Google CSE in Site configuration. In this page, you can configure the setting for Google CSE module.
Configuration
Google Custom Search Engine ID: Put your Google Custom Search Engine ID that you copied in step 4.
Display search results: On this site
Ad format on this site: I recommend ‘Top and bottom’ if you use right sidebar on your site.
(you can just leave other configuration to default value, customize them)
6. Go to Administer > User Management > Permissions. Select which user group that you want to allow to search using ‘AdSense for Search’ (4).
7. To put the ‘AdSense for Search’ search block on your page, go to Administer > Site Building > Blocks. Set the location for ‘Google CSE’, on where you want to display the search block (5). You can also use this block to replace the default Drupal search block if you want your site visitor to use AdSense for Search as the default search on your site.
You have successfully set up and integrate AdSense for Search for your Drupal installation!
[Drupal] [Google Custom Search Engine Module]
Trackback URL for this post:
- whiztech's blog
- Add new comment
- 242 reads
Cannot find what you are looking for?



























Recent comments
5 days 17 hours ago
1 week 1 day ago
2 weeks 2 days ago
3 weeks 1 day ago
3 weeks 1 day ago
3 weeks 2 days ago
3 weeks 5 days ago
3 weeks 6 days ago
3 weeks 6 days ago
5 weeks 20 hours ago