Google analytics ,google ads manager, embedded codes

Hello, we’re customizing a unpublished theme, we just wanna know if we’re going to add the the google analytics embedded code and other codes relating to google is it before pushing the theme to live or after? we’re asking this because we just dont want to have these codes messed up the live theme which have these codes right now.

You’d want it done on the unpublished theme so you can test it before going live.