Make it easy for a unique id, therefore people with adsense for search, can put in their indicator and still get paid for searching.

Comments

Grinin’s picture

I agree, this would be extremely useful!

Crell’s picture

I confess to not being an expert on Google's APIs. This module was mostly just a "see if I can do it" module. :-) Do you have a URL for reference? A patch would be welcome, too.

techczech’s picture

I agree, as well. The AdSense url looks like this:

http://www.google.com/custom?domains=Bohemica.com&q=test
&sa=Search&sitesearch=Bohemica.com&client=pub-5281311371744532 .... more specs

"client=pub-5281311371744532" is the AdSense code. The AdSense module stores it in a profile field so it could just be retrieved from that. (Sorry, no code.)

Crell’s picture

Version: 4.7.x-1.x-dev » 5.x-1.x-dev
Status: Active » Needs review

Well I don't have an AdSense ID, so I'm not sure if it worked. :-) Try the 5.x-dev package as soon as it becomes available. In theory, it should add whatever the site-owner client id is to the search form if the adsense module is enabled.

If it works, let me know and I'll make a proper release of it. If not, suggestions welcome on how to make it work. :-) (I am not currently planning non-bugfix patches to the 4.7 branch.)

Crell’s picture

Status: Needs review » Fixed

No feedback, so I'll assume it's working. If not, please file a new bug report.

Anonymous’s picture

Status: Fixed » Closed (fixed)
Korak1’s picture

I see that this is status closed... Was it added to the module code officially?

Crell’s picture

Yes, it's in the Drupal 5 branch.

j9’s picture

Title: Make it easy to put your Unique ID. » Code hack for 4.7?

Not sure if this is proper and/or works, but I've modified the code below and it *looks* like the ad urls displayed on the resulting search results pagere might work. Just look for the code below in the 4.7.x module file and make it look like it does below. The only part I added was the middle $form chunk. Replace 0000000000000 with whatever your id is, and just use the niumeric part (at least that's what I'm doing now). If anyone knows if this works, please let us know.

  $form['q'] = array(
    '#name' => 'q',
    '#type' => 'textfield',
    '#title' => t('Google Search'),
    '#size' => 10,
    '#maxlength' => 255,
  );
  $form['client'] = array(
    '#type' => 'hidden',
    '#name' => 'client',
    '#value' => t('0000000000000'),
      );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Search')
  );
dortez’s picture

I dont think so. I added this line and it does not reflect on my adsense after three days of using it.