virtualmin / virtualmin-google-analytics

Virtualmin plugin to insert analytics bugs and JavaScript into pages automatically using mod_perl
GNU General Public License v3.0
0 stars 0 forks source link

How to set the Google UA tracking code using the Virtualmin CLI #2

Open james-saucemedia opened 6 years ago

james-saucemedia commented 6 years ago

Hi,

Is it possible to be able to modify a virtual server's Google UA tracking code value using the virtualmin CLI?

I've discovered I can enable/disable the module for the virtualhost with:

#Enable
virtualmin enable-feature --virtualmin-google-analytics --domain example.com

#Disable
virtualmin disable-feature --virtualmin-google-analytics --domain example.com

But not found any reference to be able to set or modify the UA tracking code?

Any help would be much appreciated.

swelljoe commented 6 years ago

Unfortunately not. The CLI for this plugin is provided by the generic "enable-feature" command, which just knows how to enable features (and disable-feature knows how to disable them, obviously). I haven't used this module in about a decade, so I don't even know exactly where it generates configs, but I would guess that it produces a mod_perl script somewhere that can reasonably easily be modified with sed.

I doubt we'll be doing much more development on this module, as mod_perl is kind of deprecated and minimally maintained, and it has to happen at that sort of level (an Apache module) in order to work, since it has to modify content on its way out. Most web apps have analytics plugins that make it pretty easy to add tracking without needing an addition layer to modify the pages.