Yes, it’s possible but before we take expression at why adding Google Analytics to your site without a plugin may not be the best for your site.
• Not as easy: Adding Google Analytics to your site without a plugin is not as easy as with a plugin.
• You may lose tracking code: When you switch your themes, you may forget to add the Analytics tracking code again to your new theme. In the period of time before you add your tracking code again, your visitors won’t be tracked. With a plugin, you won’t miss out on that data.
• You miss powerful Analytics features: You’ll miss powerful features like events tracking