Step 1: Log in to your Google Analytics account, click Admin, click Tracking Info, and then click Tracking Code. Copy the entire text in the tracking code box, including the starting <script> tag and the ending </script> tag.
Step 2: Log in to WordPress as the administrator.
Step 3: Under Dashboard, click Appearance, and then click Editor. The Edit Themes page appears.
Step 4: Under Templates, click Header (header.php).
Step 5: Locate the ending </head> tag. Just above the </head> tag, paste the Tracking ID code snippet from Google Analytics that you obtained in step 1.
Step 6: Click Update File. Google Analytics is now enabled for all pages on your WordPress site.
Note : It can take up to 24 hours for Google Analytics to change its status from Tracking Not Installed to Receiving Data.