Plain365 replaces the need of this solution
It's a free tool allowing you to configure GoogleAnalytics on multiple sites at once and there is no dependency on Sandbox solutions, apps or add-ins. It works with Office 365 and SharePoint_
Project Description - Obsolete
This solution allows you to install the Google Analytics code on all sites inside a SharePoint 2013 / Office 365 site collection.
By installing this sandbox solution, you can paste and add automatically the Google Analytics code to all your Office 365 sites. It works together with Office 365 publishing sites and also with Office 365 collaboration sites (team sites, blogs, etc.)
The latest release supports SharePoint 2013 or SharePoint 2010 on Office 365.
More on Twitter: https://twitter.com/adrianfiechter