htmlwebhitcounter

Hidden web hit counter


I would like to know how can I implement a hidden hit counter. I want to do this because I want to have an raspberry pi project were a light goes on every time the website get a hit, but I don't want to show the counter on the website.


Solution

  • It is a website right? Then you can simply have the counter inside a div like this:

    <div class="hitcounter"></div>
    

    And hide it using CSS:

    .hitcounter {display: none;}
    

    This way, the counter will be present in the DOM and it won't be visible in the viewport. :)