Skip to content

Commit

Permalink
add app_locale meta property to mixpanel events - this is already imp…
Browse files Browse the repository at this point in the history
…lemented in the Tracks library
  • Loading branch information
maxme committed May 18, 2015
1 parent 36d60e2 commit ef3aeb6
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -17,6 +17,7 @@

import java.util.EnumMap;
import java.util.Iterator;
import java.util.Locale;
import java.util.Map;

public class AnalyticsTrackerMixpanel implements AnalyticsTracker.Tracker {
Expand All @@ -31,6 +32,7 @@ public class AnalyticsTrackerMixpanel implements AnalyticsTracker.Tracker {
private static final String JETPACK_USER = "jetpack_user";
private static final String MIXPANEL_NUMBER_OF_BLOGS = "number_of_blogs";
private static final String VERSION_CODE = "version_code";
private static final String APP_LOCALE = "app_locale";

public AnalyticsTrackerMixpanel(Context context, String token) {
mAggregatedProperties = new EnumMap<AnalyticsTracker.Stat, JSONObject>(AnalyticsTracker.Stat.class);
Expand Down Expand Up @@ -174,6 +176,7 @@ public void refreshMetadata(boolean isUserConnected, boolean isWordPressComUser,
properties.put(JETPACK_USER, isJetpackUser);
properties.put(MIXPANEL_NUMBER_OF_BLOGS, numBlogs);
properties.put(VERSION_CODE, versionCode);
properties.put(APP_LOCALE, mContext.getResources().getConfiguration().locale.toString());
mMixpanel.registerSuperProperties(properties);
} catch (JSONException e) {
AppLog.e(AppLog.T.UTILS, e);
Expand Down

0 comments on commit ef3aeb6

Please sign in to comment.