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?
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:
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:
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:
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:
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:
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:
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:
And here’s what it produces:
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:
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.