How to track Webflow Form with Facebook (Pixel) and Google Analytics

@PhiBli

I tried the following code …

<script>
  $(document).ready(function() {
    $(document).on('click', '[data-gatrack]', function(e) {
      var $link = $(this);
      var trackData = $link.data('gatrack');
      if (!trackData) { return; }
    
      var trackParams = ['send', 'event'].concat(trackData.split(','));
        ga(trackParams);
      });
  });
</script>

… but it did not work.

Any ideas how to set up tracking “onClick”?