Hi there,
Thanks for writing in! The best way is to setup a child theme first, and then you can add the following code into your child theme’s functions.php file. If you don’t have a child theme setup, please refer to our knowledge base section (https://community.theme.co/kb/how-to-setup-child-themes/).
function my_custom_google_tag_manager_code(){
?>
<!-- Replace this line with the code provided by Google Tag Manager -->
<?php
}
add_action( 'x_before_site_begin', 'my_custom_google_tag_manager_code' );
Hope that helps.