You are here

function _google_tag_data_layer_verify in GoogleTagManager 7.2

Same name in this branch
  1. 7.2 includes/form/container.inc \_google_tag_data_layer_verify()
  2. 7.2 includes/form/settings.inc \_google_tag_data_layer_verify()
Same name and namespace in other branches
  1. 7 includes/admin.inc \_google_tag_data_layer_verify()

Verifies presence of dataLayer module and compares name of data layer.

Return value

bool|null Whether data layer name is incompatible with dataLayer module, if present.

3 calls to _google_tag_data_layer_verify()
google_tag_container_form_validate in includes/form/container.inc
Form validation handler for google_tag_container_form().
google_tag_settings_form_validate in includes/form/settings.inc
Form validation handler for google_tag_settings_form().
_google_tag_validate_data_layer in includes/variable.inc
Element validation handler for google_tag_data_layer.

File

includes/form/settings.inc, line 312
Contains the settings form callbacks.

Code

function _google_tag_data_layer_verify($value) {
  if (module_exists('datalayer') && $value != 'dataLayer') {

    // @todo Setting form error does not allow user to save a different name,
    // i.e. to do what message text says.
    return t('The 1.1 release of the dataLayer module does not support a data layer name other than "dataLayer." If you need a different layer name, then either disable the dataLayer module or alter the JavaScript added to the page response.');
  }
}