Skip to content

Instantly share code, notes, and snippets.

@cstrouse
Created November 21, 2019 19:48
Show Gist options
  • Save cstrouse/e561cbb97083368cf8e1d0b1e41b71c2 to your computer and use it in GitHub Desktop.
Save cstrouse/e561cbb97083368cf8e1d0b1e41b71c2 to your computer and use it in GitHub Desktop.
If you're inserting Google Tag Manager's two code snippets into your Elementor site via hooks and the second one isn't showing up try this hook.
add_action('elementor/page_templates/header-footer/before_content', 'myprefix_google_tag_manager_no_js');
function myprefix_google_tag_manager_no_js() {
<!-- 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) -->
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment