Matomo and Google Ads

I want to use Matomo to distinguish the sources of access to the website. Can someone guide me how to set it up, I’m willing to pay the fee
For example, this script:

 <script>
  var _paq = window._paq = window._paq || [];
  var visitor_id;

  var searchParams = new URLSearchParams(window.location.search)
  var gclid = searchParams.get('gclid')
  if (gclid !== undefined && gclid != null && gclid !== "") _paq.push(['setCustomVariable', 1, 'gclid', gclid]);

  _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);

  (function () {
      var u = "https://socialslotsmagic.club/";
      _paq.push([function () { visitor_id = this.getVisitorId(); }]);
      _paq.push(['setTrackerUrl', u + 'matomo.php']);
      _paq.push(['setSiteId', '130']);
      var d = document, g = d.createElement("script"), s = d.getElementsByTagName("script")[0];
      g.type = "text/javascript"; g.async = true; g.defer = true; g.src = u + "matomo.php"; s.parentNode.insertBefore(g, s);
  })();
</script>