Commit a528e647f2185628e8ded53d7497ece7897cbb62

Authored by Anastasia
1 parent ca4d9c90

google scripts

frontend/views/layouts/main.php
@@ -110,11 +110,11 @@ @@ -110,11 +110,11 @@
110 <?php $this->head() ?> 110 <?php $this->head() ?>
111 </head> 111 </head>
112 <body id="body"> 112 <body id="body">
  113 + <?php $this->beginBody() ?>
113 <!-- Google Tag Manager (noscript) --> 114 <!-- Google Tag Manager (noscript) -->
114 <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-N6R7982" 115 <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-N6R7982"
115 height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> 116 height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
116 <!-- End Google Tag Manager (noscript) --> 117 <!-- End Google Tag Manager (noscript) -->
117 - <?php $this->beginBody() ?>  
118 <div class="transition-loader"> 118 <div class="transition-loader">
119 <div class="transition-loader-inner"> 119 <div class="transition-loader-inner">
120 <label></label> 120 <label></label>
frontend/views/package/view.php
@@ -13,8 +13,7 @@ @@ -13,8 +13,7 @@
13 13
14 $js = <<<JS 14 $js = <<<JS
15 $(document).on('beforeSubmit', '#visit-form', function() { 15 $(document).on('beforeSubmit', '#visit-form', function() {
16 - window.dataLayer = window.dataLayer || [];  
17 - window.dataLayer.push({'event': 'formsend_package'}); 16 + dataLayer.push({'event': 'formsend_package'});
18 console.log('push'); 17 console.log('push');
19 return true; 18 return true;
20 }); 19 });
frontend/views/service/view.php
@@ -49,14 +49,12 @@ @@ -49,14 +49,12 @@
49 49
50 $js = <<<JS 50 $js = <<<JS
51 $(document).on('beforeSubmit', '#comment-form', function() { 51 $(document).on('beforeSubmit', '#comment-form', function() {
52 - window.dataLayer = window.dataLayer || [];  
53 dataLayer.push({'event': 'formsend_review'}); 52 dataLayer.push({'event': 'formsend_review'});
54 console.log('push'); 53 console.log('push');
55 return true; 54 return true;
56 }); 55 });
57 56
58 $(document).on('beforeSubmit', '#question-form', function() { 57 $(document).on('beforeSubmit', '#question-form', function() {
59 - window.dataLayer = window.dataLayer || [];  
60 dataLayer.push({'event': 'formsend_question'}); 58 dataLayer.push({'event': 'formsend_question'});
61 console.log('push'); 59 console.log('push');
62 return true; 60 return true;
@@ -64,7 +62,6 @@ $(document).on(&#39;beforeSubmit&#39;, &#39;#question-form&#39;, function() { @@ -64,7 +62,6 @@ $(document).on(&#39;beforeSubmit&#39;, &#39;#question-form&#39;, function() {
64 62
65 63
66 $(document).on('beforeSubmit', '#visit-form', function() { 64 $(document).on('beforeSubmit', '#visit-form', function() {
67 - window.dataLayer = window.dataLayer || [];  
68 var service_id = {$model->id}; 65 var service_id = {$model->id};
69 var parent_id = {$model->parent_id}; 66 var parent_id = {$model->parent_id};
70 if (service_id == 4 || parent_id == 4){ 67 if (service_id == 4 || parent_id == 4){
frontend/web/js/script.js
@@ -460,7 +460,6 @@ $(document).ready(function() { @@ -460,7 +460,6 @@ $(document).ready(function() {
460 var form = $(this); 460 var form = $(this);
461 var id = form.attr('id'); 461 var id = form.attr('id');
462 var url = form.attr('action'); 462 var url = form.attr('action');
463 - window.dataLayer = window.dataLayer || [];  
464 if (id == 'total_question_form'){ 463 if (id == 'total_question_form'){
465 dataLayer.push({'event': 'formsend_question'}); 464 dataLayer.push({'event': 'formsend_question'});
466 console.log('formsend_question'); 465 console.log('formsend_question');