Virtualmin Google Analytics module inserts tracking code in anything it thinks is HTML

Found a bug regarding the virtualmin google analytics module.

The module inserts the analytics tracking code into whatever it thinks is HTML even if it is not. For example, I distribute a software that I have developed for free. In the source code there are many HTML template strings inline, inside the source file. While transfering the files thru HTTP, the analytics code is inserted. Since the file has a checksum protection (it is a binary source file), the virtualmin additions make the file fail against the checksum and thus corrupt the download.

The module sees the templates flying around inside the apache response and adds the tracking code. Disabling the analytics module, made it all work again. I know the module is supposed to include the analytics tracking code into every html response but the case is that I am not sending HTML back, I am sending binary file to be used on the client machine and inside this binary file there are many HTML snippets. It's as if the module would insert code inside a a file inside a zipfile being transfered. Argh!

Can we have some filtering abilities for the analytics module, for example, only insert data if the request is for a HTML or CGI file or content-type: text/html or something...

Status: 
Closed (fixed)