From the back-end of your site, go to Extensions >> Template Manager.

Open the template style setting panel of the template

Now please open tab Custom Code then add the Google Analytic Code to the field Before .