title: Count how many times a user clicked to a button in WordPress
body: <p>I need to count how many times a user clicked a specific button, for example:</p>
  
  <pre><code>&lt;a id="download" href="#"&gt;Download&lt;/a&gt;
  </code></pre>
  
  <p>What´s best practice here? I think about to create a completely new database table and increment the value each time a user clicks on the button.</p>
  
  <pre><code>function countClicks() {
   global $wpdb;
   $charset_collate = $wpdb-&gt;get_charset_collate();
   require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
  
   //* Create the teams table
   $table_name = $wpdb-&gt;prefix . 'count_clicks';
   $sql = "CREATE TABLE $table_name (
   click_id INTEGER NOT NULL AUTO_INCREMENT,
   click_number INTEGER NOT NULL,
   PRIMARY KEY (click_id)
   ) $charset_collate;";
   dbDelta( $sql );
  }
  </code></pre>
  
  <p>Do you have better solutions for this instead of creating a fresh new table?
  Btw: It´s a WordPress website.</p>