Virtualmin → Logs and Reports → Analytics Accounts
Content meant to be placed under head
section is getting placed under header
section instead.
For example, see source code for https://fb.sumu.uk
Virtualmin → Logs and Reports → Analytics Accounts
Content meant to be placed under head
section is getting placed under header
section instead.
For example, see source code for https://fb.sumu.uk
Thats for adding Javascript not css links, just had a read of the heading.
I would not use this plugin. Virtualmin should only be use to serve the website and not manipulate it. The plugin might not be maintained anymore.
I think I recommend against using this plugin. It depends on mod_perl, which is already a pretty ugly start. And, it hasn’t been maintained for a while; I don’t expect it to work with current versions of the analytics tools it supports, and I wouldn’t be surprised if it breaks other stuff.
We would have updated it if there were some good way to interact with various web apps and stuff, but there really isn’t. Apps need to do it themselves, basically, as it’s not generally safe for us to munge their output like this (even if there were good ways to do it other than mod_perl or some other Apache module).
Is your recommendation against just the javascript for head and body sections
part or for the whole analytics
plugin?
I think this answers the question
It was created in a time when there were still lots of websites that were just plain old HTML. Web apps ought to handle it themselves, and the vast majority of web apps have some kind of support for it, or you can insert the code into the header template or whatever. These days, every app downloads a gajillion lines of JavaScript before it even starts doing anything, and analytics is just another gajillion lines of JavaScript to download at the same time.
Also, back then, everybody was already bloating up Apache with mod_php and a bunch of other stuff, so adding mod_perl wasn’t that big of an extra ask (fun fact, PHP was originally written in Perl and ran in mod_perl). mod_perl is still actively maintained and I know lots of folks are still running it in production (I see it mentioned in Perl jobs listings all the time), but I wouldn’t want to build a new deployment that relies on it, even if I were deploying Perl web applications. It’s slightly less of a code smell than deploying with mod_php, but only slightly, and there are definitely better (more secure, probably lighter, probably faster) ways to run applications…the problem is none of those ways has any way to modify the HTML just as it’s being served by Apache (which is what the Virtualmin Analytics module does). It takes an Apache module to do that, and mod_perl is the easiest way for a Perl developer to make an Apache module.
But, your apps can do it themselves quite easily, in the vast majority of cases.
I see an option for GA and Piwik in the screenshot. This might let you append to the head quite easily. Even if you don’t use the plugin, you could manually integrate GA or Piwik to your website.
Piwik is now Motamo. It has a Tag Manager, as does Google Analytics. You could then use the Tag Manager to append to the header section of the html.
This solution does not involve Virtualmin at all, if you don’t use the plugin.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.