<script>
    (function (document, trackingId) {
        if (navigator.userAgent.indexOf('Google Page Speed Insights') === -1) {
            var gtagElement = document.createElement('script');
            var firstScriptElement = document.scripts[0];

            gtagElement.src = 'https://www.googletagmanager.com/gtag/js?id=' + trackingId;
            gtagElement.async = true;

            firstScriptElement.parentNode.insertBefore(gtagElement, firstScriptElement);

            window.dataLayer = window.dataLayer || [];

            function gtag() {
                dataLayer.push(arguments);
            }

            gtag('js', new Date());
            gtag('config', trackingId);
        }
    }(document, 'UA-108806299-1'));
</script>

<script>
    (function (document, trackingId) {
        if (navigator.userAgent.indexOf('Google Page Speed Insights') === -1) {
            var gtagElement = document.createElement('script');
            var firstScriptElement = document.scripts[0];

            gtagElement.src = 'https://www.googletagmanager.com/gtag/js?id=' + trackingId;
            gtagElement.async = true;

            firstScriptElement.parentNode.insertBefore(gtagElement, firstScriptElement);

            window.dataLayer = window.dataLayer || [];

            function gtag() {
                dataLayer.push(arguments);
            }

            gtag('js', new Date());
            gtag('config', trackingId, {
                'anonymize_ip': true
            });
        }
    }(document, 'UA-108806299-1'));
</script>

Configure GA with GDPR-compliant IP anonymization
Configure GA with GDPR-compliant IP anonymization