Created
September 19, 2022 20:42
-
-
Save endurtech/5100a4d4807a144f78f45ec95702df3e to your computer and use it in GitHub Desktop.
Insert this code into the functions.php file within your WordPress Avada child-theme to inject any custom code into the beginning portion of your WordPress website just after the opening <body> tag.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Inserting a Script into Start of WordPress Avada Theme Body | |
// https://endurtech.com/insert-script-into-wordpress-body/ | |
add_action( 'avada_before_body_content', 'GA4TAGMGR' ); | |
function GA4TAGMGR() | |
{ | |
echo '<!-- Google Tag Manager (noscript) --> | |
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-YOURMEASURMENTIDHERE" height="0" width="0" style="display:none;visibility:hidden;"></iframe></noscript> | |
<!-- End Google Tag Manager (noscript) -->'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment