How to create Google custom search code using adsense search unit

by Harsh Agrawal on May 12, 2009

in Google adsense

Google adsense is one of the best contextual advertisement program for bloggers. It never lets your blog run out of advertisement. Google allow lots of ad unit to integrate in your   blog. You can see my previous post on Maximum number of adsense ad unit on a single page. Though later on Google adsense dumped the video unit. You can read about this here Farewell time to google adsense video unit.

google_adsense_logo

Few days back we talked about how you can improve adsense revenue using adsense for rss feeds. Another good way to increase your adsense revenue by adding adsense for search unit.

Using adsense for search unit help you to add search box in your blog and also help you to add extra revenue in your pocket. If you have a blog with 1000 of posts ,adsense   search box will be very handy for you.

Here are the screenshot which will easily help you to understand how to create Google custom code adsense unit

Login to your Google adsense account and Click on adsense set up

adsense_setup

Click on adsense for search option

adsense_for_search

On the next page, Edit your setting, see screenshot for more detail

search_set_up

Click on continue and in the next box select the search box style and length you want to use into your blog.

google_custom_search_option

Click on continue and in the next box,

You can select various options like where do you want your search window to be open. You can also create a new page on your wordpress blog and use it to show search result.

you can make changes like ad placement and ad colors. After making those changes. Click continue and copy your adsense search unit code and place at appropriate place in your blogspot or wordpress blog.

A sample adsense search unit code will look like this.

<form action="http://www.google.com/cse" id="cse-search-box" target="_blank">
  <div>
    <input type="hidden" name="cx" value="partner-pub-xxxxxxxxxxxxxxxxxxxx" />
    <input type="hidden" name="ie" value="ISO-8859-1" />
    <input type="text" name="q" size="26" />
    <input type="submit" name="sa" value="Search" />

  </div>
</form>

<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&amp;lang=en"></script>

I hope this tutorial will help you to easily create adsense for search unit.

Don’t forget to read my previous tutorial on

10 simple mistakes to avoid violating Google adsense policies

Improve your adsense earning using adsense section targeting

Enter your email address:

Related posts:

  1. Farewell time to adsense video unit
  2. Adsense search ad unit : Is it justified?
  3. Official announcement of Google adsense for mobile search
  4. Improve your Google adsense revenue using adsense section targeting
  5. 10 simple Tips to avoid violating Google adsense policies
  6. Enhance your 404 pages with Google custom search page
  7. [Make Money online] Google Adsense Placement Guide
  8. Increase Adsense Earning By Understanding Adsense Custom Channel


{ 14 comments… read them below or add one }

1 Paritosh May 12, 2009 at 12:54

Can i use custom search with the built in search box of blogger template ?

Reply

2 Harsh Agrawal May 12, 2009 at 13:53

I guess yes! You can! :)

Reply

3 George Serradinho May 12, 2009 at 14:46

I tried this adsense search before and had a page up on my blog, but eventually I took the page down. I could see no one used it besides myself.

Thanks for the info, very detailed post.

Reply

4 Harsh Agrawal May 12, 2009 at 15:15

Adsense for search box does great when you have lots of posts and lots of readers are following you from long. They will prefer to look back into your post using it.
Well the adsense for search unit are not very effective but still a great way to solve two purpose.
# Search box for users
# Monetization

Reply

5 George Serradinho May 12, 2009 at 14:49

About my previous commnet:
I never put in my twitter name and it somehow populated it by itself. Is that right? Maybe it took my username from a previous comment I submitted.

My twitter account is still suspended.

Reply

6 Harshad May 12, 2009 at 18:32

I have not used custom search on my tech blog yet. Thinking to add it on this weekend.

Harshad™s last blog post..How to Add Twitter Field in the Comment Section of Thesis Theme?

Reply

7 Harsh Agrawal May 13, 2009 at 13:34

Even I added it late and I believe it’s a good idea to add it because it will be useful in both the ways.
User experience and monetization.

Reply

8 George Serradinho May 12, 2009 at 21:27

Maybe I will try it again, but for now I’m working on other big projects to get some kind of income.

George Serradinho™s last blog post..Funny – iBoob from Apple

Reply

9 Curious Little Person May 13, 2009 at 01:51

Have not started using adsense or any other ads for that matter!

You write great stuff! Keep up the good work!

Cheers
Sandeep

Curious Little Person™s last blog post..What Is A Blog?

Reply

10 Harsh Agrawal May 13, 2009 at 13:30

Thanks for your comment Sandeep :)
Though I will suggest its a good idea to start with moderate advertising in the begining. If you are not monetizing your blog now, you are missing a part of income which belong to you.

Reply

11 Nihar May 13, 2009 at 12:06

Harsh, I have setup the code, but didn’t paste it.

Basically, what i want is when a user searches and hits enter, I want the same theme layout but without sidebar. Meaning full page wide google search results. How to achieve that?

Any idea?

Nihar™s last blog post..How to Find Broken Links, Missing Titles, Image alt text with Xenu™s Link Sleuth tool

Reply

12 Harsh Agrawal May 13, 2009 at 12:13

Yes Nihar
That can be easily done
You need to create a new page and name it as yourdomain.com/search
In the last step where you are getting an option to select how you want page to open, you can use custom page and enter your Page URL

That will help. If not I will write a new post for the same.

Reply

13 Tony May 13, 2009 at 18:37

I used the adsense search box on a few of my sites, but like one of the commenter’s above, hardly anybody used it so I took it down.
Informative post though :)

Tony™s last blog post..How to Stop Sweating

Reply

14 Nick Aster February 10, 2010 at 02:07

Does anyone know how to get this to work with wordpress? It seems impossible to do anything with wordpress without either knowing PHP or waiting around for someone to build you a plugin. Any links appreciated!

Reply

Leave a Comment

Previous post:

Next post: