Hello @giovannihdgd
I hope you are doing well today, you can achieve this by adding the following code snippet on your theme’s functions.php or by creating a new PHP file and upload it to your website in wp-content/mu-plugins, this is the advisable method so create a new file maybe call it ‘count-visits-on-home-page.php’ then paste the following code:
/**
* Count visits on the homepage
*/
if ( is_home() && is_front_page() ) {
who_hit_the_page( "Home" );
}
save it and upload it to your website using FTP in the following location:
wp-content/mu-plugins/count-visits-on-home-page.php
Once you have that in place, please test and see if it works. If it does not work properly then please try to change the if (…) condition so that you have only
if (is_home()) {
...}
OR
if (is_front_page()){
...}
I hope this helps but please let me know if you have any issues.
Thanks