Thats the correct hook. For the display rule choose Entire Site if you want everywhere covered.
The second script they provide which needs to be added after the opening body tag, you can do the same but use the before_header hook
GTM is really handy for managing your tags from the google console, instead of adding or changing codes in the site. There are lots of guides online about setting it up. Include “the right way” in your search, its easy to do but just as easy to get wrong.
For GP its just a case of hooking in the two scripts as mentioned above.