The easiest way to add Google analytics tracking code in your WordPress website is by installing Google Analytics for WordPress plugin on your website.
The plugin is simple to install:
- Download analytics-for-wp.zip.
- Upload analytics-for-wp directory to your /wp-content/plugins directory.
- Go to the plugin menu page and activate the plugin.
- Add your Google Analytics Tracking code from the Anlytics for WP settings page as you can see in below screenshot.
Alternatively you can also add your tracking code by pasting just before the closing head in header.php file of active theme.