Permalink
Browse files

Track actions on the twunch details screen.

  • Loading branch information...
1 parent 6bbcdbe commit bc8568bc261c6f707a97029ee690c83db647e1d9 @litrik committed Mar 3, 2012
@@ -188,6 +188,8 @@ public void onClick(View v) {
@Override
public void onClick(View v) {
try {
+ GoogleAnalyticsTracker.getInstance().trackEvent(AnalyticsUtils.EventCategories.TWUNCH_DETAILS,
+ AnalyticsUtils.EventActions.ADD_TO_CALENDAR, null, 1);
Intent intent = new Intent(Intent.ACTION_INSERT)
.setData(Events.CONTENT_URI)
.putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, cursor.getLong(TwunchDetailsQuery.DATE))
@@ -236,6 +238,8 @@ public void onLoaderReset(Loader<Cursor> loader) {
* Show the location of this Twunch on a map.
*/
private void doMap() {
+ GoogleAnalyticsTracker.getInstance().trackEvent(AnalyticsUtils.EventCategories.TWUNCH_DETAILS,
+ AnalyticsUtils.EventActions.SHOW_MAP, null, 1);
final Intent myIntent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("http://maps.google.com/maps?q="
+ mCursor.getDouble(TwunchDetailsQuery.LATITUDE) + "," + mCursor.getDouble(TwunchDetailsQuery.LONGITUDE)));
startActivity(myIntent);
@@ -245,6 +249,8 @@ private void doMap() {
* Show the directions to this Twunch.
*/
private void doDirections() {
+ GoogleAnalyticsTracker.getInstance().trackEvent(AnalyticsUtils.EventCategories.TWUNCH_DETAILS,
+ AnalyticsUtils.EventActions.SHOW_DIRECTIONS, null, 1);
startActivity(new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("google.navigation:q="
+ mCursor.getDouble(TwunchDetailsQuery.LATITUDE) + "," + mCursor.getDouble(TwunchDetailsQuery.LONGITUDE))));
}
@@ -265,6 +271,8 @@ public void onClick(DialogInterface dialog, int id) {
builder.create().show();
} else {
+ GoogleAnalyticsTracker.getInstance().trackEvent(AnalyticsUtils.EventCategories.TWUNCH_DETAILS,
+ AnalyticsUtils.EventActions.REGISTER, null, 1);
final Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(
@@ -280,6 +288,9 @@ public void onClick(DialogInterface dialog, int id) {
* Share information about this Twunch.
*/
private void doShare() {
+ GoogleAnalyticsTracker.getInstance().trackEvent(AnalyticsUtils.EventCategories.TWUNCH_DETAILS,
+ AnalyticsUtils.EventActions.SHARE, null, 1);
+
final Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, String.format(
@@ -28,4 +28,16 @@
public static final String WHATS_NEW = "WhatsNew";
}
+ public interface EventCategories {
+ public static final String TWUNCH_DETAILS = "TwunchDetails";
+ }
+
+ public interface EventActions {
+ public static final String SHOW_MAP = "ShowMap";
+ public static final String SHOW_DIRECTIONS = "ShowDirections";
+ public static final String ADD_TO_CALENDAR = "AddToCalendar";
+ public static final String SHARE = "Share";
+ public static final String REGISTER = "Register";
+ }
+
}

0 comments on commit bc8568b

Please sign in to comment.