Coveo for Sitecore 5 is now available!

404 Errors on Coveo Usage Analytics Search Events

Coveo for Sitecore (September 2016)

Symptoms

Click and Custom Analytics events are sent to the Coveo Cloud Usage Analytics, but Search events are returning a 404 error.

Cause

The Coveo for Sitecore Rest Analytics endpoint has a limited query string length value. If the URL length is higher than this value, it is truncated and becomes no longer valid.

Resolution

There are two ways to fix this issue:

  1. Upgrade at least to the September 2016 release of Coveo for Sitecore. This is the recommended option.
  2. Manually modify the web.config file:
    1. Navigate to the <sitecore instance>\Website\Coveo\rest folder and open the web.config file.
    2. Replace the content of the file with the following:

       <?xml version="1.0"?>
       <configuration>
         <system.web>
           <httpRuntime maxQueryStringLength="32768" maxUrlLength="32768" />
         </system.web>
         <system.webServer>
           <handlers>
             <add name="CoveoSearchEndpoint" path="*" verb="*" type="Coveo.SearchProvider.Rest.SitecoreRestHttpHandlerDispatcher, Coveo.SearchProvider.Rest" />
           </handlers>
           <security>
             <requestFiltering>
               <requestLimits maxQueryString="32768" maxUrl="32768" />
             </requestFiltering>
           </security>
         </system.webServer>
       </configuration>