I have a directory full of hundreds, if not thousands, of html and PHP files that I'm hosting for a client. They currently include no google analytics tracking tags, but we'd like to add them -- ideally without actually modifying the files themselves.
What's the best way to do this?
I'd imagine I'd want to redirect all requests for *.html files to a PHP script, and have that script return the content of the relevant file with analytics tags added. But that doesn't work as well for the PHP files -- I'd need apache to render the files normally, and then pass the output to my script.
Would mod_actions be helpful? Is mod_actions compatible with mod_php?