The Google Analytics Manager plugin for WordPress makes it easy to integrate your GA tracking code to every page and post on a WordPress site.
More information on the Google Analytics manager plugin is available at the WordPress Plugin repository.
Or if you’re using the wp-cli tool:
wp plugin install simple-google-analytics-manager
wp plugin activate simple-google-analytics-manager