Most simple way to add Google Analytics tracking code to a WordPress site

Let’s assume that you did not use Google Analytics previously and you just want to quickly install it without plugins and advanced features. Maybe you don’t need advanced features or you are just learning.

I will assume that you know how to get Google Analytics tracking code, but if not, it is in the Property Settings, Tracking info section, under Admin panel:

Now when you have your code, the most simple way to add it to the website is to use functions.php file. Add this code to your functions.php theme file:

Of course, I removed my Google Analytics ID but you will get yours when copying the code.

Leave a Reply

Your email address will not be published. Required fields are marked *