adding google analytics to header in Magazine theme

I would like to add Google Analytics script to my website. I'm using the latest version of Wordpress multisites, Buddypress and Buddypress Magazine Theme.

I don't want to use the plugin. I just want to add the script to my theme. Where do I add the script? In the header.php at the bottom? Google suggest adding just before the closing </head> but when I view the header.php there is no closing </head>. Please advise