JSFiddle - React, Tailwind, and code Playground

HTML

<a href="#" id="contact_with_author" id-gtm="44559" class="send-message">
       Click to do something
</a>
<br/>
<a href="#" id="contact_with_author" id-gtm="66666" class="send-message">
       Click to do something2
</a>



<script
  src="https://code.jquery.com/jquery-3.3.1.min.js"
  integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
  crossorigin="anonymous"></script>
  
<script>
jQuery(document).ready(function(){
  $('.send-message').on('click', function () {
      let $el = $(this);
      let id = $el.attr('id-gtm');
      alert('id gtm: '+id);
      ga('create', 'UA-'+id+'-5', 'domain.ru');
  });
});
</script>