Gravatar for jasonabuck@gmail.com

Question by Jason Buck, Apr 6, 2017 1:28 PM

Javascript v1.2359.14 - Logging Query from API Call

["INFO", SearchEndpoint, "Performing REST query", Object] Logger.ts:94 
["INFO", SearchEndpoint, "REST query successful", Object, Object]
EndpointCaller.ts:278 GET https://cloudplatform.coveo.com/rest/search/alerts/subscriptions?accessToken=xxf9a0ee12-3fa3-4008-a872-cb03604c858c&page=0 403 (Forbidden)
xmlHttpRequest.onreadystatechange @ EndpointCaller.ts:278
(anonymous) @ EndpointCaller.ts:342
initializePromise @ es6-promise.js?9bb7:459
Promise @ es6-promise.js?9bb7:871
EndpointCaller.callUsingXMLHttpRequest @ EndpointCaller.ts:259
EndpointCaller.call @ EndpointCaller.ts:239
SearchEndpoint.performOneCall @ SearchEndpoint.ts:821
SearchEndpoint.listSubscriptions @ SearchEndpoint.ts:631
descriptor.value @ SearchEndpoint.ts:1040
descriptor.value @ SearchEndpoint.ts:986
descriptor.value @ SearchEndpoint.ts:1013
descriptor.value @ SearchEndpoint.ts:1068
descriptor.value @ SearchEndpoint.ts:958
SearchEndpointWithDefaultCallOptions.listSubscriptions @ SearchEndpointWithDefaultCallOptions.ts:102
(anonymous) @ SearchAlerts.ts:142
(anonymous) @ Component.ts:405
fn @ Dom.ts:457
Dom.trigger @ Dom.ts:537
QueryController.querySuccessEvent @ QueryController.ts:550
(anonymous) @ QueryController.ts:266
tryCatch @ es6-promise.js?9bb7:410
invokeCallback @ es6-promise.js?9bb7:425
publish @ es6-promise.js?9bb7:393
flush @ es6-promise.js?9bb7:121
Logger.ts:94 
["ERROR", EndpointCaller, "REST request failed", 403, Object, Object]

In Coveo Cloud v2, I have added an API Access.

I call that API Access from this page:

https://www.tsia.com/apps/coveosearch/v1.2359.14/files/cs-test1.php#t=All&sort=relevancy

The queries work fine and return results, but the search does not get logged in the activity browser.

This web page is for Anonymous users that don't have a login to my COVEO CLOUD instance to publicly search the contents of my Web Site.

The ask here is how do I track the ANONYMOUS Website user data?

1 Reply
Gravatar for sbelzile@coveo.com

Answer by Sébastien Belzile, Apr 6, 2017 1:57 PM

> search does not get logged in the activity browser

Should be the same for every Coveo site. The Activity Browser is used to browse organization activities such as a source configuration change, not queries performed against the Coveo Search API. Search activities can be browsed via the Visit Browser.

> The ask here is how do I track the ANONYMOUS Website user data?

The same way you would do for logged in users, using Coveo Analytics. You have to add a CoveoAnalytics component to your page. Since no user logs in to your site, the component should look like this:

<span class="CoveoAnalytics"
      data-anonymous="true"
      data-search-hub="PublicPage"
      ...>
Ask a question