Industry guru Dave Taylor offers tech support on technical and business topics, including iPhone, iPod, Microsoft Windows, Sony PSP, cellphones, online advertising, CSS, Web design, business, Unix, Linux, SEO, Mac OS X, and shell script programming.     


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.


More Useful Search Engine Optimization (SEO) Articles:
✔   How do I restructure my Wordpress blog without losing SEO?
I have a wordpress blog that was using categories in the url structure like this: /category_name/post_name/ Then I had read somewhere that if...
✔   Change in Web site navigation drops PageRank to zero?
We changed our website recently and also changed the menus on it so some of our pages have a different path now. For...
✔   How do I implement add rel=author for Google serps?
I notice that sometimes on the Google search results that the author of the article is displayed next to the match in the...
✔   Add a new site to my Google Webmaster Tools account?
Thanks for your earlier blog entry about how to verify my account with Google Webmaster Tools! Now I want to add an additional...
✔   How do I verify my site with Google Webmaster Tools?
I've heard that one of the best ways to improve my Google search ranking is to fix anything that's marked as incorrect in...

Let's stay in touch!
Sign up for my weekly AskDaveTaylor Newsletter and you'll receive even more tech and gadget help right to your inbox, along with exclusive news and industry updates. It's good stuff. I promise!
    Enter your name: and your email addr:  





Categorized: HTML, JavaScript and Web Site Programming , Search Engine Optimization (SEO)   (Article 6889, Written by )
Tagged: adsense for search, google adsense, google search
Previous: How do I sychronize passwords on Safari and Firefox?
Next: What's the best game for the Xbox 360?




Reader Comments To Date: 3

gaurav said, on April 23, 2008 7:57 AM:

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

bill said, on August 11, 2009 8:27 PM:

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,

paul said, on May 19, 2010 10:12 AM:

Ask davetaylor is one of the most intresting sites i have seen in recent time. Dave taylor knows exactly what beginners in web development want and he gives it hot!
Please,dave can you please show me how:
1. I can get a google adsense code for my site?
2. Run scripts or add fadein/fadeout documents to my site?(DHTML) Note: My browser does not support active script.
Thank you so much

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, Dave, for all your helpful information by buying you a cup of coffee!

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











I will never send you any unsolicited email. Ever.






Check This Out Too...

 
Look for Answers
Need Help? Ask Dave Taylor!


Follow Me on Pinterest

Find Me on Google+
ADT on G+
© 2002 - 2013 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. Further, 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. My lawyer says "Thanks".
"Ask Dave Taylor®" is a registered trademark of Intuitive Systems, LLC.