- 🇬🇧United Kingdom robcarr Perthshire, Scotland
nironan's suggestion at #3 has worked really well for me, although worth noting that the JS has to be executed in the footer for the
document.body.appendChild(scriptTag);
to work.I had to add Plausible to a D7 site (which only has a D8+ module), couldn't add the recommended snippet to the theme, so used the following JS executed inline in the footer (following provided to those landing here via a search listing):
var scriptTag = document.createElement('SCRIPT'); scriptTag.src = 'https://plausible.io/js/script.js'; scriptTag.dataset.domain = "MY DOMAIN"; scriptTag.async = true; scriptTag.defer = true; document.body.appendChild(scriptTag);