Google analytics, or really any web site analytics software is an extremely important part of any successful website. It moitors all of the behavior of users to allow you to make smart data driven decisions to improve your site, such as a/b tests.

First you have to have a website up. Check out my tutorial on how to do that if you don't have one already

After you have a site, head over to Google Analytics and set up an account.

Fill out the required information and accept the TOS. It should take you to the screen with the javascript code on it.

Now, ssh into your website and edit the file `/var/www/html/wp-content/themes/{your theme}/functions.php`

Add this line to the bottom of the file, replacing the code with your own.
// Google Analytics
function google_analytics_include() {
    echo '<!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src=""></script>
        window.dataLayer = window.dataLayer || [];
        function gtag(){dataLayer.push(arguments);}
        gtag("js", new Date());

        gtag("config", "UA-58505998-1");
add_action('wp_head', 'google_analytics_include');

Now go to your site and check the developer's console to make sure the code is in it.

After you've verified it's there, you should be good to go! After a day or so, data should start to show up in the analytics dashboard.