Optimizely CMS with ASP.NET and C#
This integration guideline's examples are created and tested in Optimizely CMS 12 and 13 versions of the Alloy demo site.
The content types will also work in a CMS 11 site on .NET 4.8 but FusionCache, appsettings.json and named HttpClients are not available in .NET 4.8. You need to find a replacement option where the examples use those.
Configuration settings
To follow this guideline, we recommend having the following properties set as a Configuration (appsettings.json) or UserSecrets section or equivalent; alternatively they could be added to your CMS site's settings stored as content (if applicable).
This secret key does not need a high security rating, it will regardless be rendered in a non-Production environment's HTML and you will see it in HTTP client logs.
Your values can be copied from the Dashboard General settings page (opens in a new tab).
string RekScriptId { get; set; }
// To support testing in a development or test environment
// and to support Server side rendering of Questions & Answers
// you also need these two with values set
string RekProjectId { get; set; }
string RekSecretKey { get; set; }
// Should default to: https://predict.rek.ai/
string RekSsrHtmlBaseAddress { get; set; }We also assume that you have a way of detecting environments.
In the examples we use an imaginary isProduction variable.
NuGet packages
Installing these are optional but some code examples use them.
If you plan to have Server side rendering of Questions & Answers we recommend installing the FusionCache NuGet package (opens in a new tab).
If you plan to render <script type="application/ld+json" data-rekai>-elements to be able to filter lists based on structured data conditions we recommend using the Schema.net NuGet package (opens in a new tab).