You are here

function _google_tag_data_layer_verify in GoogleTagManager 7

Same name and namespace in other branches
  1. 7.2 includes/form/container.inc \_google_tag_data_layer_verify()
  2. 7.2 includes/form/settings.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.

2 calls to _google_tag_data_layer_verify()
google_tag_settings_form_validate in includes/admin.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/admin.inc, line 394
Contains the administrative page and 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.');
  }
}