Getting a GA Account: If you don’t have an Analytics account, create one. If you do have an Analytics account, sign in. Both options are available at google.com/analytics
Setting up a property in your Analytics account: A property represents your website or app where the data gets aggregated.
Create a view: Views let you create filtered perspectives of your data. When you create a property one view is created by default. You can create multiple views based on the requirement and filter the reports based on the reporting structure.
Embed the Analytics in your website: Go to property > tracking info and get the tracking code which looks like below
<!-- Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXXX-Y', 'auto');
ga('send', 'pageview');
</script>
<!-- End Google Analytics -->
With these simple steps, your website will be ready to send the pageviews to GA.