How to embed google tracking code for a form button?

One option is to add some code to your page settings and give your button a corresponding Id.

document.getElementById('yourButtonId').addEventListener('click',(event) => { 
  return gtag_report_conversion('http://example.com/your-link'
}