Getting more users for your Alexa skills doesn't happen on it's own, rather it's done by establishing feedback loops and acting on them.
This can be done with relative ease by adding DynamoDB to your skill and, within the processing of utterances, find the points to appropriately write out data for future analytics.
Table creation is straight forward, and can be done through the AWS Console. When creating the table, there are only a few items required to get started. First, provide a good table name that is unique to your skill, and then set a timestamp as the primary key (as a string). You can use the default settings, or configure the capacity with the parameters below.
Within the skill we will need to add callouts to the DynamoDB API to track the analytic data. Here is the code for doing so, and you will need to change the table name and primary key to match what was provisioned in the previous step. Pick something static in the request field for each utterance so that you will have a tag that can be used to filter the data.
// create a ddb instance, and determine the current timestamp + convert to string
var db = new aws.DynamoDB();
var d = new Date().toString();
// this is what the DynamoDB call needs and will change based on table
var params = {
TableName: 'colonialBiographyTbl',
Item: { // this is a map for the noSQL data to be stored
readingTS: { S: d },
histFigure: { S: intent.slots.Name.value },
userId: { S: session.user.userId },
sessionId: { S: session.sessionId },
request: { S: "Specific User Request" }
}
};
// this is the actual call to DDB and done ahead of the callback
db.putItem(params, function(err, data) {
if (err) console.log(err); // an error occurred
else console.log("success" + data); // successful response
callback(sessionAttributes,
buildSpeechletResponse(cardTitle, speechOutput, cardOutput, repromptText, shouldEndSession));
});
Step 3 - Analyze the OutputNow after the data is stored, we can use the AWS DDB Console to query what is in the table and get real-time insights. Below is a screenshot looking at what names are being generated by the Skill based on the utterance to read a random biography.
There are an unlimited number of ways to analyze the data offline once it has been stored, ranging from dumping into a .CSV file from the console and running pivot tables in Excel, or pipelining it into S3 and using a range of analytic tools. Choose whatever works best, and act on it by enhancing your skills based on real usage data!
Comments