I use Metronet tag manager plugin to implement the GTM script.
But to make it load imminently and track correctly I need to add a row after the <body>
where is that located in PRO? And since this will fall back to default on every theme update I prefer both parent and child solutions.
My guess is that it’s the base.php? VIEWS/HEADER/BASE.PHP
<html class="no-js" <?php language_attributes(); ?>>
<head>
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php do_action( 'body_open' ); ?>
<div <?php echo $x_root_atts; ?>>
Plugin: https://wordpress.org/plugins/metronet-tag-manager/
Please note that for this plugin to work there is a slight customization that is needed. WordPress doesn’t let you load scripts straight after the opening tag which is where the GTM script needs to be placed to work correctly. To fix this you need to add
<?php do_action( 'body_open' ); ?>
just after the tag and that’s it.