0.2.5 • Published 7 years ago

opearlo-analytics v0.2.5

Weekly downloads
18
License
MIT
Repository
-
Last release
7 years ago

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

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago