by

Setup guide

Get started with SFCCInsight

You have downloaded the app. Before anyone can ask a question, someone who looks after your Salesforce B2C Commerce account connects it to your store. It is a one-time job of about half an hour. After that, everyone on your team opens one settings file and signs in with their own login.

How setup works

  1. Your Salesforce admin gives the app read-only access. They create an API client in Account Manager and add a few settings in Business Manager. The app can only read: it never changes orders, prices, stock or settings.
  2. One person enters those details in the app and saves them as an encrypted store file, locked with a passphrase.
  3. Everyone else opens the store file, types the passphrase and signs in with their own Salesforce Account Manager login.

The connection settings and secrets stay in each computer's keychain. They are never sent to gautamLab.

Who does what

In many companies one Salesforce admin does all the admin steps. The names below are the permissions each step needs.

WhoWhat they doSteps
Account Manager administratorCreates the read-only API client, optionally a sign-in client, and makes sure each user has a role on your store's instance.1, 2, 3
Business Manager administratorLooks up the store details and adds the OCAPI settings the app generates.4, 5
Whoever manages your eCDN or firewall rulesAllows your office and VPN addresses, if your store blocks unknown addresses.7
The person setting up the appEnters the settings once, checks they work and shares the store file.8, 9
Everyone elseOpens the store file, enters the passphrase and signs in.For everyone on the team

Before you start

  • SFCCInsight installed on the computer of the person setting it up. Download it here.
  • An Account Manager login that can create API clients for your organization.
  • Business Manager administrator access to your production instance.
  • Your instance name, for example abcd_prd, and the hostname you use for Business Manager.

The app shows the same admin steps inside it, filled in for your instance and with copy buttons. On the Connect your store screen, open Administrators: enter the settings by hand, then What to set up in Account Manager and Business Manager first. The in-app help also has the full steps under For administrators.

For your Salesforce admin, in Account Manager

1. Create the read-only API client

The app reads both the data lake and the live store with one API client: a machine login with an ID and a secret.

  1. In Account Manager, open API Client and press Add API Client.
  2. Give it a name such as "SFCCInsight read-only" and a strong secret. Keep the secret for step 8.
  3. Fill in the values below and save. Copy the client ID it shows.
Token endpoint auth methodclient_secret_post
RolesSalesforce Commerce API, with the tenant filter set to your instance, for example abcd_prd
Default scopesmail
Allowed scopes

SALESFORCE_COMMERCE_API:abcd_prd, with your instance, then:

  • sfcc.catalogs
  • sfcc.customergroups
  • sfcc.customerlists
  • sfcc.inventory-lists
  • sfcc.jobs
  • sfcc.orders
  • sfcc.price-books
  • sfcc.products
  • sfcc.promotions
  • sfcc.scripts
  • sfcc.sites
  • sfcc.source-codes
  • sfcc.scapi-schemas

Read scopes only. Give this client nothing that writes. The app builds this scope list from the operations it is allowed to call, so a newer version may list more; the copy in the app is always the current one.

For your Salesforce admin, in Account Manager. Optional

2. The sign-in client (optional)

People sign in to the app with their own Account Manager login, in their web browser. By default the app uses Salesforce's public B2C tooling client for this, so you can skip this step. Create your own only if you want to control which users may sign in.

TypePublic (no secret)
Token endpoint auth methodnone
Redirect URIshttp://localhost:8080, http://localhost:8081, http://localhost:8082, http://localhost:8083. The app uses the first of these ports that is free on the user's computer. Without your own sign-in client, Salesforce's shared client only accepts port 8080, so a user with another program on 8080 has to close it.
Default scopesmail, roles, tenantFilter, profile

After sign-in, the browser returns to the app on port 8080 of the user's own computer. If another program uses that port, choose a different Sign-in return port in step 8 and use the same port in the redirect URI.

For your Salesforce admin, in Account Manager

3. User access

  • Everyone who uses the app needs their own Account Manager login. Their password goes to Salesforce only; the app never sees it.
  • Their Account Manager user needs a role whose instances (the tenant filter) include your store's instance. If not, sign-in stops with "Your Account Manager user has no role on ...". The app checks only that the instance is listed; which role to give is your admin's choice, and your Salesforce admin can confirm the right one for your company.
  • Each person sees only what their own access allows.

For your Salesforce admin, in Business Manager

4. Instance and store details

Collect these for step 8.

DetailExampleWhere to find it
Instanceabcd_prdYour realm ID and instance, as used in Account Manager tenant filters.
SCAPI short codekv7kzm78Business Manager: Administration, Site Development, Salesforce Commerce API Settings. Needed to read the live store.
Organization IDf_ecom_abcd_prdThe same page.
Instance hostnameproduction-xyz.demandware.netThe host you use for Business Manager. Needed for the OCAPI checks.

Site IDs: you do not type these. After the first sign-in the app finds your sites, time zone and currencies itself; see them in the app under Setup, Sites and currencies, and press Refresh after adding a site. Per-site options such as the order number prefix and export job are under Setup, Operations settings.

For your Salesforce admin, in Business Manager

5. Business Manager OCAPI settings

A few checks, such as job history and coupon use, read the Open Commerce API (OCAPI). It needs its own permission in Business Manager. The app generates these settings for you.

  1. In Business Manager, open Administration, Site Development, Open Commerce API Settings.
  2. Choose type Data and context Global.
  3. Add the client block below to the existing settings. Do not remove other clients. Put your read-only client ID from step 1 in place of the placeholder, and save.
{
  "_v": "24.5",
  "clients": [{
    "client_id": "<read-only API client id>",
    "resources": [
      {
        "resource_id": "/job_execution_search",
        "methods": ["post"],
        "read_attributes": "(**)",
        "write_attributes": ""
      },
      {
        "resource_id": "/sites/*/coupon_redemption_search",
        "methods": ["post"],
        "read_attributes": "(**)",
        "write_attributes": ""
      }
    ]
  }]
}

Both resources are searches: they use POST but only read. The in-app copy is generated from the installed version and is the one to paste.

For your Salesforce admin

6. Data lake access

History (orders, products, promotions, visits and searches over days, weeks and months) comes from your B2C Commerce data lake, also called B2C Commerce Intelligence or CIP. Salesforce keeps it for you; it can be a little behind the live store.

  • The app reads the data lake with the same read-only API client from step 1. Its client ID and secret go in Data lake client ID and Data lake client secret in step 8.
  • Leave Data lake host empty. The app uses jdbc.analytics.commercecloud.salesforce.com unless Salesforce told you to use a different host.
  • Whether the data lake is switched on for your realm, and whether your contract includes it, is something your Salesforce admin can confirm.

For whoever manages your eCDN or firewall rules

7. eCDN and IP allowlists

Each computer running SFCCInsight calls B2C Commerce from its own internet address. If your store uses eCDN (WAF) rules or OCAPI IP allowlists, live reads such as order search can be stopped before they reach B2C Commerce.

  • Allow your office and VPN address ranges in the eCDN (WAF) rules or the OCAPI allowed IPs, or exempt the read-only API client.
  • When this happens, the app says the request "was blocked" and mentions the eCDN or an IP allowlist. History from the data lake keeps working.

For the person setting up the app

8. Enter the settings in the app

  1. Open SFCCInsight. On Connect your store, open Administrators: enter the settings by hand. If you are already signed in, go to Setup and press Change store settings.
  2. Fill in the fields below and press Save and continue.
  3. Press Sign in with Salesforce Account Manager. Your browser opens the Salesforce sign-in page (account.demandware.com). Sign in as usual, then come back to the app.
FieldWhat to enter
Instance requiredYour instance name, for example abcd_prd.
Data lake client ID requiredThe read-only API client from step 1.
Data lake client secret requiredIts secret. When you change settings later, leaving a secret empty keeps the stored one.
Sign-in client IDYour own sign-in client from step 2. Leave empty to use Salesforce's public client.
SCAPI short codeFrom step 4. Needed to read the live store.
Organization IDFrom step 4.
Instance hostnameFrom step 4. Needed for the OCAPI checks.
Live API client ID and secret (if different)Only if you made a separate client for the live store. Usually empty.
Sign-in return port8080 unless something else uses it. Must match the sign-in client's redirect URI.
Account Manager host, Data lake hostLeave empty unless Salesforce told you to use different hosts.

For the person setting up the app

9. Share the store file

  1. In the app, go to Setup. Under Store connection, type a passphrase of at least 10 characters.
  2. Press Save store file and choose where to save it. The file ends in .sfccinsight.
  3. Send the file one way, for example by email or a shared drive, and the passphrase another way, for example by phone or chat.

The file includes the store connection and API clients, data lake access, your brand logo, uploaded metadata, store knowledge, verified questions and operations settings, so a new user has the same setup as you. It leaves out everyone's own sign-in and kept results. Each person still signs in with their own Account Manager account.

The file is encrypted with the passphrase. It holds settings and secrets, never orders or customer records. Anyone with both the file and the passphrase can connect to the store, so never send them together.

For everyone on the team

You need the store file, its passphrase and your own Account Manager login with access to the store.

  1. Install SFCCInsight and open it. You see Connect your store.
  2. Under Store file (.sfccinsight), choose the file. Type the Passphrase and press Open. Check the store name and logo shown, then press Connect. You do this once on each computer.
  3. On Sign in to SFCCInsight, check the instance shown is your store, then press Sign in with Salesforce Account Manager.
  4. Sign in in your browser as you normally do, including any verification code, then come back to the app. Home opens with a short tour the first time.

Check that it works

  1. In Setup, under API access, press Check. The app makes one small read for each kind of live data and marks it works or fix needed, with the reason.
  2. On Home, open a report such as revenue by site for last month. If numbers appear, the data lake is connected.
  3. To ask questions in your own words, pick an AI in Setup, under AI for Ask. The simplest choice is gautamLab, which needs no key and is available after your first sign-in.
  4. For better searches, an admin can upload the Business Manager metadata export in Setup, Store metadata, and press Learn from recent orders under Store knowledge.

Common problems

What you seeWhat to do
"The passphrase is wrong or the file was changed."Retype the passphrase, including capital letters. If it still fails, ask for a fresh store file and passphrase.
"This is not an SFCCInsight store file, or it needs a newer app."Choose the .sfccinsight file, and install the latest SFCCInsight.
"Use a passphrase of at least 10 characters."Choose a longer passphrase when saving the store file.
"Your Account Manager user has no role on ..."The login works but has no role on this instance. The Account Manager administrator adds one (step 3).
The browser shows an error about the redirect or the addressAnother program may use the sign-in port, or the sign-in client lists a different address. Check Sign-in return port and the client's redirect URI (steps 2 and 8).
The button says "Waiting for Account Manager" and nothing happensFinish signing in in your browser; its window may be behind the app. If you closed it, restart SFCCInsight and sign in again.
"... was refused (401 or 403). Add sfcc.... to the API client's allowed scopes"Add that scope to the API client in Account Manager (step 1) and wait a few minutes.
"... was refused. Grant /... to the API client in the OCAPI Data settings."The OCAPI settings do not include that resource for your client (step 5).
"... was blocked ... eCDN or an IP allowlist ..."Allow the office or VPN address range, or exempt the API client (step 7).
"Set the SCAPI shortCode ...", "Set tenantId ..." or "Set hostname ..."A store detail is missing. Add it in the store settings (steps 4 and 8).
"Not checked: every source needs an id."Not an error. That kind of data can only be read one record at a time, so there is nothing to test.

Still stuck? Write to admin@gautamlab.com. Never send API secrets, the store file or its passphrase.