Modify the search function using the 'beforeInstantsearchInit' custom event.
The new function should include a condition that checks to see if the client ip is the one from your office, if yes, analytics is set to false.
For example:
const search = instantsearch({
appId: 'XXX',
apiKey: 'XXX',
indexName: 'XXX',
searchFunction: function(helper) {
if (clientMachineIp == customerIp) {
helper.setQueryParameter('analytics', false).search();
} else {
helper.search();
}
},
});
Comments
0 comments
Article is closed for comments.