You can put this in the <head> section:
<script> document.addEventListener("DOMContentLoaded", function(event) { var script = document.createElement("script"); script.innerHTML = "[GTM JS goes here]"; document.body.insertBefore(script, document.body.firstChild); }); </script>
Make sure you only place the part from the <script> from the GTM code in the illustrated placeholder.
source share