Site logo

[Resolved] Adding GTM code

Home Forums Support [Resolved] Adding GTM code

Home Forums Support Adding GTM code

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1099723
    _blank

    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.

    #1099737
    _blank

    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

    #1099738
    David
    Staff
    Customer Support

    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.

    #1099913
    _blank

    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..!!

    #1099948
    David
    Staff
    Customer Support

    Glad to be of help.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.