I’ll try to elaborate it in the simplest way on how to change HTTP to HTTPS in Google analytics. You are likely to be wondering will it have a negative effect on my website/blog.
You will not need to generate a new code and add it to your website/blog again. The old one will still be relevant but you will make a change or tweak to a setting in your analytics account which will not do any damage to your site

Login to your account and click on the admin or gear icon on the bottom left side of your dashboard
Click on property settings under Create property
Under Default URL, expand it to choose https:// option
Scroll down to the bottom of the page and click on the Save button
