Coveo for Sitecore 5 is now available!

Send Analytics to Sitecore Component Not Working in Sitecore 9

Coveo for Sitecore 4.1 (February 2019)

Symptoms

When using the Send Analytics to Sitecore component in a Coveo search page in Sitecore 9, you get the following error message on a searchFromLink event:

Server Error in '/' Application.
Precondition failed: The parameter 'p_EventData' must not be null
Parameter name: p_EventData
Description: An unhandled exception occurred.
Exception Details: System.ArgumentNullException: Precondition failed: The parameter 'p_EventData' must not be null
Parameter name: p_EventData
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentNullException: Precondition failed: The parameter 'p_EventData' must not be null
Parameter name: p_EventData]
Coveo.Framework.CNL.Precondition.NotNull(Object p_Parameter, String p_ParameterName) +181
Coveo.Framework.CNL.Precondition.NotNull(Object p_Parameter, Func`1 p_ParameterExpression) +27
Coveo.Analytics.Events.SqlEventTracker.Track(PageEventData p_EventData) +162
Coveo.Analytics.xDB.Processors.HandleSitecoreSearchEventProcessor.Process(CoveoAnalyticsPipelineArgs p_Args) +333

Cause

A Coveo.Analytics.xDB.config patch command is not applied because configuration files are not loaded in the proper order.

Resolution

The issue has been corrected in the February 2019 version of Coveo for Sitecore 4.1 by moving the Coveo.Analytics.xDB.config file into a new Analytics sub-folder.

Workaround

If you do not wish to upgrade to the February 2019 version of Coveo for Sitecore 4.1 right now, you can perform the following steps to have the Coveo.Analytics.xDB.config file load at the right moment in the configuration file loading sequence:

  1. In a file explorer window, open the [Your Sitecore Instance]\App_Config\Modules\Coveo folder.
  2. Create a sub-folder called Analytics. It must be called Analytics exactly to avoid issues during a future upgrade.
  3. Select and cut the following files from the [Your Sitecore Instance]\App_Config\Modules\Coveo folder:
    • Coveo.Analytics.XConnect.config.disabled
    • Coveo.Analytics.xDB.config
  4. Paste the files in the [Your Sitecore Instance]\App_Config\Modules\Coveo\Analytics folder.