You are here

function adsense_click_register in Google AdSense integration 7

Same name and namespace in other branches
  1. 5.3 contrib/adsense_click/adsense_click.module \adsense_click_register()
  2. 6 contrib/adsense_click/adsense_click.module \adsense_click_register()

Logs a click in the database.

1 string reference to 'adsense_click_register'
adsense_click_menu in contrib/adsense_click/adsense_click.module
Implements hook_menu().

File

contrib/adsense_click/adsense_click.module, line 84
Enables Drupal to track and log the clicks on AdSense ads.

Code

function adsense_click_register() {
  if (variable_get('adsense_click_tracking', ADSENSE_CLICK_TRACKING_DEFAULT)) {
    db_insert('adsense_clicks')
      ->fields(array(
      'ip' => ip_address(),
      'timestamp' => REQUEST_TIME,
      'path' => $_GET['u'],
      'title' => $_GET['t'],
      'referrer' => $_GET['r'],
    ))
      ->execute();
  }
}