Hello
What would be the best way to add code to the <head> and <body> sections? Please see private content –
Thanks
B
Hey schwabino,
I would wrap your code in this and add this code to the end of your child theme functions.php file in Appearance ▸ Editor:
function custom_script() { ?>
<script>
//your code here
</script>
<?php
}
add_action( 'wp_head', 'custom_script', 99 );
Best regards,
Mike
Hi,
If you are not using a child theme you could use the WP Code plugin then add a new snippet, in the top right corner use the PHP snippet as the code type:
then add the code and save.
Best regards,
Mike
Hi,
Thank you for the update.
then added the code where you told me too – but then it says this?
What does it say? Do you get any errors? Please provide a screenshot or provide the site URL in the private field. The link below should help.
// https://www.analyticsmania.com/post/how-to-check-if-google-tag-manager-is-working/
Best regards,
Ismael