Joomla\CMS\Factory::getApplication()->getDocument()->getWebAssetManager()->registerAndUseScript('plausible-io', 'https://plausible.io/js/script.js', [], ['defer' => true, 'data-domain' => \Joomla\CMS\Uri\Uri::getInstance()->getHost()], []);
Scratched my own itch. Thought it might be useful to you too.
Joomla\CMS\Factory::getApplication()->getDocument()->getWebAssetManager()->registerAndUseScript('plausible-io', 'https://plausible.io/js/script.js', [], ['defer' => true, 'data-domain' => \Joomla\CMS\Uri\Uri::getInstance()->getHost()], []);
This file should be placed in your/joomla/site/root/templates/your_template_name/html/mod_custom/onelinerplausibleio.php
It is a mod_custom
layout override.
The mod_custom module with this layout override should be in position debug
or equivalent.