How can I integrate Search404 with Google Adsense search? Would something like this work

drupal_goto($base_path . $keywords);

What should be the $base_path? Can $keywords be a space separated list of words?

Comments

jcnventura’s picture

Project: Google AdSense integration » Search 404

The same way that Search 404 integrates with Google CSE, it should also be able to integrate with the Adsense CSE module. I don't think there's much of a difference..

If there's anything that I, as the adsense maintainer can do, feel free to reassign this back to the adsense module.

zyxware’s picture

Project: Search 404 » Google AdSense integration

@jcnventura - Thanks for looking into this. The following is the snippet of code used to make search404 work with Google CSE

      elseif (module_exists('google') && user_access('search Google CSE') && variable_get('search404_do_google_cse', FALSE)) {
        if (!variable_get('search404_disable_error_message', FALSE)) {
          drupal_set_message(t('The page you requested does not exist. For your convenience, a google search was performed using the query %keys.', array('%keys' => check_plain($keys))), 'error');
        }
        search404_goto('search/google/'. $keys);
      }

Would a similar approach work for Google Adsense search? If so what should be the path to which I should redirect to?

jcnventura’s picture

Status: Active » Needs review
jcnventura’s picture

@zyxware: the Adsense CSE path is defined by:

$results_path = variable_get('clean_url', 0) ? ADSENSE_CSE_RESULTS_PATH : '.';
zyxware’s picture

Thanks for looking into this. How do you append keywords to that?

jcnventura’s picture

Issue summary: View changes

I know it's a bit late to answer you.. But FYI, the module uses the "as_q" query parameter to pass the keywords. I just tested this with my site, and the query page was:

http://example.com/adsense/cse?cx=partner-pub-nnnnnnnnn%3Ayyyyyyyy&cof=FORID%3A11&ie=UTF-8&as_q=test1+test2&sa=Search&siteurl=example.com%2F&ref=

adsense/cse is the default path as defined by:

$results_path = variable_get('clean_url', 0) ? ADSENSE_CSE_RESULTS_PATH : '.';

jcnventura’s picture

Project: Google AdSense integration » Search 404
Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Needs review » Active
anish_zyxware’s picture

anybody’s picture

Status: Active » Closed (outdated)