Add an Analytic code in your WordPress is quite easy. There are two major methods exist, one is manually add code before closing
</body> tag, you also can add GA code in your WordPress
footer.php file before closing
Secondly, via using WordPress plugin Google Analytic by Yoast. Personally I would recommend you to utilize second method because via this plugin you can even track website particular labels like download links, affiliate links, user activities in depth. Hopefully, the answered is your question.