Skip to content

Instantly share code, notes, and snippets.

Created December 18, 2019 08:04
What would you like to do?
Add GTM Code to WordPress Blog
//* Copy the above PHP opening tag if and only if your functions.php has a closing PHP tag
function add_gtm_head() { ?>
<!-- Paste Your GTM Header Code Here -->
<?php } add_action('wp_head','add_gtm_head',10);
function add_gtm_footer() { ?>
<!-- Paste Your GTM footer Code Here -->
<?php } add_action('wp_footer','add_gtm_footer',10);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment