How To Properly Add Google Tag Manager Code
// Add Google Tag Manager Code after opening body tag
add_action( 'wp_body_open', function() { ?>
YOUR CODE HERE
<?php } );
All PHP snippets should be added via child theme's functions.php file or via a plugin (we recommend Code Snippets)