Commit 6976ddffac80469c3f7e421edd10a8a3757e6713
1 parent
5ca433ff
push events
Showing
1 changed file
with
18 additions
and
7 deletions
Show diff stats
frontend/web/js/events.js
| 1 | $(function() { | 1 | $(function() { |
| 2 | var clicked = null; | 2 | var clicked = null; |
| 3 | - | 3 | + var btn1=null; |
| 4 | $(document) | 4 | $(document) |
| 5 | .on('click', '.modal-link', function() { | 5 | .on('click', '.modal-link', function() { |
| 6 | console.log('clicked'); | 6 | console.log('clicked'); |
| @@ -10,19 +10,30 @@ $(function() { | @@ -10,19 +10,30 @@ $(function() { | ||
| 10 | 10 | ||
| 11 | $(document) | 11 | $(document) |
| 12 | .on('submit', '.section-forms #contact-form', function(e) { | 12 | .on('submit', '.section-forms #contact-form', function(e) { |
| 13 | - console.log('Form from page'); | 13 | + // console.log('Form from page'); |
| 14 | + dataLayer.push({'event': 'formsend_send'}); | ||
| 14 | }); | 15 | }); |
| 15 | 16 | ||
| 16 | $(document) | 17 | $(document) |
| 17 | .on('submit', '#callback #contact-form', function(e) { | 18 | .on('submit', '#callback #contact-form', function(e) { |
| 18 | - console.log('Call me maby'); | ||
| 19 | - console.log(clicked); | 19 | + // console.log('Call me maby'); |
| 20 | + dataLayer.push({'event': 'formsend_callback'}); | ||
| 21 | + // console.log(clicked); | ||
| 20 | }); | 22 | }); |
| 21 | 23 | ||
| 22 | $(document) | 24 | $(document) |
| 23 | .on('submit', '#buy-form #contact-form', function(e) { | 25 | .on('submit', '#buy-form #contact-form', function(e) { |
| 24 | - console.log('Hello from buy form'); | ||
| 25 | - console.log(clicked); | 26 | + // console.log('Hello from buy form'); |
| 27 | + if(btn1=='buy1') | ||
| 28 | + { | ||
| 29 | + dataLayer.push({'event': 'formsend_order1'}); | ||
| 30 | + } | ||
| 31 | + else { | ||
| 32 | + dataLayer.push({'event': 'formsend_order2'}); | ||
| 33 | + } | ||
| 34 | + // console.log(clicked); | ||
| 26 | }); | 35 | }); |
| 27 | - | 36 | + $('.modal-link').on('click',function () { |
| 37 | + btn1=(this.dataset.event); | ||
| 38 | + }) | ||
| 28 | }); | 39 | }); |
| 29 | \ No newline at end of file | 40 | \ No newline at end of file |