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. :)