Integrating the Strands Recommender service into your store
To integrate the Strands Recommender service into your store in Kentico:
Sign in to the Strands Recommender website.
On the my account page, copy your API ID and Validation Token.
In Kentico, open the Settingsapplication and navigate to the Integration -> Strands Recommendersettings.
Paste your API ID and Validation Tokeninto the respective fields in the Generalcategory.
(Optional) In the Catalog feedcategory, configure how Kentico generates the Strands catalog feed.
Kentico comes with a default Strands catalog transformation, StrandsRecommender.Transformations.CatalogFeedTransformation . The transformation handles which fields each of the items in the catalog contains.
You can always check how the Strands catalog feed looks with the current configuration by Saving the configuration andopening the catalog in your browser. The feed is generated in <site address>/CMSModules/StrandsRecommender/CMSPages/StrandsCatalogFeed.ashx. The whole URL of the feed is then, for example:
http://www.yoursite.com/CMSModules/StrandsRecommender/CMSPages/StrandsCatalogFeed.ashx
In the Automatic catalog upload category, select the Enable automatic catalog upload check box.
Set the frequency at which the system uploads the catalog feed to Strands.
(Optional) In the Catalog access restriction category, insert a Username and Password for accessing the Strands catalog feed. This restricts the access to the Strands catalog feed, which can otherwise be viewed by anyone with access to the site.
Using Windows Authentication?
Note that Catalog access restriction doesn’t work if you are using Windows Authentication to access Kentico.
Save the settings.
- Note that using the Save button automatically starts a Strands catalog feed upload to Strands.
Open the Strands Recommendations page and set up your recommendation widgets.
Place Strands recommendation widgets onto pages by placing the Strands recommendations web part.
– or –
Place Strands recommendations into newsletter issues.
The Strands catalog transformation
The default Strands catalog transformation, StrandsRecommender.Transformations.CatalogFeedTransformation , handles which fields each of the items in the catalog contains.
<item>
<id>{% ItemID %}</id>
{% foreach (document in LanguageVersions) { %}
{% cultureCode = document.DocumentCulture.Replace("-", "").ToLower();; #%}
<title_{% cultureCode %}><![CDATA[{% document.DocumentName #%}]]></title_{% cultureCode %}>
<url_{% cultureCode %}><![CDATA[{% document.AbsoluteUrl + "?lang=" + document.DocumentCulture #%}]]></url_{% cultureCode %}>
<description_{% cultureCode %}><![CDATA[{% document.DocumentSKUDescription %}]]></description_{% cultureCode %}>
{% } #%}
{% foreach (currency in Currencies) { %}
{% currencyCode = currency.CurrencyCode.ToLower();; #%}
<price_{% currencyCode %}>{% Math.Round(SKU.GetPrice(currency), currency.CurrencyRoundTo, "AwayFromZero") %}</price_{% currencyCode %}>
<cur_{% currencyCode %}>{% currency.CurrencyCode %}</cur_{% currencyCode %}>
{% } #%}
<price>{% SKU.SKUPrice #%}</price>
<image_link><![CDATA[{% GetAbsoluteUrl(SKU.SKUImagePath) #%}]]></image_link>
<category>{% ItemCategory %}</category>
<SKUDepartmentID>{% SKU.SKUDepartmentID #%}</SKUDepartmentID>
<SKUProductType><![CDATA[{% SKU.SKUProductType #%}]]></SKUProductType>
<SKUSupplierID>{% SKU.SKUSupplierID #%}</SKUSupplierID>
<SKUManufacturerID>{% SKU.SKUManufacturerID #%}</SKUManufacturerID>
</item>
Note the following properties used in the transformation:
- ItemID - an ID of each of the items in the content tree. Same for each language version of the item. Sent to Strands as a unique identifier of the item (ID field).
- ItemCategory - a document type ID. Same for each language version. Sent to Strands as a category field. You can customize how products are categorized
- SKU - items of the COM_SKU table, such as SKU.SKUPrice, SKU.SKUDepartmentID, SKU.SKUProductType, and others.
- LanguageVersions - a collection of every language version of a particular item. Each member of the collection is of TreeNode type and contains columns from the CMS_Document and CMS Tree tables. Such as DocumentSKUName, DocumentSKUDescription, DocumentPageTitle, NodeAlias, and others.
- Currencies - a collection of the available currencies. Each member is of CurrencyInfo type and contains columns from the COM_Currency table, such as CurrencyCode and CurrencyName.
The <id> and <category> elements have to always containthe ItemID and ItemCategory properties. You can customize all the other tags in the transformation.