Commit e5df3e27 authored by Anton P's avatar Anton P
Browse files

added Google Analitycs targets

parent 31645b67
...@@ -7,7 +7,7 @@ use Drupal\Core\Form\FormStateInterface; ...@@ -7,7 +7,7 @@ use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Ajax\HtmlCommand; use Drupal\Core\Ajax\HtmlCommand;
/** /**
* FormContactMessageFormAlter. * AjaxContactForm.
*/ */
class FormContactMessageFormAlter extends ControllerBase { class FormContactMessageFormAlter extends ControllerBase {
...@@ -83,6 +83,11 @@ class FormContactMessageFormAlter extends ControllerBase { ...@@ -83,6 +83,11 @@ class FormContactMessageFormAlter extends ControllerBase {
$myScript .= 'console.log("' . $formId . '");'; $myScript .= 'console.log("' . $formId . '");';
} }
$myScript .= '</script>'; $myScript .= '</script>';
$myScript .= '<script type="text/javascript">';
$myScript .= "if (typeof dataLayer != 'undefined') {dataLayer.push({'event': '" . $goals[$formId] . "'});}";
$myScript .= '</script>';
$response->addCommand(new HtmlCommand('#synapse-custom-ajax-cover', $myScript)); $response->addCommand(new HtmlCommand('#synapse-custom-ajax-cover', $myScript));
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment