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 | 1 | $(function() { |
| 2 | 2 | var clicked = null; |
| 3 | - | |
| 3 | + var btn1=null; | |
| 4 | 4 | $(document) |
| 5 | 5 | .on('click', '.modal-link', function() { |
| 6 | 6 | console.log('clicked'); |
| ... | ... | @@ -10,19 +10,30 @@ $(function() { |
| 10 | 10 | |
| 11 | 11 | $(document) |
| 12 | 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 | 17 | $(document) |
| 17 | 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 | 24 | $(document) |
| 23 | 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 | 40 | \ No newline at end of file | ... | ... |