Tracking button clicks and events on Mixpanel

I want to track the click rates for all the buttons/ CTAs on my site. I wanted to know how I could track all button clicks on Mixpanel?

  1. Can I label each button as a separate event and track clicks on Mixpanel? how can I set up this integration?
  2. Is there any step by step documentation for this?
  3. Do I need a developer to set this up or can a non-dev set it up?

Here is a script I used on a site. I put this in the header of each page as they will be unique buttons on each page. Gave each button the unique ID. Tested and receiving events in mixpanel

  document.addEventListener("DOMContentLoaded", function() {
    // Replace "button1", "button2", etc., with the actual identifiers of your buttons
    document.getElementById("button1").addEventListener("click", function() {
      mixpanel.track("Button1 Clicked");

    document.getElementById("button2").addEventListener("click", function() {
      mixpanel.track("Button2 Clicked");

    document.getElementById("button3").addEventListener("click", function() {
      mixpanel.track("Button3 Clicked");

    document.getElementById("button4").addEventListener("click", function() {
      mixpanel.track("Button4 Clicked");