You are here

function google_adwords_page_build in Google AdWords Conversion Tracking 7.2

Same name and namespace in other branches
  1. 7 google_adwords.module \google_adwords_page_build()

Implements hook_page_build().

This adds the tracking code into the page between the body tags.

File

./google_adwords.module, line 245
Google Adwords Conversion Tracking Module.

Code

function google_adwords_page_build(&$page) {
  if (isset($_SESSION['google_adwords_rules_traking_codes'])) {
    $codes = $_SESSION['google_adwords_rules_traking_codes'];
    foreach ($codes as $code) {
      $markup = theme('google_adwords', $code);
      $page['page_bottom']['google_adwords_path'] = array(
        '#weight' => 55,
        '#markup' => $markup,
      );
    }
    unset($_SESSION['google_adwords_rules_traking_codes']);
  }
}