Last active
August 9, 2016 06:42
-
-
Save kohiomobz/7598c0df81582f5ff4cc to your computer and use it in GitHub Desktop.
Keeping Production Data Clear
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var productionHost = 'Your production Domain'; /* www.mixpanel.com */ | |
var devToken = 'Development Token'; | |
var prodToken = 'Production Token'; | |
/* If the hostname is anything other than your production domain, initialize the Mixpanel library with your Development Token */ | |
if (window.location.hostname.toLowerCase().search(productionHost) < 0) { | |
mixpanel.init(devToken); | |
} else { | |
mixpanel.init(prodToken); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
that should be "window.location.hostname" with lowercase "n"