@real2u/analytics
v1.1.0
Published
Real-time data processing analytics
Downloads
8
Readme
Analytics
Real-time data processing analytics
Based on https://aws.amazon.com/getting-started/projects/build-serverless-real-time-data-processing-app-lambda-kinesis-s3-dynamodb-cognito-athena/4/
Example
// initalize
const analytics = new Analytics({
cognito: {
identityPoolId: 'us-east-1:abcdefab-abcd-abcd-abcd-abcdefabcdef'
},
kinesis: {
streamName: 'AnalyticsStream'
}
})
// set dimension values
analytics.set('sku', 'RE000001')
// predefined metric
analytics.send({
[analytics.dimensions.add_to_cart]: 1
})
// custom metric
analytics.send({
'element': 'color_button',
'click': 1
})