Google generates a completely different CSE code nowadays. Update the search box and results page to match the new code.

Comments

jcnventura created an issue. See original summary.

deomacius’s picture

Are you referring to the publisher id change from pub-* to ca-pub-*? If so, it looks like all that is needed is to update lines 192-194 in adsense.admin.inc to look like the following:

if (!preg_match('/^ca-pub-[0-9]+$/', $form_state['values']['adsense_basic_id'])) {
    form_set_error('adsense_basic_id', t('A valid Google AdSense Publisher ID is case sensitive and formatted like %id.', array('%id' => 'ca-pub-9999999999999')));
  }
jcnventura’s picture

No, I'm not referring to that. The 'ca-pub' has already been part of the code since about 7 years at least (see https://git.drupalcode.org/project/adsense/commit/e28ac5f21de05af4464246...).

The code uses ca-pub-nnn, but your true publisher ID is pub-nnn. Go to account information in your adsense account and you'll be able to confirm that.

I'm referring to the fact that if you generate a new search ad unit in the adsense UI, you'll get completely different code, both for the search box and for the results page.

jcnventura’s picture

  • jcnventura committed c007cc7 on 8.x-1.x
    Issue #3004911 by jcnventura: Support CSE 2.0
    
jcnventura’s picture

Status: Active » Fixed
jcnventura’s picture

Needs a port to Drupal 7.

jcnventura’s picture

Version: 8.x-1.x-dev » 7.x-1.x-dev
jcnventura’s picture

Status: Fixed » Active

  • jcnventura committed 86b8e6e on 7.x-1.x
    Issue #3004911 by jcnventura: Support current CSE code
    
jcnventura’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.