@cstanhope To add to Max’s comment above, if you have a way to surface the current code environment in a Javascript variable, you can write some conditional logic to set the app ID dynamically, such as this:
<script type="text/javascript">
// The loader script (everything except the config block shown above) goes here
window.NREUM||(NREUM={}),__nr_require=function(t,e,n){
// … lots of code removed here for ease of viewing …
["firstbyte",a()],null,"api");var m=0},{}]},{},["loader",2,9,3]);
// End loader; begin conditional logic for config
var env = {YOUR ENVIRONMENT VARIABLE HERE};
var appID;
switch (env) {
case "production":
appID = "123456";
break;
case "staging":
appID = "4567890";
break;
case "dev":
appID = "654321";
}
// Config block with appID variable
;NREUM.info={beacon:"bam.nr-data.net",errorBeacon:"bam.nr-data.net",
licenseKey:"YOUR_LICENSE_KEY",applicationID:appID,sa:1,
agent:"js-agent.newrelic.com/nr-AGENT_VERSION.min.js"}
</script>
Note that there are placeholders for the license key and agent version in the config block at the bottom—these should be replaced with the values from your current copy/paste script.