There are many different ways to setup Google Analytics in WordPress. The easiest way is to install a plugin. We recommend using: https://wordpress.org/plugins/google-analytics-for-wordpress/
MonsterInsights is the most popular Google Analytics plugin for WordPress. Over 1 million websites use it including the likes of Bloomberg, PlayStation, Zillow, and more.
It is the easiest and by far the best way to add Google Analytics to WordPress (for all users beginners and experts).