Hello please know to enable the google analytics we have to follow the below steps.
Step-1: Login to your admin panel.
Step-2: Go to Extension -> Analytics please screenshot below.
Step-3: Here at the right side you will see a pencil button to edit. click on edit.
Step-4: Now you have to add the script in Google Analytics Code please copy and paste the below script in here.
<!-- 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', 'Your Code', 'auto');
ga('send', 'pageview');
</script>
<!-- End Google Analytics -->
Step5: Your code should be placed in ga('create', 'Your Code', 'auto'); this line.
Step-6: Now Select Enable nd save it
Add your valuable comments, so others can read.