Calling all developers! We invite you to provide your input on Feature Experimentation by completing this brief survey.
Calling all developers! We invite you to provide your input on Feature Experimentation by completing this brief survey.
Product version: |
EPiServer CMO 1.1 |
---|---|
Document version: |
1.0 |
Document last saved: |
|
CMS pages related to any active campaigns contain injection which makes user browsers send requests to the statistics handler.
The installation files needed to configure the statistics handler can be downloaded from EPiServer World. The statistics handler processes statistics data coming from users and saves raw visit logs to the statistics storage.
Note: Statistics collecting requires the Friendly URL Rewriter module as the injection is done by the handler of this event.
Each request contains parameters that cannot be detected on server side. The statistics handler tries to find and parse the following information in the request query string:
<configuration>
<connectionStrings>
<add name="CmoEntities" connectionString="metadata=res://*/Entities.CmoModel.csdl|res://*/Entities.CmoModel.ssdl|res://*/Entities.CmoModel.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.\sqlexpress;Initial Catalog=Cmo;Integrated Security=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
</connectionStrings>
</configuration>
<browsers>
<browser id="Safari3Plus" parentID="Safari1Plus" >
<identification>
<userAgent match="Version/(?'version'(?'major'\d+)\.(?'minor'\d+[\.\d+]*)\w*)\s+Safari" />
</identification>
<capture>
</capture>
<capabilities>
<capability name="majorversion" value="${major}" />
<capability name="minorversion" value="${minor}" />
<capability name="version" value="${version}" />
</capabilities>
</browser>
<browser refID="Safari1Plus" >
<capabilities>
<capability name="browser" value="Safari" />
</capabilities>
</browser>
</browsers>
<browsers>
<browser id="GoogleChrome" parentID="Safari1Plus">
<identification>
<userAgent match="Chrome/(?'version'(?'major'\d+)\.(?'minor'\d+\.\d+).\d+)" />
</identification>
<capture>
</capture>
<capabilities>
<capability name="browser" value="Chrome" />
<capability name="majorversion" value="${major}" />
<capability name="minorversion" value="${minor}" />
<capability name="version" value="${version}" />
</capabilities>
</browser>
</browsers>
<system.web>
<browserCaps userAgentCacheKeyLength="128" />
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821" />
</configSections>
<log4net>
<appender name="OutputDebugStringAppender" type="log4net.Appender.OutputDebugStringAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level - %message%newline" />
</layout>
</appender>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="Statistics.log.txt" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd " />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level - %message%newline" />
</layout>
</appender>
<root>
<level value="DEBUG" />
<appender-ref ref="OutputDebugStringAppender" />
<appender-ref ref="RollingLogFileAppender" />
</root>
</log4net>
</configuration>
See details about handlers registration here: http://msdn.microsoft.com/en-us/library/46c5ddfy.aspx
In the application's Web.config file, create an httpHandlers section.<configuration>
<system.web>
<httpHandlers>
<add verb="GET" path="{file_mask}" type="EPiServer.Cmo.Core.Statistics.StatisticsHandler, EPiServer.Cmo.Core"/>
</httpHandlers>
</system.web>
</configuration>
Make sure to change the "{file_mask}" parameter to the correct mask of the web service you configured during the installation of EPiServer CMO. For example, if your web service URL is “http://localhost/mywebservice.stat”, you could specify “mywebservice.stat” or “*.stat” instead of this parameter.
Configure IIS to forward the request for ”*.stat” requests to ASP.NET.
<configuration>
<system.web>
<httpHandlers>
<add verb="GET" path="{file_mask}" type="EPiServer.Cmo.Core.Statistics.StatisticsHandler, EPiServer.Cmo.Core" />
</httpHandlers>
<system.web>
<system.webServer>
<handlers>
<add name="StatisticsHandler" verb="GET" path="{file_mask}" Modules="IsapiModule" scriptProcessor="FrameworkPath\aspnet_isapi.dll" resourceType="File" type="EPiServer.Cmo.Core.Statistics.StatisticsHandler, EPiServer.Cmo.Core" />
</handlers>
</system.webServer>
</configuration>
In the application's Web.config file, create a handlers element in the system.webServer section.
Add the following elements to register the handler:<configuration>
Make sure to change "{file_mask}" parameter to the correct mask of web service that you configured during installation of CMO module. For example, if your web service URL is “http://localhost/mywebservice.stat” you could specify “mywebservice.stat” or “*.stat” instead of this parameter.
<system.webServer>
<handlers>
<add name="StatisticsHandler" verb="GET" path="{file_mask}" type="EPiServer.Cmo.Core.Statistics.StatisticsHandler, EPiServer.Cmo.Core" />
</handlers>
</system.webServer>
</configuration>