Advertisement
Guest User

Untitled

a guest
Sep 1st, 2014
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.69 KB | None | 0 0
  1. Map<String, String> dimensions = new HashMap<String, String>();
  2. dimensions.put("instant", "afterMatch");
  3. trackEvent(EVENT_FRIENDS_ADD, dimensions);
  4.  
  5. /* .... */
  6.  
  7. public static void trackEvent(String evType, Map<String, String> evDim) {
  8.        
  9.         Date now = new Date();
  10.         Map<String, String> commonDim = new HashMap<String, String>();
  11.         commonDim.put("locale", GeneralUtils.getLanguageISO());
  12.         commonDim.put("weekday", GeneralUtils.getWeekPeriod(now));
  13.         commonDim.put("timeOfTheDay", GeneralUtils.getDayPeriod(now));
  14.        
  15.         if (evDim == null) evDim = new HashMap<String, String>();
  16.         evDim.putAll(commonDim);
  17.        
  18.         ParseAnalytics.trackEvent(evType, evDim); // sometimes this throws the exception
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement