Skip to content

Commit e55be15

Browse files
committed
fix: fixed analytics endpoint for coveo
1 parent a6f7d1c commit e55be15

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

assets/js/coveo.js

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ document.addEventListener('DOMContentLoaded', async function () {
1111
const searchObj = await getsearchObj()
1212
Coveo.SearchEndpoint.configureCloudV2Endpoint(searchObj.org_id, searchObj.token, `https://${searchObj.org_id}.org.coveo.com/rest/search`);
1313

14+
const analyticsElement = document.querySelector('.CoveoAnalytics');
15+
if (analyticsElement) {
16+
const analyticsEndpoint = `https://${searchObj.org_id}.analytics.org.coveo.com/rest/ua`;
17+
analyticsElement.setAttribute('data-endpoint', analyticsEndpoint);
18+
}
19+
1420
const root = document.getElementById("search");
1521
const searchBoxRoot = document.getElementById("searchbox");
1622
Coveo.initSearchbox(searchBoxRoot, "/search.html");

0 commit comments

Comments
 (0)