Skip to content

Instantly share code, notes, and snippets.

View ryandemmer's full-sized avatar

Ryan Demmer ryandemmer

View GitHub Profile

One-liner to use plausible.io Web Analytics on your Joomla Website

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()], []);

WHY

Scratched my own itch. Thought it might be useful to you too.