Add segment.io analytics

This is now, I think, the third place we're using the same test for whether we're production. Can we extract this into a function?