You are here

eloqua.module in Eloqua 8

Same filename and directory in other branches
  1. 6 eloqua.module
  2. 7.2 eloqua.module
  3. 7 eloqua.module

Eloqua Integration Module

This module provides Eloqua visitor tracking and some basic configuration.

@package Eloqua

File

eloqua.module
View source
<?php

/**
 * @file
 * Eloqua Integration Module
 *
 * This module provides Eloqua visitor tracking and some basic configuration.
 *
 * @package Eloqua
 */

/**
 * Implements hook_page_attachments().
 *
 * Sets site identifier and adds Eloqua tracking code.
 *
 * @see \Drupal\eloqua\EventSubscriber
 */
function eloqua_page_attachments(array &$page) {
  $config = \Drupal::config('eloqua.settings');
  $state = \Drupal::state()
    ->get('eloqua.condition_result') ?: 0;
  if (null !== $config
    ->get('site_identifier') && $state) {
    $page['#attached']['drupalSettings']['eloqua']['siteID'] = $config
      ->get('site_identifier');
    $page['#attached']['library'][] = 'eloqua/eloqua';
  }
}

Functions