If you have a website, you should have Google Analytics. It only starts tracking your site from the date you install it, so add it today so you won’t regret it tomorrow when you’re wanting to know more about your site visitors. Analytics are the only way to make smart decisions about your site.
If you don’t want to add another plugin to your site, (good for you!), then you can still add the Google Analytics tracking code manually.
In the footer.php or index.php file, find the </body> html tag
Copy and paste the Google Analytics code before the tag. The code will look something like this:
<script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-xxxxxxxx-x']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> Be sure you have a backup of the functions.php file before you make changes to it, and changes to PHP files should always be made through SFTP or your hosting's file manager. Mistakes in editing PHP files can cause your site to crash. Remember to change 'UA-xxxxxxxx-x' to your own code. Not sure where to get your code? Take a look at this. The only problem with the manual installation is that if you swap your WordPress themes you will loose your Google Analytics tracking, so be sure to move your code when you change themes.