WordPress add Google tag manager by function

PHOTO EMBED

Sat Mar 06 2021 03:42:11 GMT+0000 (Coordinated Universal Time)

Saved by @Rckflr #wordpress #google #tag #manager #function

add_action( 'wp_body_open', 'wpdoc_add_custom_body_open_code' );
 
function wpdoc_add_custom_body_open_code() {
    echo '<!-- Google Tag Manager (noscript) --> ... <!-- End Google Tag Manager (noscript) -->';
}
content_copyCOPY

Add the Google tag manager code under body tag by function

https://rckflr.com