I've been browsing the forums looking at guides / instructions for implementing Google Tag Manager to the latest version of X. I've tried following a bunch of different tutorials and they either don't work, are badly written, or seem to be outdated.
I'm currently running the latest version of X w/ a Child Theme setup. I've been trying to add code to my functions.php and it's partially working.
For Google Tag Manager, you need both a snippet of code in the Body and one in the Header. All the posts on these forums don't reference/address both of these. Here are the tags:
Paste this code as high in the <head> of the page as possible:
<!-- Google Tag Manager -->
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s),
<!-- End Google Tag Manager -->
Additionally, paste this code immediately after the opening <body> tag:
<!-- Google Tag Manager (noscript) -->
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
I tried following a couple guides and using what I could find in the forums but it doesn't appear to be working.
Framework.php for Child Theme: https://hastebin.com/ometisiyig.xml
_HEADER.php for the Child Theme: https://hastebin.com/izakawaxoy.cs
Any help would be appreciated!