You are here

google_adwords.module in Google AdWords Conversion Tracking 8

Google Adwords Conversion Tracking Module.

File

google_adwords.module
View source
<?php

/**
 * @file
 * Google Adwords Conversion Tracking Module.
 */

/**
 * Implements hook_page_attachments_alter
 *
 * Attach any added trackings to the page element as #attachments
 *
 * @param array $page
 */
function google_adwords_page_attachments_alter(array &$page) {

  /**
   * @var Drupal\google_adwords\GoogleAdwordsTracker $adwords_tracker
   */
  $adwords_tracker = \Drupal::getContainer()
    ->get('google_adwords.tracker');
  if ($adwords_tracker
    ->hasTracking()) {
    $adwords_tracker
      ->attachTrackingToElement($page);
  }
}

Functions

Namesort descending Description
google_adwords_page_attachments_alter Implements hook_page_attachments_alter