Nick here from Shopify.
From what you have said it sounds like the error is because the Google Analytics snippet of code you have put in is either not valid or correct. Your best bet here might be to double check it is correct and maybe repeat the process to be sure. I took a look for you and found the guide Shopify has on this going through all the steps on this which you can see here.
Hopefully the guide can help you and get this right, but if you try again and it doesn't work, don't hesitate to let me know in a reply and we can take a closer look into why this might be happening.
All the best, Nick
|an hour ago|