Ignore Health Check User in Analytics

dialogflow
google-assistant

#1

How can you ignore the Health Check user which is the Google Assistant Crawler pinging your Action every ~5min. Is there any way to not send these Health Check requests to the analytics integrations because it adds noise to the data.

For example for the chatbase integration almost every transcript is from the health check user:

I’m adding analytics using the Jovo library:

app.use(
    new GoogleAssistant(),
    new ChatbaseGoogleAssistant()
);

Same thing for the default Dialogflow analytics, there are thousands of Default Welcome Intent invocations from the health check user:


#2

Good point. We had a skipUser functionality in v1. I put it back on the list.

A workaround, for now, could be (not properly tested)

...
const { ChatbaseGoogleAssistant } = require('jovo-analytics-chatbase');
const _get = require('lodash.get');
let oldTrackFunc = ChatbaseGoogleAssistant.prototype.track;
ChatbaseGoogleAssistant.prototype.track = function(handleRequest) {
    if (handleRequest.jovo) {
        const isHealthCheck = _get(handleRequest.jovo.$request, 'originalDetectIntentRequest.payload.inputs[0].arguments[0].name') === 'is_health_check';
        if (isHealthCheck) {
            console.log('skip');
            return;
        }
        oldTrackFunc.apply(this, [handleRequest]);
    }
};

const app = new App();
app.use(
    new GoogleAssistant(),
    new ChatbaseGoogleAssistant(),
...

#3

Thank you @AlexSwe! The workaround seems to be working.