You are here

function _analytics_google_validate_id in Analytics 7

2 string references to '_analytics_google_validate_id'
GoogleAnalyticsGaService::buildConfigurationForm in analytics_google/src/GoogleAnalyticsGaService.php
Form constructor.
GoogleUniversalAnalyticsService::buildConfigurationForm in analytics_google/src/GoogleUniversalAnalyticsService.php
Form constructor.

File

analytics_google/analytics_google.module, line 60

Code

function _analytics_google_validate_id($element, &$form_state) {
  $value = $element['#value'];
  if ($value == '') {
    return;
  }
  elseif (!preg_match('/^UA\\-\\d+\\-\\d+$/', $value)) {
    form_error($element, t('%name is not in a valid format.', array(
      '%name' => $element['#title'],
    )));
  }
}