title: How to insert Analytics events inside script tag
body: <p>I have a Wordpress site and I activated a WhatsApp chat plugin. I want to track when people click on that button, but I don't know hot to insert the:</p>
  
  <pre><code>ga('send', 'event', [eventCategory], [eventAction], [eventLabel], [eventValue], [fieldsObject]);
  </code></pre>
  
  <p>Inside the code of the plugin:</p>
  
  <pre><code>&lt;!-- WhatsHelp.io widget --&gt;
  &lt;script type="text/javascript"&gt;
      (function () {
          var options = {
              whatsapp: "+XXXXXXXXX", // WhatsApp number
              company_logo_url: "//example.com", // URL of company logo (png, jpg, gif)
              greeting_message: "xxxxx", // Text of greeting message
              call_to_action: "xxxxx", // Call to action
              position: "right", // Position may be 'right' or 'left'
          };
          var proto = document.location.protocol, host = "whatshelp.io", url = proto + "//static." + host;
          var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = url + '/widget-send-button/js/init.js';
          s.onload = function () { WhWidgetSendButton.init(host, proto, options); };
          var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x);
      })();
  &lt;/script&gt;
  &lt;!-- /WhatsHelp.io widget --&gt;
  </code></pre>
  
  <p>I tried putting this line:</p>
  
  <pre><code>s.onclick = function () { ga('send', 'event', 'WhatsApp', 'whatsappclick'); };
  </code></pre>
  
  <p>But doesn't works.</p>
  
  <p>Thanks!</p>