Blame view

frontend/web/js/events.js 1.12 KB
3e1029f0   Alexey Boroda   -Events pushing j...
1
  $(function() {
bc2c1a08   Alexey Boroda   -Added some data ...
2
      var clicked = null;
6976ddff   alex   push events
3
      var btn1=null;
bc2c1a08   Alexey Boroda   -Added some data ...
4
5
      $(document)
          .on('click', '.modal-link', function() {
68bce13d   Alexey Boroda   -Added some data ...
6
              console.log('clicked');
bc2c1a08   Alexey Boroda   -Added some data ...
7
8
9
10
11
12
              clicked = $(this)
                  .data('event');
          });
  
      $(document)
          .on('submit', '.section-forms #contact-form', function(e) {
6976ddff   alex   push events
13
14
              // console.log('Form from page');
              dataLayer.push({'event': 'formsend_send'});
bc2c1a08   Alexey Boroda   -Added some data ...
15
16
17
18
          });
  
      $(document)
          .on('submit', '#callback #contact-form', function(e) {
6976ddff   alex   push events
19
20
21
              // console.log('Call me maby');
              dataLayer.push({'event': 'formsend_callback'});
              // console.log(clicked);
bc2c1a08   Alexey Boroda   -Added some data ...
22
23
24
25
          });
  
      $(document)
          .on('submit', '#buy-form #contact-form', function(e) {
6976ddff   alex   push events
26
27
28
29
30
31
32
33
34
              // console.log('Hello from buy form');
              if(btn1=='buy1')
              {
                  dataLayer.push({'event': 'formsend_order1'});
              }
              else {
                  dataLayer.push({'event': 'formsend_order2'});
              }
              // console.log(clicked);
bc2c1a08   Alexey Boroda   -Added some data ...
35
          });
6976ddff   alex   push events
36
37
38
      $('.modal-link').on('click',function () {
          btn1=(this.dataset.event);
      })
3e1029f0   Alexey Boroda   -Events pushing j...
39
  });