Google AdSense: How To Show Search Results On Your Own Page

While opening Google AdSense search results  within your own site is definitely not new, I haven't seen any quick review explaining how it all works and what's required to set it up. Working on enabling this AdSense feature for my Personal Development blog, I figured someone else could find this post useful.

 

Introduction

Why would you want to show Google search results on your own page? To make sure your visitors enjoy the same interface the rest of your website has, of course. To ensure the design integration makes visitors feel as if they're browsing just another one of your pages.

Everyone who had used Google AdSense for search feature in the past, must remember that you had only an option to change some basic colors for the results block, and it would be opened from Google's website and usually look very different from the rest of your website.

Well, now we have an option to change this.

 

How it works 

The idea behind showing your Google search results on your own site is pretty simple. You've got to set up a designated search results page on your site. You're free to change any design feature of this page to make sure it looks as good as any other page of your website, but space for the Google search results must be reserved.

Instead of one piece of Google AdSense code, you're going to get two. The first piece of code is the one creating a Google search form for your website. Something which will look like this:

 

Google AdSense search form

 

 

The second piece of code is for your results page. Just copy & paste the search results code from your Google Adsense to your search results page,  and you're done. If you open such a page manually, without being called by Google AdSense search form, you will see no search results, but if the page is shown as the result of an actual search using the Google search form on your website, you will see a neat page with all the results found and nicely integrated in your design.

 

Step-by-step instructions

I don't intend this page to be a full manual on the Google AdSense search results integration by any means, but all the steps shown before will hopefully show you how easy the whole procedure is. 

 

1) Google AdSense account – you must have a valid AdSense account to begin with. If you still haven't got one, it's not too late to get one – you will find all the details in my Getting Started with Google AdSense article.

 

2) Find out the URL of your future results page 

You need to know where you results page is going to be found, because you will be asked for this URL in during AdSense for search setup.

For WordPress-based blog, it is fairly simple to specify the exact name of your page and therefore know the full URL for this page without even creating it (you can't created it yet, read on to find out why)

 

3) AdSense for search setup 

Log into your AdSense account, open the AdSense Setup tab,  click the AdSense for search, and configure your Google AdSense search in a way similar to this:

  • Search Type section – this is where you decide what kind of search you would like to provide your visitors with. Most likely, you will opt for a Google WebSearch + SiteSearch, as it allows both global and local (your domain-specific) searches.

    Click the radio button for the desired option, and if you opted for the SiteSearch option, type your website's URL in the form provided.

  • Search box style section – this dialog allows you configure the way your Google search form will look on your website
  • More options section is the one where you need to choose the preferred way of  Opening of search results page. If you click the  Open results within my own site radio button there, you will be prompted for a URL of your search results page from Step 2 of this how-to.

Complete all the rest options like you normally would, and the last step of your AdSense for search setup will be the two pieces of code I have mentioned before, ready for you to copy and paste into your website pages. 

 

4) Create a designated search results page for your website

Now that you have the necessary pieces of code in your AdSense setup window, would be a good time to create the results page of yours.

If you're a blogger, then you need to create a static page of some kind and make it look the same way you'd like it to be, leaving space to be populated with search results. 

If your blog is WordPress-based, you will need to create a page template, and then create a new page based on this template. You can find all the necessary information on working with Pages in WordPress on the Pages section of official WordPress documentation site. 

Essentially, a page template in WordPress is nothing but an PHP/HTML file you create in your WordPress theme directory. Take one of the existing page templates to start off, and make sure you paste the second piece of AdSense search code  into this page template where you would like to see your search results.

 

5) Update your website to include the latest AdSense code for the search form. This is where you decide what page of your website (or pages if it's your blog – cause many bloggers put search forms in the sidebar code, so that the search form is shown on practically every page of their blog.

 

That's all, you're done. Enjoy your new Google AdSense search results page!

If you're looking for a working example, please visit my Personal Development blog, and use the search form found on the right  sidebar. If you want to compare my search results page to the same page opened manually, you can always open the search results page yourself (like I mentioned before, you will obviously see no results in this case).

Let me know if you need help with getting this AdSense feature working on your website – just a leave a comment for this post, and I'll be sure to contact you using the email provided.

Also, I think you would benefit from reading the official AdSense support article on the same topic: How do I implement Adsense for search results on my own page?
 

Comments

  1. It is generally observed that many new Adsense publishers do not put Adsense for search on their pages. It does give an extra option to generate revenue and should be implemented on every page of web site.

  2. Yes, I absolutely agree. Thanks for stopping by, Rajeev!

Trackbacks

  1. […] Google AdSense: How To Show Search Results On Your Own Page at Perfect Blogger (tags: Google AdSense blogging WordPress howto search) […]

Speak Your Mind

*