function _google_tag_variable_info_general in GoogleTagManager 7.2
Same name and namespace in other branches
- 7 includes/variable.inc \_google_tag_variable_info_general()
Implements hook_variable_info().
File
- includes/
variable.inc, line 60 - 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['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,
),
);
$variables['weight'] = array(
'type' => 'select',
'type' => 'weight',
'title' => t('Weight', array(), $options),
'default' => 1,
);
return $variables;
}