Go to https://www.google.com/analytics/

add Google analytics to magento

Click on sign up

add Google analytics to magento

Fill out your website details and click on get tracking id

add Google analytics to magento

Copy your tracking ID-

add Google analytics to magento

Now connect Google analytics to your magento site.

Go to System-> configuration

add Google analytics to magento

In the left panel, click on Google API

add Google analytics to magento

toggle Enable to yes and enter your GA id in the account number section

add Google analytics to magento

Thats it ! you have added Google analytics to your magento store successfully.