Copy/Paste Browser Setup across different Accounts


We want to use the copy-paste method in order to create a browser application for the same application in different New Relic accounts.

There is a similar issue described in this support ticket, which mentions we should only update the appId and the licenseKey in order for the script to work across different environments.

However, I can see in the generated script a few more details that I needs some clarifications for.

### Omitted the rest of the copy-pasted  script and went straight to the config part

NREUM.loader_config={" +
    "accountID:\"972812\"," +
    "trustKey:\"887712\"," +
    "agentID:\"25132376\"," +
    "licenseKey:\"5c41da8475\"," +
    "applicationID:\"25132376\"}\n;" +{beacon:\"\",errorBeacon:\"\"," +
    "licenseKey:\"5c41da8475\"," +
    "applicationID:\"25132376\"," +

I know that the previous threads mention the “” section of the configuration, however there is also the “NREUM.loader_config” part. The following properties worry me a bit:

  • trustKey: it seems this one does not change accross different envs.
  • agentID: different per account & application.
  • accountID: different per account.

Am I correct to assume that these properties (at least agent and account id) also need to be updated?

Hello @f.platon! These newer identifiers you are seeing were introduced with Distributed Tracing. Are you using distributed tracing in your application? I believe the agentID value may also depend on how the browser agent is being installed (copy/paste or APM injected by a language agent).

For extra context, I’d like to share a link to a description on this that is related in a community post here.

In general, we don’t advise editing the browser agent script block, however we realize many customers have success in using environmental variables in applications.

I hope this helps, though please let us know if anything else comes up!

So the question remains that while using different env do we need to change just the
NREUM.infoor do we need to change both + NREUM.loader_configconsidering I am NOT using distributed tracing

@adhikari.riya Newer versions of the browser agent have the new loader_config so yes, you’ll need to update both if you are using environment variables. Thanks for bringing this up!