Add Google Analytics to WordPress Without a Plugin
Now that you have the Google Analytics Code installed in its correct place in your WordPress, you can delete the Google Analytics plugin, if you haven't already done so.
Your header.php file will look as shown below. Of course it will display your own unique Google Analytics ID [UA-xxxxxx-x]:
Save the header.php file.
Check that your website is still working correctly.
Go back to the Google Analytics Tracking Code page and click on the button "Send test traffic" to test that the Tracking Code you inserted is working. If it is then the job is done. If it isn't then start from the beginning and check all the steps again.
If the Tracking Code still is not working, then another problem is at play. If so, I would remove the tracking code from the header.php file, save the file and then install a simple Google Analytics plugin. After you have activated the plugin, enter your unique Tracking ID and go back to your Google Analytics Tracking Code page and use the Send test traffic button again.
If you still cannot get Google Analytics to work then drop me a line via Wealthy Affiliate and I'll try to help you out.