How to track app open in parse analytics using javascript?

廉价感情. 提交于 2019-12-14 03:13:53

问题


I am using parse and I want to track app open and other events. I have seen an example in their documentation

 var dimensions = {
    // Define ranges to bucket data points into meaningful segments
    priceRange: '1000-1500',
    // Did the user filter the query?
    source: 'craigslist',
    // Do searches happen more often on weekdays or weekends?
    dayType: 'weekday'
};
// Send the dimensions to Parse along with the 'search' event
Parse.Analytics.track('search', dimensions);

This updates Analytics Requests on analytics dashboard.

How can I track App Opens?


回答1:


I found the event name in documentation of REST api of analytics. So the code worked is:

Parse.Analytics.track('AppOpened', { 'user': userObj}, function(response){
    // callback function
});

You can also track custom events just with your custom event name like:

Parse.Analytics.track('CustomEvent', { 'user': userObj, 'otherInfo': otherInfo}, function(response){
    // callback function
});

You can see this in analytics tab -> events in left sidebar -> select custom breakdowns from list and you will see list of your custom events at right sidebar.




回答2:


App opens are already tracked by Parse.com if you're using their analytics functionality. In your app console on Parse.com, click Analytics at the top, Events on the right, and then in the pane with the Graph, click on the text in the rounded rectangle (that's most likely API Requests with a blue disc next to it), and change that to App Opens. You can enable the tracking with

PFAnalytics.trackAppOpenedWithLaunchOptions(launchOptions)

In your app delegate's didFinishLaunching function.



来源:https://stackoverflow.com/questions/27128048/how-to-track-app-open-in-parse-analytics-using-javascript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!