title: How to make onclick function execute only once?
body: <p>I have this code for Google analytics on a button. I need it to be executed only once, so that the user can't change statistics by pressing the button many times. I tried solutions from similar topics, but they don't work. Please help. This is my code.</p>
  
  <pre><code>&lt;script&gt;
      function klikaj(i) {
          gtag('event', 'first-4', {
              'event_category' : 'cat-4',
              'event_label' : 'site'
          });
      }
  
      document.body.addEventListener("click", klikaj(i), {once:true})
  &lt;/script&gt;
  
  
  &lt;div id="thumb0" class="thumbs" onclick="klikaj('rad1')"&gt;My button&lt;/div&gt;
  </code></pre>