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

  1. Go to the following location on your Experience Optimization installation media:

    api\in-process\dotnet\

  2. Merge the Web.config file into the existing one in the root folder of your web application.
  3. Open Web.config for editing.
  4. 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>
  5. (Optional) To enable logging, do the following steps:
    1. 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>
    2. Set the log folder location and file name.
      Under sharedListeners, in the add child element, edit the initializeData attribute.
    3. Set the log level, as needed.
      Find the add element with its name attribute set to sourceSwitch, and then change its value attribute from the default (Error) to one of Warning, Information or Verbose.
  6. (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>
    
  7. Save and close Web.config
  8. Restart the website.