I’ve tried connecting google analytics with Hooks, but it’s not working.
I’ve tried with this method that I found
Go to Appearance > Elements and click “Add New”. From the Element dropdown list, choose “Hook”.
Copy and paste the your own code into the content area.
Under Settings tab, select wp_head in the Hook dropdown list.
Under Display Rules tab, select Entire Site in the Location dropdown list.
Click the Publish button then we are half way done.
However, I did not use the last method as I am not using tag manager, just analytics/