You are here

function _google_tag_variable_info_general in GoogleTagManager 7

Same name and namespace in other branches
  1. 7.2 includes/variable.inc \_google_tag_variable_info_general()

Implements hook_variable_info().

File

includes/variable.inc, line 52
Contains the variable definitions.

Code

function _google_tag_variable_info_general($options) {

  // Gather data.
  $args = array(
    '@path' => 'https://tagmanager.google.com/',
  );
  $description = t('The ID assigned by Google Tag Manager (GTM) for this website container. To get a container ID, <a href="@path">sign up for GTM</a> and create a container for your website.', $args, $options);

  // Build variables.
  $variables['google_tag_container_id'] = array(
    'type' => 'string',
    'title' => t('Container ID', array(), $options),
    'description' => $description,
    'default' => '',
    'validate callback' => '_google_tag_validate_container_id',
    'element' => array(
      '#attributes' => array(
        'placeholder' => array(
          'GTM-xxxxxx',
        ),
      ),
      '#size' => 12,
      '#maxlength' => 15,
      '#required' => TRUE,
    ),
  );
  return $variables;
}