Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

Feature-specific configurations

The feature-specific configuration options available for Optimizely Commerce Connect

Depending on your solution, you can configure tracking execution and versioning synchronization in Optimizely Commerce Connect.

Configuration options

The configuration settings are available in the appsettings.json file. The following example is from the Optimizely Commerce Foundation sample site.

{
  "Commerce": {
    "BusinessManagerOptions": {
      "Handlers": [
        {
          "MetaClass": "Contact",
          "Method": "*",
          "TypeName": "Mediachase.Commerce.Customers.Handlers.ContactRequestHandler, Mediachase.Commerce"
        }
      ],
      "Plugins": [
        {
          "MetaClass": "List",
          "Method": "CustomPage",
          "EventStage": "EventPipeLineStage.PostMainOperationInsideTranasaction",
          "TypeName": "Mediachase.Commerce.Customization.Plugins.CustomPageNormalizationPlugin, Mediachase.Commerce"
        }
      ]
    },
    "MetaObjectOptions": {
      "MaxListObject": 1000,
      "UseCache": false,
      "CacheItemExpiration": 30,
      "UseSPOptimization": false,
      "SPItemExpiration": 10080,
      "Instances": [
        {
          "MetaClass": "",
          "Type": "Mediachase.BusinessFoundation.Data.Meta.MetaObject, Mediachase.BusinessFoundation.Data"
        }
      ],
      "Types": [
        {
          "Name": "Name",
          "Installer": "Mediachase.BusinessFoundation.Data.Meta.Management.DefaultMetaFieldInstaller, Mediachase.BusinessFoundation.Data",
          "Binder": "Mediachase.BusinessFoundation.Data.Meta.DefaultMetaObjectPropertyBinder, Mediachase.BusinessFoundation.Data"
        }
      ]
    },
    "SearchOptions": {
      "DefaultSearchProvider": "LuceneSearchProvider",
      "MaxHitsForSearchResults": 1000,
      "IndexerBasePath": "[appDataPath]/Foundation/SearchIndex",
      "IndexerConnectionString": "",
      "SearchProviders": [
        {
          "Name": "LuceneSearchProvider",
          "Type": "Mediachase.Search.Providers.Lucene.LuceneSearchProvider, Mediachase.Search.LuceneSearchProvider",
          "Parameters": {
            "queryBuilderType": "Mediachase.Search.Providers.Lucene.LuceneSearchQueryBuilder, Mediachase.Search.LuceneSearchProvider",
            "storage": "[appDataPath]/SearchIndex",
            "simulateFaceting": "true"
          }
        }
      ],
      "Indexers": [
        {
          "Name": "catalog",
          "Type": "Mediachase.Search.Extensions.Indexers.CatalogIndexBuilder, Mediachase.Search.Extensions"
        }
      ]
    },
    "CatalogOptions": {
      "AutoConfigure": true,
      "SalePriceTypes": [
        {
          "Key": "Subscription",
          "Value": "3",
          "Description": "Subscription"
        },
        {
          "Key": "MSRP",
          "Value": "4",
          "Description": "MSRP"
        }
      ],
      "ShowVariationListPrice": false,
      "CatalogImportBatchSize": 200,
      "CommandTimeout": -1,
      "CatalogEventLevel": 0,
      "DisableCatalogEventDrivenIndexing": false,
      "DisableQueueForIncrementalIndexing": false,
      "SkipCatalogContentModelCheck": false,
      "IgnorePropertyAndMetafieldMisMatch": false,
      "SimplifiedCatalogListingThreshold": 2000,
      "DraftMigrationBatchSize": 5000,
      "DraftMigrationTimeSpan": 1,
      "EnableFeatureGetReferencesInCatalog": false,
      "EnsurePublishedVersionInAllLanguages": true,
      "ArchivedThreshold": 30
    },
    "OptiGPTOptions": {
      "OptiAIKey": "",
      "OptiAISecret": "",
      "OptiAIUrl": "",
      "OptiAIDefaultModel": ""
    },
    "ApplicationOptions": {
      "DefaultApplicationName": "ECApplication",
      "AdminHomePage": "Dashboard",
      "Cache": {
        "Enabled": true
      },
      "AutoMigrate": true,
      "Features": {
        "DynamicPackageFeature": {
          "Feature": "DynamicPackageFeature",
          "State": 0,
          "Type": "Mediachase.Commerce.Core.Features.DynamicPackageFeature, Mediachase.Commerce"
        }
      }
    },
    "CustomerOptions": {
      "AutoInstall": true,
      "DemoInstall": true
    },
    "MarketingOptions": {
      "LinkableTypesEnabled": false
    },
    "OrderOptions": {
      "NewOrderStatus": "InProgress",
      "SensitiveDataMode": 1,
      "AutoConfigure": true,
      "DisableOrderDataLocalization": false,
      "WishListCartNames": [
        "WishList"
      ],
      "ExpiredCartsRemovalJobExcludedCartName": [
        ""
      ],
      "ExpiredCartJobDays": 30,
      "CommandTimeout": 30
    },
    "PermissionOptions": {
      "Enable": false
    },
    "DataOptions": {
      "DisableRetryPolicy": false,
      "LowFragmentationThreshold": 10,
      "HighFragmentationThreshold": 30,
      "DataBaseIndicesJobCommandTimeOut": -1,
      "LongQueryExecutionTimeOut": 10080,
      "UseBinaryFormatter": true
    },
    "MetaDataOptions": {
      "DisableVersionSync": false,
      "AllowUntypedCatalogContent": "false",
      "RemoveOrphanedMetaKeysBatchSize": 10000
    },
    "SqlDataProviderOptions": {
      "CommandTimeOut": -1
    },
    "PromotionOptions": {
      "PromotionExclusionLevel": 0,
      "ApplyPromotionUnitIndividually": false
    },
    "PaymentServiceOptions": {
      "PaymentServiceIsEnabled": false,
      "EnvironmentName": "Default",
      "EnvironmentKey": "",
      "GatewayToken": "",
      "ScaProviderKey": "",
      "ThreeDsIsEnabled": false,
      "ThreeDsTestMode": false,
      "ThreeDsTestCallbackUrl": "",
      "PaymentServiceUrl": "",
      "AuthenticationType": "",
      "AppKey": "",
      "SecretKey": "",
      "SigningSecret": "",
      "InstanceIdentifier": ""
    },
    "UriSegmentConflictsJobOptions": {
      "EmailRecipients": [
        ""
      ]
    },
    "UserflowOptions": {
      "ContentKeys": ""
    },
    "BoltOptions": {
      "EnvironmentType": 1,
      "PublishableKey": "",
      "ApiKey": "",
      "DivisionPublicId": "",
      "SigningSecret": "",
      "AutoCapture": true
    },
    "ReportingOptions": {
      "OrderPerPromotionReportDataTimeout": 30,
      "EnableEventDrivenOrderReporting": false,
      "ReportForInactivePromotionItems": false
    },
    "ReportingTimeRangeOptions": {
      "TimeRangesInDays": [
        90
      ],
      "SubscriptionTimeRangesInDays": [
        90
      ]
    },
    "SegmentOptions": {
      "WriteKey": ""
    },
    "ExtendedComponentOptions": {
      "ExtendedComponents": [
        {
          "Name": "",
          "ScriptUrl": "",
          "Order": 0,
          "ComponentLocation": 0,
          "OrderTypes": 0
        }
      ]
    },
    "CatalogFeedOptions": {
      "EnableEventDrivenCatalogFeed": false,
      "CatalogFeedBatchSize": 50,
      "CalculateDiscountPrices": true,
      "MaxEntryProcessForIncrementalCatalogFeed": 10000
    },
    "AdyenPaymentOptions": {
      "ApiKey": "",
      "MerchantAccount": "",
      "ClientKey": ""
    }
  }
}

Configuration details

  • PromotionExclusionLevel – Indicates if a promotion is excluded from being applied per order or per unit.
    • Order (default) – Promotions are excluded from being applied to an order when excluded by other promotions.
    • Unit – Promotions can partly be prevented from being applied to one or more individual items when excluded by other promotions. Order-level and shipping-level promotions are still excluded in full.
  • DisableVersionSync – Indicates if an update to catalog content done outside of the content APIs removes version data (for example, drafts, old published versions) for affected content. Setting this to true can improve the speed of batch operations done through the lower-level APIs (such as ICatalogSystem), for example, the catalog import.
  • episerver:tracking.Enabled – Indicates if the Tracking system executes tracking.
  • episerver:personalization.BaseApiUrl – The URL of the Optimizely Product Recommendations environment to be used. Should contain only the protocol and hostname.
  • episerver:personalization.Site – The site name used to identify requests to the tracking server.
  • episerver:personalization.ClientToken – The token used to authenticate tracking requests to the REST API.
  • episerver:personalization.AdminToken – The token used to authenticate admin requests to the REST API.
  • episerver:personalization.RequestTimeout – (Optional) Timeout for REST calls. The default value is 30 seconds.
  • episerver:personalization.TrackingMode – (Optional) The tracking mode to use. Acceptable values are ServerSide and ClientSide. To use the client-side (JavaScript) tracking APIs, set this key to ClientSide. The default value is ServerSide.
  • episerver:personalization.CatalogFeedBatchSize – (Optional) The number of products processed in one batch when the product feed is generated. A higher value can be faster, but it puts more pressure on the memory. Default value is 50.
  • episerver:personalization.CatalogNameForFeed – (Optional) Selects the catalog used to generate the product feed if you have multiple catalogs. If this value is not set, the first catalog is used. Note: This property will be removed when product feed support for multiple catalogs is added.
  • ExpiredCartJobDays – For the Remove Expired Carts job, sets the number of days after the last modification before a cart is considered abandoned and removed by the job. Default value is 30 days.
  • episerver:ExpiredCartsRemovalJobExcludedCartName – For the Remove Expired Carts job, sets the cart name that is excluded from being removed by the job, even if it has not been changed for a longer time than the configured value. Default value is "WishList".
  • episerver::DataBaseIndicesJobCommandTimeOut – For the Maintenance Database Indices job, sets the value (in seconds) before database requests are considered timeouts.
  • episerver::LowFragmentationThreshold – For the Maintenance Database Indices job, sets the fragmentation value (in percent) of indices. If an index's fragmentation level is below this value, it is not maintained. Default value is 10.
  • episerver::HighFragmentationThreshold – For the Maintenance Database Indices job, sets the value (in percent). Indices with a fragmentation level higher than this value are rebuilt. Indices with a fragmentation level lower than this value, but higher than the value configured by episerver::LowFragmentationThreshold, are reorganized. Default value is 30.
  • episerver:commerce.UseLessStrictEntryUriSegmentValidation – Indicates whether validation of entry URI segments should be strict or not. Strict validation means URI segments must be globally unique (for the language) to make sure all hierarchical routes to entries work despite any crosslinking that happens after the URI segment is saved. Less strict validation means the URI segment is still validated for uniqueness against sibling items, but crosslinking items can create conflicts in hierarchical routes. Default value is false.

Feature switch

The following features are provided as default by Commerce Connect through the ApplicationOptions class.

  • SerializedCarts – Enables working with the serializable cart system. Type: Mediachase.Commerce.Core.Features.SerializedCarts, Mediachase.Commerce
    • Enabled (default) – Carts use the new (serializable) system.
    • Disabled – Carts use the old system.
  • DynamicPackageFeature – Enables using the dynamic package content. Type: Mediachase.Commerce.Core.Features.DynamicPackageFeature, Mediachase.Commerce
    • Enabled – Have new content called Dynamic Package.
    • Disabled (default) – Do not have Dynamic Package content.

Modify and add features

Add or modify existing features using appsettings.json.

{
       "ApplicationOptions":{
          "Features":{
             "SerializedCarts":{
                "Feature":"SerializedCarts",
                "State":1, // 0 is enabled, 1 for disabled
                "Type":"Mediachase.Commerce.Core.Features.SerializedCarts, Mediachase.Commerce"
             },
             "MyownFeature":{
                "Feature":"CustomFeatureName",
                "State":1,
                "Type":"<CustomFeatureTypeName>, Mediachase.Commerce"
             }
          }
       }
    }