/** * Send a detailed arbitrary analytics event, with noun/verb pairs and extra data if needed * * @param category the category of event, make your own but use a constant so reporting is good * @param action the action the user performed * @param value A value for the event, Integer.MIN_VALUE signifies caller shouldn't send the value * @param label A label for the event, may be null */ @SuppressWarnings("WeakerAccess") public static void sendAnalyticsEvent(@NonNull String category, @NonNull String action, int value, String label) { Timber.d("sendAnalyticsEvent() category/action/value/label: %s/%s/%s/%s", category, action, value, label); if (!getOptIn()) { return; } EventHit event = sAnalytics.event().eventCategory(category).eventAction(action); if (label != null) { event.eventLabel(label); } if (value > Integer.MIN_VALUE) { event.eventValue(value); } event.sendAsync(); }