Opearlo Analytics
Track the usage of your Alexa Voice Apps
https://analytics.opearlo.com/
1. Initialize Analytics
// Initialize Analytics on New Session
if(event.session.new) {
OpearloAnalytics.initializeAnalytics(OPEARLO_USER_ID, OPEARLO_VOICE_APP_NAME, event.session);
}
2. Track Voice Events
// All Alexa Intents
if(event.request.type === 'IntentRequest') {
OpearloAnalytics.registerVoiceEvent(event.session.user.userId, 'IntentRequest', event.request.intent);
}
// Launch Requests
if(event.request.type === 'LaunchRequest') {
OpearloAnalytics.registerVoiceEvent(event.session.user.userId, 'LaunchRequest');
}
// Custom Voice Events
OpearloAnalytics.registerVoiceEvent(this.event.session.user.userId, 'Custom', 'YOUR_CUSTOM_EVENT_NAME');
// Custom Voice Event Variables
OpearloAnalytics.registerVoiceEvent(this.event.session.user.userId, 'Custom', 'YOUR_CUSTOM_EVENT_NAME', {
'variableName' : 'variableValue'
});
3. Record Analytics
REMEMBER - This method is asynchronus so you must delay sending the response until it has completed.
// This code needs to run in any response function that is going to end the session.
OpearloAnalytics.recordAnalytics(this.event.session.user.userId, OPEARLO_API_KEY, (error, result) => {
this.emit(':tell', 'YOUR_GOODBYE_MESSAGE');
});