gancio-upstream/docs/usage/custom_js.md
2024-10-01 09:27:23 +02:00

1.3 KiB

layout title permalink nav_order parent
default Custom Javascript /usage/custom_js 3 Usage

Custom Javascript Since 1.19.0 BETA

You can integrate some javascript code that will be loaded for each user in Admin > Theme > Custom JS

Don't imagine you can accomplish miracles because the templates are not designed to be easily modified, but don't be afraid to open an issue or even better a PR to add some usage examples to this page.

Examples:

Integrate Plausible (https://plausible.io/)

var script = document.createElement('script');
script.defer = true;
script.src = "https://plausible.io/js/script.js";
script.dataset.domain = "yourdomain.com";

document.getElementsByTagName('head')[0].appendChild(script);

Integrate Umami (https://umami.is/)

var el = document.createElement('script');
el.setAttribute('src', 'http://mywebsite.com/umami.js');
el.setAttribute('data-website-id', 'your-website-id-string-of-numbers');
document.body.appendChild(el);

info "References" #413, #320, #467