Hi,
Add Google analytic Tracking Code to the header.php file
1. Log in to your WordPress dashboard and navigate to Appearance ยป Editor.
2. Now click the header.php file on the right-hand side below the Templates section.
3. Paste the tracking code you just copied from your Analytics profile before the closing tag.
Please check the link
https://www.monsterinsights.com/how-to-add-google-analytics-to-wordpress-without-a-plugin/
Regards
Grace Themes