When I try to install analytics code to my website in header.php.
It gives me that error – Something went wrong. Your change may not have been saved. Please try again. There is also a chance that you may need to manually fix and upload the file over FTP.
Why you manually customize the theme code when you can use the plugin which easily helps you to add those code into your header? Anyways, remove your modified code and use this plugin to use google analytics into your site.