[TIMOB-17174]Upgrade Analytics to use the new API.

Upgrading to the new API for analytics.

Detailed test case in [jira](https://jira.appcelerator.org/browse/TIMOB-17174?focusedCommentId=310319&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-310319)