Hello,

Ads are designed to only be shown when your site's visitors actually
perform searches of their own.  You can do default searches with
the .execute method, but users will only see an ad if they do a
subsequent search that they've entered themselves.

Please don't attempt to circumvent this behavior - doing so could be
considered a violation of the ads policy and be cause for suspension
of access to the API.

Thanks!
Adam

On May 28, 9:49 am, michaeltk <[email protected]> wrote:
> Regardless of what search terms I use, .enableAds is not working with
> the following code.  The search is working just fine, but no ads
> appear.  (Obviously, I insert my correct publisher id below).
>
> <script language="Javascript" type="text/javascript">//<![CDATA[
> google.load('search', '1.0');
>
> function OnLoad() {
>
> // create the search control
> var searchControl = new google.search.CustomSearchControl({'crefUrl' :
> 'http://www.mywebsite.com/cref_cse.xml'});
>
> // enable AdSense
> searchControl.enableAds('pub-xxxxxxxxxxx');
>
> // tell the searcher to draw itself and tell it where to attach
> searchControl.draw('google-results');
>
> // execute an inital search
> searchControl.execute("buy books");
>
> }
>
> google.setOnLoadCallback(OnLoad, true);
> //]]>
> </script>

-- 
You received this message because you are subscribed to the Google Groups 
"Google AJAX APIs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-ajax-search-api?hl=en.

Reply via email to