Temanın Functions.php dosyasına bunu eklersen, sitenin head kısmına alttaki echo kısmını ekleyecektir.
<?php
add_action("wp_enqueue_scripts", "my_theme_enqueue_styles", 11);
function my_theme_enqueue_styles()
{
wp_enqueue_style("child-style", get_stylesheet_uri());
}
add_action("wp_head", "header_code");
function header_code()
{
echo '<!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=xxxx"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag(\'js\', new Date()); gtag(\'config\', \'xxx\');</script>';
}