External PHP Hits/Month Counter

What would be the best way to implement a simple hits/month counter visible on each individual page? Pages are HTML and we need to call an external URL hosted on a different domain, along the lines of google analytics code that can be pasted into the HTML. Will an include or require be acceptable from a security perspective?

Is it PHP pages or HTML pages?
For the php you can use anything you want, including include. Nothing bad with security, if you include plain HTML file from your own site.
But PHP doesn’t work in HTML files.