Archived topic
Adding GTM code
4 replies · Started by _blank on December 10, 2019
i followed this guide https://docs.generatepress.com/article/implement-google-tag-manager/
But the option "Priority" was not written in the guide.
What i am supposed to do with it? what Priority should i give in this case.
Also after installing GTM Successfully using https://docs.generatepress.com/article/implement-google-tag-manager/
when i tried to Verify my site in Search console through "GTM" i got this method- Failure reason:
The Google Tag Manager snippet on your site is in the wrong location on the page. Learn more
Hi there,
For the first GTM code that is added to the <head> the priority doesn't matter.
For the second piece of code the guide states you should use a Priority of 0, which will place it as the first element inside the <body> tag.
However, since WP 5.2 you can now choose the wp_open_body hook, which will place it immediatly after the opening <body> tag.
Yeah i changed the hook from (before_header) to (wp_open_body) and now it worked. Now the Search console got varified through GTM.
Thanks a Bunch..!!
Glad to be of help.