Industry guru Dave Taylor offers free tech support on a wide variety of technical and business topics, including HTML, Apple iPhone, online advertising, Cascading Style Sheets, Web design, management, Unix, Linux, search engine optimization, online dating, Mac OS X, shell script programming and Microsoft Windows.

How can I get Google search results on my site?

I have been using Google's AdSense for Search program for a while now and having some okay results with it. What I'm wondering is whether it's possible to have the search results appear on a page on my site, rather than losing the traffic to the Google system?

Dave's Answer:

Until a few days ago I would have said either "no" or "not without some serious programming", but Google's AdSense team just released this very capability and while it's not very easy to configure yet, I'm sure it'll get better soon. In any case, let's see what we can figure out...

No surprise, your first step is to log in to your Google AdSense account [what's that? You don't have one yet? Then please start here: Get started with Google AdSense]

Once you've logged in and - hopefully - admired how much you've earned today with the addition of AdSense to your site or sites, click on the AdSense Setup tab. Now click on AdSense for Search:

Google AdSense for Search

Now you'll want to choose between having a search feature that's just the entire Google database, or the ability for your visitor to choose between a Google or site search. I'll actually set this up for my Intuitive Life Business Blog, so I'm going to offer both Google search or just my site's search. In Google terms, that's known as Google WebSearch + SiteSearch and it looks like this:

Google AdSense WebSearch + SiteSearch

Scrolling down a bit, there are some rudimentary tweaks you can make to the search box, which you'll probably put on many pages throughout your site:

Google AdSense Search Box Style

Not too thrilling, I admit, but I want my site content to be the focus, not the Google search box. Anyway, you can see how this can be tweaked for your own use.

The new capability is in the "More options" area:

Google AdSense Search Results Page

Any guesses? What? "Open results within my own site"? You're exactly right!! :-)

Chose that and you'll now move into a bit of a Catch-22, so be ready:

Google AdSense Search Results Page On Site

The issue here is that Google isn't going to give you the entire page, just a snippet to drop in the middle of a page you design. This is good, because it means you can wrap it however you'd like, but it's a bit confusing because you already need the page to exist before you can specify it here.

For now, just create a stub page as I did at this step. Then I named it search-results.html and uploaded it to my intuitive.com server, specified the full URL on the AdSense page, and clicked "Continue".

Next it's time to pick a color scheme for the search results. Most likely you should pick the same colors as Google uses on its default search system but it's a nice chance to tweak things to match your own color scheme, so I'll do the same, by specifying "Snowcone" as my palette:

Google AdSense Search Results Page: Color Scheme

Believe it or not, we're almost done. Select a new channel for this revenue stream (why not?) and click on "Continue" one more time.

Now the AdSense system will show you two different HTML code boxes. The first is the code to get the special search box, which I can duplicate on this page and you can, frankly, duplicate on your site if you're so inclined. It looks like this:

Google AdSense Search Box: Code

And here's what it produces:


Web www.intuitive.com

Try it right now: search for "Hewlett" on the Intuitive.com site and see what you find.

Back with me? Good, because we haven't checked out the code for the search results on the new stub page I created. That looks like this:

Google AdSense Search Box: Code

I simply copy and paste that into the appropriate spot on my stub page, and voila! I have Google search results -- with AdSense enabled advertisements that can hopefully earn me a buck or two -- neatly integrated into my own Web site.

For bonus points, don't forget that you can always add a search box on the results page too, though if the only way people can get there is from searching in the first place, it's probably unnecessary. Also, if you're a perfectionist (like I am) you can carefully fiddle with the HTML code to remove, for example, the "www." prefix on your domain name, as I have done on the actual Intuitive.com site.



Help others find this article at Del.icio.us, Digg, Netscape, Reddit, and Stumble Upon    

Subscribe!

Never miss another useful Q&A article again! Subscribe to AskDaveTaylor with Google Reader.

Comments

how can i send email from my website by php programme.please send me email form and php code.thats it!

Posted by: gaurav at April 23, 2008 7:57 AM

I'm new to AdSense and I don't see the options you have listed above in regards to the ability to search my site or the web. Is there still a way to go through AdSense and give the user the option to select which to search? Thanks,

Posted by: bill at August 11, 2009 8:27 PM

I have something to say, now that you mention it, but ...
Starbucks coffee cup I do have a lot to say, and questions of my own for that matter, but first I'd like to say thank you for all your efforts on this Web site by buying you a cup of coffee!

I do have a comment, now that you mention it!











Remember personal info?


Please note that I will never send you any unsolicited email. Ever.

While I'm at it, please note that by submitting a question or comment you're agreeing to my terms of service, which are: you relinquish any subsequent rights of ownership to your material by submitting it on this site.








Ask Dave Taylor: The iPhone App: Advertisement



Follow me on Twitter @DaveTaylor

Search
Find just the answers you seek from among our 2300+ free tech support articles by using our Lijit search engine.


Help!





Subscribe to
Ask Dave Taylor!

Add to Google Reader
Add to My Yahoo!
Subscribe in NewsGator Online

RDF   XML

Free Updates!
Sign up and get free weekly updates and special offers on books, seminars, workshops and more.


Recent Entries
Book Links
© 2002 - 2010 by Dave Taylor. All Rights Reserved.

Note: This web site is for the purpose of disseminating information for educational purposes, free of charge, for the benefit of all visitors. We take great care to provide quality information. However, we do not guarantee, and accept no legal liability whatsoever arising from or connected to, the accuracy, reliability, currency or completeness of any material contained on this web site or on any linked site.

[whiteboard marker tray]
"Ask Dave Taylor®" is a registered trademark of Intuitive Systems, LLC.