AdSense for search (AFS)

Show search results in your own site

When you display AdSense for search results within your site, the results of a user search performed in your AdSense for search box will appear within a frame on your own page. This means that rather than users being taken to Google, they will stay on your site, while still having access to the useful information provided through Google web search.

First, be sure to create the page where the search results will be displayed.

If your web host or site application does not offer you the ability to create a separate URL for your search results -- for example, if you're using Blogger -- you will not be able to implement your search results within your page.

Once you've created the page where search results will be displayed, follow these steps:

  1. Sign in to your AdSense account.
  2. Click Ads for Search.
  3. Click +New custom search engine.
  4. Customize your search engine as usual. Expand the Search results section.
  5. Select the radio button marked Display results on my website using an iframe. Show search results
  6. Enter the URL of the page you've created in which you'd like search results to appear. You must create this page yourself; it will not be created or displayed automatically on the URL you enter. If you're familiar with relative URLs, you're welcome to enter one instead of the full URL.
  7. Click Save and get code.
  8. Copy the code generated in the Search box code box and paste it into the HTML source of the page where you'd like to display the search box.
  9. Next, copy the code generated in the box labeled Search results code and paste it into the HTML source of the page on which you'd like to display the search results.
  10. Save your webpages.
Was this helpful?
How can we improve it?

Need more help?

Sign in for additional support options to quickly solve your issue