The Google analytics code is a plugin territory. So, don’t make the mistake the put it via your theme. The last thing you need is to explain to your boss why the GA stopped working after a theme was changed our updated. TheUx Analytics is the plugin you need. It does one and just one thing, it puts your GA snippet on all your pages.
TheUx Analytics is based on the Single Responsibility Principle. Its does one think and do it well. And More:
TheUx is a premium and free serie of WordPress plugins. Along wiht our quality code, one of our signature is to be an unbranded plugin. No ads, no donation buttons, no backlinks, no lite version. TheUx serie use the standard WordPress UI and coding convention. It’s a real premium plugin for free.