How do I add codes to theme such as google analytics?
Normally I would see an area for this in the theme customization.
You could use the plugin Insert Header and Footer to implement your GA Tracking code. Or any plugin such as the popular plugin : Monster Insight.
Max from the Sonaar.io Crew