diff --git a/src/main/java/com/mixpanel/android/mpmetrics/MixpanelAPI.java b/src/main/java/com/mixpanel/android/mpmetrics/MixpanelAPI.java index ec49e92a..6f493c82 100644 --- a/src/main/java/com/mixpanel/android/mpmetrics/MixpanelAPI.java +++ b/src/main/java/com/mixpanel/android/mpmetrics/MixpanelAPI.java @@ -582,28 +582,28 @@ public void setServerURL(String serverURL) { public Boolean getTrackAutomaticEvents() { return mTrackAutomaticEvents; } /** - * This function creates a distinct_id alias from alias to original. If original is null, then it will create an alias + * This function creates a distinct_id alias from alias to distinct_id. If distinct_id is null, then it will create an alias * to the current events distinct_id, which may be the distinct_id randomly generated by the Mixpanel library * before {@link #identify(String)} is called. * *

This call does not identify the user after. You must still call {@link #identify(String)} if you wish the new alias to be used for Events and People. * - * @param alias the new distinct_id that should represent original. - * @param original the old distinct_id that alias will be mapped to. + * @param alias the new value that should represent distinct_id. + * @param distinct_id the old distinct_id that alias will be mapped to. */ - public void alias(String alias, String original) { + public void alias(String alias, String distinct_id) { if (hasOptedOutTracking()) return; - if (original == null) { - original = getDistinctId(); + if (distinct_id == null) { + distinct_id = getDistinctId(); } - if (alias.equals(original)) { + if (alias.equals(distinct_id)) { MPLog.w(LOGTAG, "Attempted to alias identical distinct_ids " + alias + ". Alias message will not be sent."); return; } try { final JSONObject j = new JSONObject(); j.put("alias", alias); - j.put("original", original); + j.put("distinct_id", distinct_id); track("$create_alias", j); } catch (final JSONException e) { MPLog.e(LOGTAG, "Failed to alias", e);