Quick question for you guys. I’m currently adding Google Tag Manager code to my site, and I need to add two snippets of code – one in the <head> of every page, and one immediately after the opening <body> tag.
I’m pretty sure I can use webhooks to add the code into the <head> of every page by using wp_head on every page with a position of 2 (so it’s below my GA tag). However, I’m not quite sure how to use a webhook to add the second bit of code right after the opening <body> tag. Is it possible to do this with a webhook?
Also, I’m assuming I need to put the Google Tag Manager code in the <head> below my GA tag for Google Analytics?
Thanks as always! I’ve included the two snippets of code below for reference.
Paste this code as high in the <head> of the page as possible on every page:
<!– 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: