Pages

22 September, 2025

Resolution - Coveo for Sitecore - {"message":"Parameter 'viewEvent.referrer' is not a valid URI.","type":"InvalidParameter"}

In the previous blog post (Coveo for Sitecore - {"message":"Parameter 'viewEvent.referrer' is not a valid URI.","type":"InvalidParameter"}), I explained about a bad request error when Coveo Analytics requests were sent from Sitecore. 

As per Mozilla developer document, the HTTP Referer request header contains the absolute or partial address from which a resource has been requested. The Referer header allows a server to identify referring pages that people are visiting from or where requested resources are being used. This data can be used for analytics, logging, optimized caching, and morehttps://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Referer

Even though, the android-app://com.google.android.googlequicksearchbox/ referrer is a valid URI, Coveo needs a URL. All URLs are URIs, but not all URIs are URLs; a URL is a subset of the broader URI category, which also includes URNs (Uniform Resource Names). Since Coveo support mentioned that they cannot change the logic at their side to accept the URI, we are left out with an option to override it in the source. 

As this is a Coveo Hive implementation, modifying the Coveo UA library script is not possible. When the View analytics is sent using UA library in Hive implementation, there is a section where we can override this value.


Before sending the view analytics data, we checked if the referrer is having problematic referrer, then we will just override it with custom value (like www.google.com as it is from Google app). Once this change is implemented, we were able to see success response instead of bad request from Coveo. 

Even Coveo support is left with only this option as the UA library cannot be updated. 

I hope it can be helpful for the folks in Coveo/Sitecore community. 

blockquote { margin: 0; } blockquote p { padding: 15px; background: #eee; border-radius: 5px; } blockquote p::before { content: '\201C'; } blockquote p::after { content: '\201D'; }