This is turning out to be much more challenging than I expected.
There is a Google Analytics Integration extension:
But for the Global Site Tag version of Google Analytics, it refers you to the HeadScript extension:
The problem here is the download link (http://downloads.jingames.net/mediawiki/HeadScript.zip) looks a bit dodgy and the documentation mentions a bug.
I've also reviewed this discussion on the Mediawiki site:
But it's a lot of telling and not much showing.
The Google Analytics snippet looks like this:
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=TRACKING_ID"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'TRACKING_ID');
</script>
I would prefer to insert it by updating a setting in LocalSettings.php config file.
Thanks!