Nick here from Shopify.
This is something which can be done from the main Shopify admin without the need to edit any code. If you go to the Shopify admin > Online Store > Preferences > Google Analytics there is a code linking your Shopify store to your Google analytics account. You can simply replace this code with the new updated Google Anlaytics code and account. Shopify has a helpful guide on setting up Google Analyitcs and linking it to your Shopify store which you can see here.
Hope this helps and guides you on how to do this. Any other questions just let us know.
Thank you for your reply.
I was actually intimidated by the step one in the guide that says:
Step 1: Make sure you don't have Google Analytics enabled already
Enabling Google Analytics more than once will result in inaccurate data.
Could you please confirm that this is not to worry about if I only change the UA- linking code?