问题
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