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

Comments

Comment #1

jcnventura created an issue. See original summary.

deomacius’s picture

Comment #2

deomacius commented

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

Comment #3

jcnventura
Primary language English
commented

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

Comment #4

jcnventura
Primary language English
commented

Comment #5

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

Comment #6

jcnventura
Primary language English
commented
Status: Active » Fixed
jcnventura’s picture

Comment #7

jcnventura
Primary language English
commented

Needs a port to Drupal 7.

jcnventura’s picture

Comment #8

jcnventura
Primary language English
commented
Version: 8.x-1.x-dev » 7.x-1.x-dev
jcnventura’s picture

Comment #9

jcnventura
Primary language English
commented
Status: Fixed » Active

Comment #10

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

Comment #11

jcnventura
Primary language English
commented
Status: Active » Fixed

Comment #12

Status: Fixed » Closed (fixed)

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