讓我們通過點擊mTrackerButton說用戶subit形式:
mTrackButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SendEventGoogleAnalytics("FormEvent", "cityName",
variableNameYouWantToSend);
}
});
下面是你需要在活動的地方
private void InitGoogleAnalytics() {
mGoogleHelper = new GoogleAnalyticsHelper();
mGoogleHelper.init(MainActivity.this);
}
private void SendScreenNameGoogleAnalytics() {
mGoogleHelper.SendScreenNameGoogleAnalytics("MainActivity", MainActivity.this);
}
private void SendEventGoogleAnalytics(String iCategoryId, String iActionId, String iLabelId) {
mGoogleHelper.SendEventGoogleAnalytics(MainActivity.this, iCategoryId, iActionId, iLabelId);
}
謝謝你的建議的API – PPD 2015-02-23 12:36:57