Adding environment check around analytics