Parse - ParseAnalytics

摘要:Parse - ParseAnalytics

ParseAnalytics有相關文件與空白專案可以下載

https://www.parse.com/apps/quickstart#analytics/mobile/android/native/new

有興趣可以自行研究參考,

 

而我這裡只是做筆記,將空白專案的相關設定程式碼貼上來做記錄。

 

先製作Application,而ParseACL,是做Parse的預設權限設定,以下設定為預設資料為公開唯讀(只有本人可以寫入他自己的新增物件,但其它人只能讀取)

package com.parse.starter;

import android.app.Application;

import com.parse.Parse;
import com.parse.ParseACL;
import com.parse.ParseUser;

public class ParseApplication extends Application {

  @Override
  public void onCreate() {
    super.onCreate();

    // Add your initialization code here
    Parse.initialize(this, YOUR_APPLICATION_ID, YOUR_CLIENT_KEY);


    ParseUser.enableAutomaticUser();
    ParseACL defaultACL = new ParseACL();
      
    // If you would like all objects to be private by default, remove this line.
    defaultACL.setPublicReadAccess(true);
    
    ParseACL.setDefaultACL(defaultACL, true);
  }
}

再來是Activity如何使用 ParseAnalytics

package com.parse.starter;

import android.app.Activity;
import android.os.Bundle;

import com.parse.ParseAnalytics;

public class ParseStarterProjectActivity extends Activity {
	/** Called when the activity is first created. */
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		ParseAnalytics.trackAppOpened(getIntent());
	}
}

根據一開始的how it works,大概用下列方式記錄一些事件,以下範例,應該是搜尋關鍵字的記錄

https://www.parse.com/products/analytics#howitworks

Map dimensions = new HashMap();
dimensions.put("priceRange", "1000-1500");
dimensions.put("customerType", "renter");
dimensions.put("age", "22-25");
 
// Send the dimensions to Parse along with the 'search' event
ParseAnalytics.trackEvent("search", dimensions);

 

Analytics 的如何撰寫程式的文章有下方連結

https://www.parse.com/docs/android_guide#analytics-custom

 

Analytics

Parse provides a number of hooks for you to get a glimpse into the ticking heart of your app. We understand that it's important to understand what your app is doing, how frequently, and when.

While this section will cover different ways to instrument your app to best take advantage of Parse's analytics backend, developers using Parse to store and retrieve data can already take advantage of metrics on Parse.

Without having to implement any client-side logic, you can view real-time graphs and breakdowns (by device type, Parse class name, or REST verb) of your API Requests in your app's dashboard and save these graph filters to quickly access just the data you're interested in.

啟動方式

ParseAnalytics.trackAppOpened(getIntent());

 

有個關鍵描敘

Note that Parse currently only stores the first eight dimension pairs per call to ParseAnalytics.trackEvent()

應該只能存八個維度的事件記錄

 

Anatlyics 依照官網所說的,應該是免費

https://parse.com/plans