Open navigation

Integration Steps for Salesforce Commerce Cloud

The process for installing the Klevu Cartridge is very straightforward and similar to any other Salesforce Cartridge, but it does involve some technical aspects so we recommend you ask your Salesforce integration provider to complete these steps.

The integration of Klevu with your Salesforce Commerce Cloud store involves the following steps:

  • Installation: Adding the Klevu Cartridge to your store using the below mentioned stores.
  • Configuration: Configuring your store with Klevu credentials.
  • Customisation: Updating the look & feel and functionality of Klevu in your store.

Cartridge Installation

There are various ways to deploy a new Cartridge to Salesforce, eg. using dw.json with the uploadCartridge command, or using an IDE like UX studio, so please follow your own preferred approach. If you are not familiar with this process we strongly recommend you read the official Salesforce documentation and take help from Salesforce support as required. 

First, you will need the Salesforce Klevu Cartridge, which can be downloaded from the official Salesforce Marketplace. The Salesforce Klevu integration has the following components.

The Salesforce Klevu integration has the following components.

  • int_klevu_sfra

    The frontend components necessary for integration with an SFRA site.

  • bm_klevu
    The Business Manager components for data export features.

  • int_klevu_core
    Shared scripts which are used across both of the above components.

Please upload these components to your Salesforce instance using your preferred method.

Cartridge Activation

Next log into Salesforce Business Manager to activate the components of the Cartridge which has just been uploaded.

Frontend Activation

  1. Navigate to Administration → Sites → Manage Sites.
  2. Click on the site name you’d like to configure, eg: RefArch.
  3. Switch to the Settings tab on the next page.
  4. In the Cartridges input field add int_klevu_sfra:int_klevu_core: in front of the existing cartridges.
  5. Click on the Apply button, and repeat for any other stores you’d like to use Klevu with.

Backend Activation

  1. Navigate to Administration → Sites → Manage Sites.
  2. Click on the link Manage the Business Manager site.
  3. In the Cartridges input field add bm_klevu:int_klevu_core: in front of the existing cartridges.
  4. Click on the Apply button.

Metadata Preparation

Next we need to import the default configuration, jobs and services required for Klevu to function. Within the Klevu Salesforce Cartridge files you will find a folder metadata. You will first need to make some modifications according to your store configuration:

  • Find and replace all references of RefArch within the metadata folder with the name of your store. Don’t forget the folder libraries/RefArchSharedLibrary, replacing the RefArch part.
  • If you will be installing on multiple stores:
  • Duplicate the libraries/RefArchSharedLibrary folder and rename it accordingly for your additional store(s), then find and replace all references of RefArch within that folder.
  • Open up jobs.xml and duplicate all of the jobs, replacing RefArch with the name of your additional store, for each of the stores you will be installing Klevu on.
  • Once the above is completed, create a new ZIP archive called klevu-meta-import.zip and proceed with the next steps.

Metadata Import

Next you will need to import this metadata into Salesforce. 

  1. Navigate to Administration → Site Development → Site Import & Export.
  2. Under Import → Upload Archive, ensure that “Local” is selected then Choose File.
  3. Find your klevu-meta-import.zip and click on the upload button.
  4. The page will reload and you should see instance/klevu-meta-import.zip in the list.
  5. Click the radio button corresponding to klevu-meta-import.zip and click on the Import button.
  6. The page will reload again and ask you “Are you sure that you want to import the selected archive?”, select OK.
  7. The page will reload a final time. Scroll down to the very bottom to find the Status section, where your job will appear as RUNNING. You can click the Refresh button until this completes.

The process will update to either SUCCESS or FINISHED. There may be some “data errors”, if so please review these and take action accordingly. Any data errors relating to “Invalid job” can be disregarded.

Validation

The installation is now complete, but let’s make sure everything is appearing where it should be.

Navigate to Merchant Tools → Site Preferences → Custom Preferences. Here you should see a new section called “Klevu”, which you can click to find settings for our Cartridge. Don’t modify them for now, this will be covered in the next section.

Next navigate to Merchant Tools → Content → Content Assets. You should see a number of content assets created with Klevu in the name. These are for managing the frontend appearance of the Klevu HTML, CSS, and JavaScript.

Now navigate to Administration → Operations → Jobs. You should see a number of jobs with Klevu in the title. These will control how your Salesforce store data is exported to Klevu.

Next, let’s check the Services and Credentials were configured correctly. Navigate to Administration → Operations → Services and check that services with the following names have been created:

  • klevu.http.storefront
  • klevu.http.backoffice
  • klevu.http.analytics

Finally change to the Credentials tab and you should see two credentials have been created and populated with the following values:

The {api_key} value here is intentional and should not be modified. It will be replaced dynamically using the Salesforce store configuration.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.