No, the google analytics code should not be placed inside HTML head tags.
You have to place it anywhere between HTML body tags.
But the adviced places are, either after the opening body tag, or just before the closing body tag.
In Q2A -> Layout:
Add the code in either the custom HTML for headr or for footer