Hello,
I've installed a block with adsense module google custom search, but it is not working. Search always returns no results, and even google adsense reports my custom search as inactive. When I built a custom block with the code I got from google adsense page, it reported as active (and search worked)... I'm using drupal 6.9 in Spanish language, and the latest non-devel adsense module. Here is the code google adsense page tells me:

-----begin of google code----

<form action="http://www.google.es/cse" id="cse-search-box">
  <div>
    <input type="hidden" name="cx" value="partner-pub-xxxxxxxxxxxxxxxx:yyyyyyyyyyy" />
    <input type="hidden" name="ie" value="ISO-8859-1" />
    <input type="text" name="q" size="28" />
    <input type="submit" name="sa" value="Buscar" />
  </div>
</form>
<script type="text/javascript" src="/cse/brand?form=cse-search-box&amp;lang=es"></script>

-----end of google code----

This is the one drupal adsense module generates:

-----begin of adsense module code----

    <div class="content"><div class='adsense adsense_cse'>
<form action="http://empresarialesuned.com/adsense/cse" id="cse-search-box">
  <div>
    <input type="hidden" name="cx" value="partner-pub-xxxxxxxxxxxxxxxx:yyyyyyyyyyy" />
    <input type="hidden" name="cof" value="FORID:9" />
    <input type="hidden" name="ie" value="ISO-8859-1" />
    <input type="text" name="as_q" size="28" />
    <input type="submit" name="sa" value="Buscar" />
  </div>

</form>
<script type="text/javascript" src="http://empresarialesuned.com/modules/adsense/cse/adsense_cse.js"></script>
</div></div>

-----end of adsense module code----

Of course, partner id is the same in both cases (I've replaced it with x/y for no reason, really).
Any ideas about the issue?
Thanks so much!

Comments

jcnventura’s picture

Hi,

Can you try the current 6.x-1.x-dev version? I notice that you're not using clean URLs, and your problem is probably a duplicate of #332914: CSE does not work when clean URLs are not enabled.

João

jcnventura’s picture

Status: Active » Postponed (maintainer needs more info)
panoramix-1’s picture

Hi!
I've tried updating to the latest dev version, but I'm still getting the same result... No search result; inactive block in google adsense reports...
Anything else I could try to give you a clue?
Thank you so much once more!

jcnventura’s picture

Your search results page works:

http://www.empresarialesuned.com/adsense/cse?cx=partner-pub-xxxxxxxxxxxx...

The problem is that after the form is submitted the URL that is called:

http://www.empresarialesuned.com/index.php?q=adsense/cse&cx=partner-pub-...

Something is re-writing the URL to have %253A instead of only %3A, and that's the reason why your search results are not working..
Also, I find it really weird that it adds the "index.php?q=" unclean URL prefix.. I would start looking in the RewriteRules of your htaccess files.

I can't help you more than this.

João

panoramix-1’s picture

Thank you so much, João. Please mark the issue as closed, then. I'll give it a look and try to investigate where this rewriting comes from...

jcnventura’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Closing it then.