Hi friend,
I found an example of this method.
https://www.kavoir.com/2010/05/simplest-php-hit-counter-or-download-counter-count-the-number-of-times-of-access-visits-or-downloads.html
In the example it uses a txt file to store the counter number, but you can use an update_field ($ selector, $ value, [$ post_id]);
greetings