Integrations / Platforms / Salesforce Commerce Cloud B2C / FAQ

We’re still using SiteGenesis pipelines. Is the Algolia cartridge compatible?

A SiteGenesis-based site can use both pipelines and controllers architectures simultaneously.

The Algolia cartridge uses controllers, but is fully compatible with your current pipeline architecture.

Do I have to use the front-end of the cartridge?

The integration is split into four cartridges:

int_algolia Imports your product information from SFCC to Algolia.
bm_algolia Lets you monitor and configure Algolia indexing from your Business Manager.
int_algolia_controllers algolia_sg_changes Lets you implement Algolia InstantSearch on your SiteGenesis SFCC storefront.
int_algolia_sfra Lets you implement Algolia InstantSearch on your SFRA SFCC storefront.

The mandatory cartridges are int_algolia and bm_algolia. However, int_algolia_controllers and int_algolia_sfra are useful starting points if you’re willing to implement your front-end with InstantSearch.

Does the cartridge support multiple locales?

Yes. When assigning the Algolia cartridges to a site, they automatically support all the locales the site uses.

Does this cartridge support multiple currencies?

When assigning the Algolia cartridges to a site, they automatically support all the currencies the site uses.

I want to use to cartridge on multiple sites, are there going to be collisions?

The cartridge creates indices with a strict naming convention that prevents collisions between sites.

  • For products: ${hostname}__${site-id}__products__${locale}
  • For categories: ${hostname}__${site-id}__categories__${locale}

You can safely set up Algolia on any new site your create by assigning the int_algolia cartridge to it and running the indexing jobs, without worrying about name collisions.

How can I index my revenue data?

Indexing revenue metrics as an attribute in Algolia lets you use this data in your ranking formula.

By default, the Algolia Link Integration for Salesforce Commerce Cloud B2C supports many product attributes. If you’d like to index an attribute that isn’t in the list of supported attributes, you can define a custom function.

  1. In your own code, override the following code in the int_algolia/cartridge/scripts/algolia/model/algoliaProduct.js file.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    
     // in file: int_algolia/cartridge/scripts/algolia/model/algoliaProduct.js
        
        
     /**
      * Handler complex and calculated Product attributes
      */
     var agregatedValueHanlders = {
         /* ... */
        
         revenueData: function (product) {
             var activeData = product.getActiveData();
             return {
                 quantityLast7Days: activeData.ordersWeek,
                 revenueLast7Days: activeData.revenueWeek,
                 quantityLast30Days: activeData.ordersMonth,
                 revenueLast30Days: activeData.revenuesMonth,
             };
         },
     };
    
  2. In your Business Manager, go to Merchant Tools → Site Preferences → Custom Preferences → Algolia. Find Custom Fields and add revenueData.

  3. Finally, reindex your data by going in Administration → Operations → Jobs and running the AlgoliaProductsIndex job.

Did you find this page helpful?