Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #273741

    Currently, the GA script is included in the BODY. For certain purposes (e.g. google webmaster validation) the GA script needs to be included in the HEAD instead. How can I move the GA script to be included in the HEAD instead of the BODY?

    #273764

    Hey fortuneRice!

    Insert this code into the child theme functions.php file:

    
    add_action('after_setup_theme','avia_move_google_analytics');
    function avia_move_google_analytics(){
    remove_action('wp_footer', 'avia_print_tracking_code');
    add_action('wp_head', 'avia_print_tracking_code');
    }
    

    Regards,
    Peter

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.