I’d like to place the Google ads code to my header.
<script data-ad-client="ca-pub-7290301843408108" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
What’s the best way of doing this? Header.php in my child theme? I don’t yet have a header.php in my child theme so should I just copy the above code in a new php file, name it header and ftp to my child theme? Or do I need to set up my header like this:
add_action('wp_head','custom_javascript');
function custom_javascript () { ?>
<script data-ad-client="ca-pub-7290301843408108" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<?php }