Catalog Interaction

A Catalog interaction is the standard interaction used to capture a customer's engagement with any trackable item from your catalog, such as products, categories, articles, and so on.

The primary purpose is to capture what the user is currently viewing or engaging with, along with all the relevant metadata for that item.

Catalog Interaction Structure

The Catalog Interaction is defined within the main interaction object of the event payload.

Field Name Field Type Description
name string Required. The type of interaction that occurred. Use the standard SDK constants for this field. For example, View Catalog Object.
catalogObject.id string Required. A unique ID representing the catalog object.
catalogObject.type string Required. The defined type of the catalog item. For example, Product, Blog, and so on.
catalogObject.attributes object A dictionary of user-supplied values.
catalogObject.relatedCatalogObjects object A dictionary of related catalog objects.

This example event shows required fields (name, type, id) and optional fields (attributes, relatedCatalogObjects) within the interaction payload.

{
  "interaction": {
    "name": "View Catalog Object",
    "catalogObject": {
      "type": "Product",
      "id": "product-xyz",
      "attributes": {
        "name": "Product XYZ",
        "category": "Clothing",
        "color": "Red",
        "sku": "product-xyz-sku"
      },
      "relatedCatalogObjects": [
        {
          "Sizes": ["S", "M", "L"] // Related attributes or objects
        }
      ]
    }
  }
}

Standard Interaction Names

Always use the built-in constants for the interaction.name field to ensure consistency across your instrumentation.

Interaction Name Value
SalesforceInteractions.CatalogObjectInteractionName.ViewCatalogObject View Catalog Object
SalesforceInteractions.CatalogObjectInteractionName.ViewCatalogObjectDetail View Catalog Object Detail
SalesforceInteractions.CatalogObjectInteractionName.FavoriteCatalogObject Favorite Catalog Object
SalesforceInteractions.CatalogObjectInteractionName.CommentCatalogObject Comment Catalog Object
SalesforceInteractions.CatalogObjectInteractionName.ReviewCatalogObject Review Catalog Object
SalesforceInteractions.CatalogObjectInteractionName.ShareCatalogObject Share Catalog Object
SalesforceInteractions.CatalogObjectInteractionName.QuickViewCatalogObject Quick View Catalog Object

Implementation Examples

Using the SDK

This example shows how to capture a catalog interaction using a sendEvent() call, typically triggered by a user action like clicking a "quick view" button.

SalesforceInteractions.sendEvent({
  interaction: {
    name: "View Catalog Object",
    catalogObject: {
      type: "Product",
      id: "product-xyz",
      attributes: {
        name: "Product XYZ",
        category: "Clothing",
        color: "Red",
        sku: "product-xyz-sku",
      },
      relatedCatalogObjects: [
        {
          Sizes: ["S", "M", "L"],
        },
      ],
    },
  },
});

Using the Sitemap

When tracking order interactions that occur upon page load (like viewing a product detail page), use the Sitemap configuration. This ensures the event fires consistently and loads necessary data for the catalog object.

Here’s how a catalog interaction is captured using the sitemap.

SalesforceInteractions.init().then(() => {
  const sitemapConfig = {
    global: {},
    pageTypes: [
      {
        name: "product_detail",
        isMatch: () => true,
        interaction: {
          name: SalesforceInteractions.CatalogObjectInteractionName.ViewCatalogObject,
          catalogObject: {
            type: "Product",
            id: "product-xyz",
            attributes: {
              name: "Product XYZ",
              category: "Clothing",
              color: "Red",
              sku: "product-xyz-sku",
            },
            relatedCatalogObjects: [
              {
                Sizes: ["S", "M", "L"],
              },
            ],
          },
        },
      },
    ],
  };
  SalesforceInteractions.initSitemap(sitemapConfig);
});

See Also