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.
Once you've created the page where search results will be displayed, follow these steps:
- Sign in to your account at https://www.google.com/adsense.
- Visit the My ads tab.
- Choose Search as the product.
- Click New custom search engine.
- Customize your search engine as usual. Expand the Search results section.
- Select the radio button marked Display results on my website using an iframe.
- 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.
- Click Save and get code.
- 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.
- 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.
- Save your webpages.