Add Privatus Analytics to Grav
Add cookieless analytics to a Grav site with one snippet in your theme's base.html.twig head block, with no cookies and no consent banner.
Grav themes build the page in templates/partials/base.html.twig. Add the
snippet inside the <head> of that file:
twig
<script defer src="https://privatusstats.com/js/pa.js" data-site="pa_YOURSITEID" data-modules="engage,auto,vitals,clicks,ask"></script>
Edit a child theme or copy the file into your own theme, because updates to
a theme overwrite changes made in it. Clear the cache afterward with
bin/grav clearcache.
Grav's Asset Manager can add the file too (assets.addJs), and Grav renders
unknown options as attributes. A literal tag in the template is simpler and
keeps the data- attributes obvious.
Grav serves full pages, so each page view is counted once. Add other options as attributes.