Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme change: rebrand for live view report to events report #767

Merged
merged 2 commits into from
Dec 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ mixpanel.track("Sign Up", props);
In addition to event data, you can also send [user profile data](https://developer.mixpanel.com/docs/android#storing-user-profiles). We recommend this after completing the quickstart guide.

## 4. Check for Success
[Open up Live View in Mixpanel](http://mixpanel.com/report/live) to view incoming events.
[Open up the Events report (formerly Live View) in Mixpanel](http://mixpanel.com/report/events) to view incoming events.

Once data hits our API, it generally takes ~60 seconds for it to be processed, stored, and queryable in your project.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@

private static final String LOGTAG = "MixpanelAPI.CnctInts";
private static final int UA_MAX_RETRIES = 3;
private MPConfig mConfig;

public ConnectIntegrations(MixpanelAPI mixpanel, Context context) {
mMixpanel = mixpanel;
mContext = context;
mConfig= MPConfig.getInstance(context);
}

public void reset() {
Expand Down Expand Up @@ -92,11 +94,15 @@ private void setBrazePeopleProp() {
String externalUserId = (String) currentUser.getClass().getMethod("getUserId").invoke(currentUser);

if (deviceId != null && !deviceId.isEmpty()) {
mMixpanel.alias(deviceId, mMixpanel.getDistinctId());
if(mConfig.getBrazeIntegrationForceAlias()){
mMixpanel.alias(deviceId, mMixpanel.getDistinctId());
}
mMixpanel.getPeople().set("$braze_device_id", deviceId);
}
if (externalUserId != null && !externalUserId.isEmpty()) {
mMixpanel.alias(externalUserId, mMixpanel.getDistinctId());
if(mConfig.getBrazeIntegrationForceAlias()){
mMixpanel.alias(externalUserId, mMixpanel.getDistinctId());
}
mMixpanel.getPeople().set("$braze_external_id", externalUserId);
}
} catch (ClassNotFoundException e) {
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/mixpanel/android/mpmetrics/MPConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@
*
* <dt>com.mixpanel.android.MPConfig.NotificationChannelImportance</dt>
* <dd>An integer number. Importance of the notification channel (see https://developer.android.com/reference/android/app/NotificationManager.html). Defaults to 3 (IMPORTANCE_DEFAULT). Applicable only for Android 26 and above.</dd>
*
* <dt>com.mixpanel.android.MPConfig.BrazeIntegrationForceAlias</dt>
* <dd>A boolean value. If true, the library will alias both the braze device and external IDs (if available) to the current distinct_id when the library is initialized and the Braze integration is enabled. Defaults to false</dd>
* </dl>
*
*/
Expand Down Expand Up @@ -251,6 +254,7 @@ public synchronized void setOfflineMode(OfflineMode offlineMode) {
mUseIpAddressForGeolocation = metaData.getBoolean("com.mixpanel.android.MPConfig.UseIpAddressForGeolocation", true);
mTestMode = metaData.getBoolean("com.mixpanel.android.MPConfig.TestMode", false);
mNotificationChannelImportance = metaData.getInt("com.mixpanel.android.MPConfig.NotificationChannelImportance", 3); // NotificationManger.IMPORTANCE_DEFAULT
mBrazeIntegrationForceAlias = metaData.getBoolean("com.mixpanel.android.MPConfig.BrazeIntegrationForceAlias", false);

Object dataExpirationMetaData = metaData.get("com.mixpanel.android.MPConfig.DataExpiration");
long dataExpirationLong = 1000 * 60 * 60 * 24 * 5; // 5 days default
Expand Down Expand Up @@ -369,6 +373,10 @@ public boolean getTestMode() {
return mTestMode;
}

public boolean getBrazeIntegrationForceAlias() {
return mBrazeIntegrationForceAlias;
}

// Preferred URL for tracking events
public String getEventsEndpoint() {
return mEventsEndpoint;
Expand Down Expand Up @@ -575,6 +583,7 @@ public String toString() {
" NotificationChannelName: " + getNotificationChannelName() + "\n" +
" NotificationChannelImportance: " + getNotificationChannelImportance() + "\n" +
" FlushOnBackground: " + getFlushOnBackground() + "\n" +
" BrazeIntegrationForceAlias " + getBrazeIntegrationForceAlias() + "\n" +
" UseIpAddressForGeolocation: " + getUseIpAddressForGeolocation();
}

Expand Down Expand Up @@ -607,6 +616,7 @@ public String toString() {
private final int mNotificationChannelImportance;
private final String mNotificationChannelId;
private final String mNotificationChannelName;
private final boolean mBrazeIntegrationForceAlias;

// Mutable, with synchronized accessor and mutator
private SSLSocketFactory mSSLSocketFactory;
Expand Down