Google Tag Manager XTheme

Hi,
I have a problem setting my Google Tag Manager account: as the support told me I’ve installed the Child Theme.

Then I’ve edited the function.php file in the child theme section putting the code Google gave me under the existing code in this way:

add_action(‘wp_head’, ‘add_header_code’);
function add_header_code(){
?>

<?php }; But this only covers the head part. Where do I put the code I've to insert immediately after the open tag? Thank you, Valentina

Hey Valentina,

Please try:


// Add Script to Body
// =============================================================================
function add_script_to_body(){
?>

<!-- Insert Code Here -->


<!-- Insert Code Here -->

<?php 
}
add_action( 'x_after_body_begin', 'add_script_to_body' );
// =============================================================================

Hope this helps.

Hi Jade!
In the same file (functions.php)?

Hi Valentina,

Yes, Please install and activate the child theme and login through FTP then add it to the functions.php file.

Hope this helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.