Tagged: Analytics, child theme, header.php
Hi there,
I would like to use a more advanced analytics tool in addition to Google’s. Most of the tools that I am interested to use require adding their SNIPPET/Code before </head>.
My question is: I am using a child theme ofcourse. What is the best way to do this since your child theme doesn’t come with header.php? Is it simply a matter of me copying the header.php to my child theme and append the snippet at the end??
BTW, I tried using Enfold > Google Services to add the code, but that doesn’t work.
Your urgent help, please.
Hey ZeyadElbaser,
Yes, you can copy header.php to your child theme and add it there. Or you can use a function in functions.php to add the code there instead, which might be easier:
function add_custom_code(){ ?>
YOUR SCRIPT GOES HERE
<?php }
add_action('wp_head', 'add_custom_code');
Best regards,
Rikard