Commit a528e647f2185628e8ded53d7497ece7897cbb62

Authored by Anastasia
1 parent ca4d9c90

google scripts

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