Senserely Yours, we are an ad revenue community: you too can rely on AdSense!
Senserely.com is not sponsored by or directly affiliated with Google.

AdSense Search can be embedded in your website!

adsense search | embedding

Hello, today I’ve seen in my AdSense admin panel that they have - at least - released a new option for AdSense Search: You can embed it in your website, not only simply choosing colors for background and links.

What you have to do if you want to test this feature very quickly on a site where you already use AdSense Search is:

1. Create a page using your site’s template and where you usually put content write this:

<!— Google Search Result Snippet Begins —>
<div id="googleSearchUnitIframe"></div>
<script type="text/javascript">
  var googleSearchIframeName = 'googleSearchUnitIframe';
  var googleSearchFrameWidth = 650;
  var googleSearchFrameHeight = 1300;
  var googleSearchFrameborder = 0 ;
</script>
<script type="text/javascript"
        src="http://www.google.com/afsonline/show_afs_search.js">
</script>
<!— Google Search Result Snippet Ends —>

2. In your search box code you simply have to modify a few things:
- the ACTION and TARGET values of your FORM

It is:
<form name="formsearch" method="get" action="http://www.google.com/custom" target="_blank">
You change to:
<form name="formsearch" method="get" action="http://www.yoursite.com/yourpage.html" target="_top">
Of course yoursite.com and yourpage.html is an example (I know you know, but I'm not talking to you!)

- then the last change is in the very long input:

It looks like this
<input type="hidden" name="cof" value="GALT:#0066CC;GL:1;DIV:…..;LP:1;FORID:1;" />
and you simply have to add 1 at the end, so instead of "FORID:1;" it is "FORID:11;"

And there you go, it works now, try it.

Note that this is exactly what changes from one code to another, so don’t worry about missing something by not generating a new code from the AdSense panel, I did it for you already!

Why it’s not on Senserely? Simple, I’ve tried but Google uses the variable ?q= which is reserved for the CMS I’m using: Drupal.org
So we can say that this new AdSense feature DOESN’T WORK with Drupal, but it should with any other sites which don’t rely so much on a q variable in the URL…

Now if you want the official way of doing it, see page:
https://www.google.com/support/adsense/bin/answer.py?answer=…

The content follows for your viewing pleasure:
How do I implement Adsense for search results on my own page?

Before you can implement AdSense for search results within your own site, 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 an 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. Log in to your account at https://www.google.com/adsense.
2. Visit the AdSense Setup tab
3. Choose AdSense for search as the product.
4. During the first step of the guided setup, scroll down to the More options section and click the radio button marked Open results within my own site
5. 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.

6. Continue to choose any other options for your search box and results.
7. Copy the code generated in the Your search box code box and paste it into the HTML source of the page where you’d like to display the search box.
8. Copy the code generated in the Your search results codebox and paste it into the HTML source of the page on which you’d like to display the search results.
9. Save your webpages

Note: Any AdSense for search settings or options that you’ve selected, including Competitive Ad Filters and site-flavored search, will continue to work with search results in an IFRAME.


Get yourself an AdSense Publisher ID:
Be smart, change your browser:
Best free photo software:
Promote your website:
eXTReMe Tracker