I am creating an AoG app (actions on google) with Dialogflow and using Firebase functions for webhook/fulfillment. Now I want to use the power of Analytics here to collect the hits of each intent. I am using NodeJS to write functions inside Firebase. Can I use Google Analytics/Firebase Analytics in that case?
Assume this code as Firebase functions:
'use strict';
const functions = require('firebase-functions');
const app = dialogflow({debug: true});
app.intent('Ask about user', (conv) => {
conv.ask('Hi User, whats your name');
});
app.intent('user provides name', (conv, name) => {
conv.ask(`Hi ${name}, do you want to know about product, price or support?`);
});
app.intent('user select options', (conv, option) => {
if (option === 'product') {
conv.ask('Say something ...');
} else if (option === 'price') {
conv.ask('Say something else');
} else {
conv.ask('Say about support');
}
});
exports.myFunction = functions.https.onRequest(app);
Now, I want to track that how many times user provided product
, price
etc.