You are here

function adsense_adstxt_controller in Google AdSense integration 7

Generates the ads.txt page.

1 string reference to 'adsense_adstxt_controller'
adsense_adstxt_menu in adstxt/adsense_adstxt.module
Implements hook_menu().

File

adstxt/adsense_adstxt.pages.inc, line 11
Contains the functions to generate the ads.txt page.

Code

function adsense_adstxt_controller() {
  $client = adsense_get_client_slot_id();
  if (!empty($client)) {
    drupal_add_http_header('Content-Type', 'text/plain');
    print "google.com, {$client}, DIRECT, f08c47fec0942fa0\n";
  }
  else {
    drupal_not_found();
  }
  drupal_exit();
}