To add Google Analytics code on your theme, you do not have to edit/customize the theme file.

Here is what you do:
1- Login to your Google Analytics account and copy your tracking code
2- Go to Theme Options – Extra inputs settings – Header script(s)
3- Paste the Google Analytics code and save settings

Insert Google Analytics