When I copy a block like this in Sublime Text and replace the exact same block on a other page with this block (only the tag code is different) you never know where the block gets placed despite the fact that is was precisely copied and pixel precise paste. It moves to the left or right and is very annoying. This is the case for any code block you copy since I ever used Sublime Text. many many years!
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXX', {'page_path': location.href.replace(location.origin, "") });
</script>