Install Benson on Salesforce Commerce Cloud

Add the Benson snippet to your SFRA storefront's htmlHead template in a custom cartridge, deploy the code, and check it's live.

Install
Updated 9 November 20261 min read
Jump to a section

On Salesforce B2C Commerce (Commerce Cloud), add Benson to your storefront's head template in a custom cartridge on top of the SFRA base cartridge. This is a developer task involving one template and a code deploy. Choose Other as your platform in the setup wizard.

Your snippet#

Your real snippet, with your site key, is in the setup wizard and under Settings → Install:

<script async src="https://cdn.trybenson.com/benson.js" data-site="pk_live_YOUR_SITE_KEY"></script>

Add it to your storefront#

  1. In your custom cartridge, override cartridge/templates/default/common/htmlHead.isml from app_storefront_base: copy the base template to the same path, and paste your snippet at the end of it.
  2. In Business Manager, make sure your cartridge sits to the left of app_storefront_base on the site's cartridge path.
  3. Upload the code version, then activate it under Administration → Site Development → Code Deployment.
  4. Clear the page cache under Administration → Sites → Manage Sites → your site → Cache.

If your storefront isn't on SFRA, add the snippet to the template that renders the <head> of every page, including checkout.

Check it's live#

Open your storefront in a normal browser tab. The setup wizard shows Verified: Benson is live within a few seconds. If it doesn't, see Troubleshooting.

Good to know#

  • Open your checkout and check that the snippet is in its page source. If checkout has its own layout template, add the snippet there too.
  • If your site sends a Content Security Policy, allow Benson's hosts. See CSP.

Stuck? Email [email protected].

Find out what's leaking. Free forever, no card.

Free forever up to 25,000 sessions a month. Every Pro feature free for your first 14 days. No card. We'll email you about getting started. Unsubscribe any time.