Hello Lisa,
Thanks for asking.
You need to add the code in child theme function.php file. Before that I suggest you to install and activate child theme. You can use following resources to download and setup child theme.
Download Child theme from following source: https://theme.co/apex/child-themes
Please take a look at following article to setup child theme:
After that add following code in child theme function.php file to setup Google Analytics code.
function third_party_tracking_code() { ?>
<script>
// Google Analytics.
</script>
<?php }
add_action( 'wp_head', 'third_party_tracking_code' );
Replace // Google Analytics.
with the tracking code.
Thanks.