You are here

google_analytics_et.module in Google Analytics Event Tracking 8

File

google_analytics_et.module
View source
<?php

/**
 * @file
 * Contains google_analytics_et.module.
 */
use Drupal\Core\Routing\RouteMatchInterface;

/**
 * Implements hook_help().
 */
function google_analytics_et_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {

    // Main module help for the google_analytics_et module.
    case 'help.page.google_analytics_et':
      $output = '';
      $output .= '<h3>' . t('About') . '</h3>';
      $output .= '<p>' . t('Allows configuration for tracking user interaction events with Google Analytics.') . '</p>';
      return $output;
    default:
  }
}

/**
 * Implements hook_page_attachments().
 */
function google_analytics_et_page_attachments(&$attachments) {

  // Add our effective JS attachments and settings (if any).
  \Drupal::service('google_analytics_event_tracking')
    ->addAttachments($attachments);
}