Configuring a .NET website for Experience Optimization
Implementing Experience Optimization on a .NET website requires that you edit the site's Web.config file to include specific server controls. In addition, you can optionally configure logging and Experiment tracking.
Procedure
- Go to the following location on your Experience Optimization installation media:
api\in-process\dotnet\
- Merge the Web.config file into the existing one in the root folder of your web application.
- Open Web.config for editing.
- Locate the
<controls>section, and add the following subelements:... <pages> <controls> <add tagPrefix="tridion" namespace="Tridion.ContentDelivery.Web.UI" assembly="Tridion.ContentDelivery" /> <add tagPrefix="SmartTarget" namespace="Tridion.SmartTarget.Web.UI" assembly="Tridion.SmartTarget" /> </controls> </pages> - (Optional) To enable logging, do the following steps:
- Add the following
<system.diagnostics>section to the file:<system.diagnostics> <sources> <source name="ExperienceOptimizationLogger" switchName="sourceSwitch"> <listeners> <add name="ExperienceOptimizationTraceListener" /> </listeners> </source> </sources> <sharedListeners> <add name="ExperienceOptimizationTraceListener" initializeData="C:\Temp\logs\xo_client.log" rollSizeKb="102400" timestampPattern="yyyy-MM-dd" rollFileExistsBehavior="Increment" rollInterval="Midnight" maxArchivedFiles="0" type="Sdl.Web.Experience.Logging.TraceListeners.RollingFlatFileTraceListener, Sdl.Web.Experience" /> </sharedListeners> <switches> <add name="sourceSwitch" value="Information" /> </switches> </system.diagnostics> - Set the log folder location and file name.
Under
sharedListeners, in theaddchild element, edit theinitializeDataattribute. - Set the log level, as needed.
Find the
addelement with itsnameattribute set tosourceSwitch, and then change itsvalueattribute from the default (Error) to one ofWarning,InformationorVerbose.
- Add the following
- (Optional) If you want to use Experiments with your implementation of Experience Optimization, add the following
<handlers>section to the file:<handlers> <add name="XO Experiment Tracking" path="/redirect/*" verb="*" type="Tridion.SmartTarget.Analytics.TrackingRedirect" resourceType="Unspecified" /> </handlers> - Save and close Web.config
- Restart the website.