Last active
June 20, 2019 04:52
-
-
Save wplit/632785cb975dace8d9a96806a357d842 to your computer and use it in GitHub Desktop.
Call function that inserts google tag manager code just after opening body tag (for use with Oxygen & Duracell Tomi's Google Tag Manager for WordPress)
This file contains 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
add_action( 'plugins_loaded', 'lit_oxy_gtm' ); | |
function lit_oxy_gtm() { | |
if( class_exists( 'CT_Component' ) ) { | |
add_action( 'ct_before_builder', 'lit_add_gtm_tag' ); | |
} | |
} | |
/** | |
* Call function that inserts google tag manager code just after opening body tag | |
* See (https://wordpress.org/plugins/duracelltomi-google-tag-manager/) | |
*/ | |
function lit_add_gtm_tag() { | |
if ( function_exists( 'gtm4wp_the_gtm_tag' ) ) { | |
gtm4wp_the_gtm_tag(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment