This package has been deprecated

Author message:

this package has been deprecated

opearlo-analytics

0.2.5 • Public • Published

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');
});

Readme

Keywords

Package Sidebar

Install

npm i opearlo-analytics

Weekly Downloads

2

Version

0.2.5

License

MIT

Last publish

Collaborators

  • opearlo