Hi Ismael,
You gave me this code snippet to move the GA4 tracking code to the WP head, however, after implementing it GA tracking no longer works. Could you please investigate?
function ava_move_tracking_code_to_head() {
remove_action( 'wp_footer', 'avia_print_tracking_code', 10000 );
add_action( 'wp_head', 'avia_print_tracking_code', 10 );
}
add_action( 'init', 'ava_move_tracking_code_to_head', 20 );
Hey dburton77,
Thank you for the update.
We may need to access the site to properly check the issue. We didn’t find any site information in the previous thread.
— https://kriesi.at/support/topic/google-analytics-loaded-in-footer/
You can remove the code to relocate the tracking script to the footer, which is the default placement.
Best regards,
Ismael