Skip to content

Instantly share code, notes, and snippets.

@jamesmthornton
Last active August 23, 2019 14:31
Show Gist options
  • Save jamesmthornton/d1a91e82074f622fa0802697d086300b to your computer and use it in GitHub Desktop.
Save jamesmthornton/d1a91e82074f622fa0802697d086300b to your computer and use it in GitHub Desktop.
How to add second script for Google Tag Manager to Genesis on Wordpress (after opening body tag)
//* add Google Tag Manager after opening body tag for genesis on wordpress (part 2)
add_action( 'genesis_before', 'add_custom_google_tag_manager_2', 1 );
function add_custom_google_tag_manager_2() {
//* replace XXXXXXX with your GTM tracking ID
?>
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXXXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
<?php
}
@jamesmthornton
Copy link
Author

update priority to prevent non-standard implementation notice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment