add_action('wp_head', function() { ?>
<!-- Replace with your Google Analytics Code -->
<script async src='https://www.googletagmanager.com/gtag/js?id=YOUR-ID'></script>
<script>
	window.dataLayer = window.dataLayer || [];
	function gtag(){dataLayer.push(arguments);}
	gtag('js', new Date());
	gtag('config', 'YOUR-ID');
</script>
<?php });