Amazon Mobile Analytics(AMA) is a service provided under the aegis of the AWS Mobile Services. AMA gives complete details about the users, revenues, subscriptions, in-app behavior and more such details and allows you to view the charts in the mobile analytics console. In this post, we will let you know how to integrate your WaveMaker mobile application with Amazon Mobile Analytics service and view all the statistics regarding your mobile application.
For this post, we will track analytics of a user previously authenticated using Amazon Cognito. This will illustrate tracking the use case of "Daily Active Users". Note that it is possible to use Mobile Analytics without Cognito - but this means we cannot track Daily Active Users and other user-specific metrics.
The code used in this example is available for download here.
Steps to follow
- Setup Amazon Cognito with WaveMaker as outlined in this post.
- Navigate to https://console.aws.amazon.com/mobileanalytics/home/#/overview?consoleState=wizard.createApp
- Create a new app as shown
- Setup your WaveMaker project as outlined in Amazon Cognito setup guide.
- Download Amazon Mobile Analytics JS from https://github.com/aws/aws-sdk-mobile-analytics-js and place it in the web apps directory
- Include the relevant files in index.html ( again, as done for Amazon Cognito)
- It is now possible to use the Amazon JS SDK and make Mobile Analytics API calls to push analytics data to the dashboard.
- Run the app and then navigate to the Amazon Mobile Analytics console - you should see the analytics getting captured Note that it may take Amazon up to 60 minutes for its data to start showing up
- Refer to the JS API documentation for things like custom events and sessions: https://github.com/aws/aws-sdk-mobile-analytics-js/blob/master/README.md#additional-options
- Fairly detailed analytics reports are available if the API is used properly
Using the approach outlined above, any WaveMaker application can obtain analytics data for an application and pushed it via API calls to the Amazon Mobile Analytics dashboard.