When adding Google tag script in WordPress site, functionality not working

Solution:

The script portion of the GTM container code is in the body of the page just before the closing </header> tag.

It needs to be installed in the <head></head> section of the site.

If you also choose use the optional noscript tag portion of the GTM container code, then the noscript tag should be immediately following the opening <body> tag.