A plugin to SalesForce Commerce Cloud (aka SFCC aka Demandware) that adds the New Relic Browser Javascript snippet to the header of every SFCC Site page.
- Clone this repository
- Install the project's dependencies by running
npm install
in the repository root folder.
- Edit
package.json
, modifypaths.base
property to point to your localapp_storefront_base
cartridge.- You can find the Store Front Reference Architecture here if you don't have it.
- Open the New Relic Browser UI and click the
(+) Add More
button in the top-right corner.- If you have access to multiple acccounts, be sure to choose the account you want to deploy to from the pull-down menu.
- In the "Get started with New Relic Browser" page, choose the following:
- Deployment Method:
Copy/Paste Javascript code
method. - Instrumentation: 'Pro' (recommended) or 'Lite' Instrumentation.
- SFCC sites are not Single-Page Apps (as of the writing of this README), so using 'Pro + SPA' will cause the wrong dashboards to appear in the UI.
- Name your app: choose "No. (Name your standalone app)" and name it however you like.
- Do not associate it with an existing APM application, as this will have unintended consequences in the UI!
- Deployment Method:
- Replace the contents of
cartridges/plugin_newrelic_browser/cartridge/client/default/js/nr-agent.js
with your Copy/Paste snippet.- You MUST comment-out or delete the
<script type="text/javascript">
and</script>
HTML tags from your snippet. - The portion you do want to preserve starts with:
window.NREUM||(NREUM={})...
- You MUST comment-out or delete the
- Run
npm run compile:js
in the repository root folder to create client-side assets.- These are found in
cartridges/plugin_newrelic_browser/cartridge/state
.
- These are found in
- Configure
dw.json
with your Business Manager or API client credentials and your Site version.- There are examples of
dw.json
packaged with this plugin for both authentication types.
- There are examples of
- Upload the plugin by running
npm run uploadCartridge
in the repository root folder. - In SFCC Business Manager, add
plugin_newrelic_browser
to your site's cartridge path (Administration -> Sites -> Manage Sites -> <Your_site> -> Settings) - Once deployed, you can use New Relic Browser as usual, your application will appear like any other.
- Make sure your site is receiving browser traffic before checking for data.
uBlock Origin
or similar filters can break the page load once the Browser JS snippet has been added.
New Relic has open-sourced this project. This project is provided AS-IS WITHOUT WARRANTY OR DEDICATED SUPPORT. Issues and contributions should be reported to the project here on GitHub. We encourage you to bring your experiences and questions to the Explorers Hub where our community members collaborate on solutions and new ideas.
We encourage your contributions to improve Salesforce Commerce Cloud for New Relic Browser! Keep in mind when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant. You only have to sign the CLA one time per project. If you have any questions, or to execute our corporate CLA, required if your contribution is on behalf of a company, please drop us an email at [email protected].
A note about vulnerabilities
As noted in our security policy, New Relic is committed to the privacy and security of our customers and their data. We believe that providing coordinated disclosure by security researchers and engaging with the security community are important means to achieve our security goals.
If you believe you have found a security vulnerability in this project or any of New Relic's products or websites, we welcome and greatly appreciate you reporting it to New Relic through HackerOne.
Salesforce Commerce Cloud for New Relic Browser is licensed under the Apache 2.0 License.
Salesforce Commerce Cloud for New Relic Browser also uses source code from third-party libraries. You can find full details on which libraries are used and the terms under which they are licensed in the third-party notices document.