Google Analytics scripts
The easiest way to do this is in your admin dashboard under Extensions, Analytics, and Google Analytics (edit icon). You may need to click the install button first.
Although it says Google, you can place any scripts into the box you'd like. Make sure the status is set to enabled.