You can do it with AJAX – for each .tab-content, send via AJAX the ID (for example #tab-content-3). Now on the server receive the id and have a table of ids and add 1 each time.
Here you can find and update increment command – make sure to use something like this and not reading from DB and then updating, because this is not atomic and other users can “update” your tab count in between:
https://stackoverflow.com/questions/2259155/increment-value-in-mysql-update-query
A better approach though would be using Google Analytics. Assign an even to the tabs, and then you can view it all in GA – better than reinventing the wheel I guess (only if you don’t need the info back on the website, but just to have statistical information of course)
Related Posts:
- Count & Display Database Queries
- Post Views / Hit Counter Problem?
- Can’t connect to MySQL server on ‘127.0.0.1’ (10061) (2003)
- Keeping WP database synced across multiple developers using git
- Staging sites, how do you manage synchronising updates in the DB?
- How to get the post publish date outside the loop?
- Using transients in conjunction with memcached
- How to define composite keys with dbDelta()
- Has parent field in the table wp_term_taxonomy has term_id or term_taxonomy_id
- Forcing nickname as display_name in custom edit profile template
- Syncing local content with development / staging sites
- Export WP database for import using WP-CLI on Vagrant Box
- How to get site URL if database is disconnected?
- Showing content from another wordpress installation database in the page template loop?
- Multiple WP install with same users database
- Dynamic data in `wp_register_script` needed
- Why is $wpdb->get_results failing on certain tables but not others (which have data)?
- Using two different DB users on one WP install
- How to correctly add a table to the WordPress MySQL database
- Can I transfer a mysql database to another site?
- How to verify password outside WordPress?
- Weird issue with database migration and SSL links
- Is it safe to convert tables from MyISAM to InnoDB?
- How to use a different database to list and manage comments in the backend
- How do I properly update the WordPress database password?
- wpdb_prepare with multiple or condition
- $wpdb->insert is not working
- WordPress Install and Database on separate hosting?
- Moving a site from a temporary domain to the live domain [duplicate]
- Error establishing a database connection on Installation
- What is this in my tables
- Why is it that not all users have a ‘session_tokens’ meta_key record in the usermeta table?
- WP get stuck with a query on MySQL when the site is resumed
- Use mulitple usernames?
- Routine to convert custom post meta from old to new value
- Trying to change database tables storage engine to innodb gives error “invalid default value for ‘post_date'”
- database connection [closed]
- sanitize POST arrays
- WP character encoding error after sharing post on Facebook �
- Sending data with multi step form to wp database
- Able to use all admin pages but in the frontend there is a “Error establishing a database connection”-Error
- WordPress query is not returning proper results
- Need to store custom user information (many-many relationsips), preferably not as user meta
- charset problem with new custom table
- Undefined Variable: mysqli error when connecting to database
- Localhost to Staging to Development Dynamic WP-CONFIG
- Selectively restoring original posts from a compromised site to a freshly installed WordPress database
- can we add extra table or column in wordpress for adding our data
- Which data is written and stored in the database when read-only (non-posting, non-commenting) users visit the site?
- $wpdb is not initiating
- Duplicated site isn’t recognized as a site
- My options table is huge. What can I do?
- Changing root password in PHPMyAdmin for WordPress Database when going live
- Cannot restore wordpress database from sql dump [closed]
- WooCommerce: remove sample & dummy data
- multiple wordpress installation with shared usertable on an different database
- Is database deleted on clicking “reinstall” button in WordPress updates?
- wordpress database restore – broken link
- 6 random character prefix automatically added to entire DB tables, how / why? [closed]
- Insert Custom Data into wpusers
- How get Data form wordpress database as array not stdclass?
- cannot connect database
- How to delete a particular row in a database table
- Location of image metadata on my server
- How to create more than one new wpdb object?
- Connecting to wordpress database in my application [closed]
- Is it good practice to import/export a blog to test a redesign?
- Getting value from database table depending on field value
- Getting “Error Establishing a Database Connection” on localhost in new Mac OSX Lion environment
- Secure way to use name_save_pre?
- wpdb->insert not inserting first variable
- Database tables for sports betting integrated in WordPress
- change the year on all of my custom post types?
- WordPress keeps redirecting to localhost
- get value from ‘terms’ table
- custom tables in wordpress Database? (can i just create them with sql?)
- New installation fatal error in 5.9.3 at edit or create entry
- Storing transients giving database error
- I want to replicate a wordpress website over multiple servers
- Displaying requested data from a the database in wordpress
- Accidently changed the GUID
- Is there anyway to split posts to different databases?
- wp-cli + valet: “Error establishing a database connection”
- local wordpress broke after changing URL
- Unable to login to a https website via the app after changing from http
- Is it safe to add INDEX to a column in WordPress database?
- Help posting values to DB on submit using $wpdb->query
- Restore Old Database Over Newer WP & Plugin Files
- Not sure what to do next to optimize
- Database structure for thousands of posts
- How do I find out from my database what version of WordPress I need?
- How to create a database table?
- $wpdb not working
- Accessing content from third party as native posts in WordPress
- Extracted CSV as Array for Custom Query Loop
- Hang Up Followed By Can’t select database
- One WP Database outside localhost and two connections
- Fetch data from another site, but the same database
- Every time I update or install a plugin I get “Error Establishing a Database Connection in WordPress”
- Upload wordpress from localhost to 000webhost