@@ -42,6 +42,11 @@ public class MixpanelDispatcher implements BatchEventDispatcher
4242 */
4343 private static final String BATCH_TRACKING_ID = "batch_tracking_id" ;
4444
45+ /**
46+ * Key used to dispatch the webview click analytics ID
47+ */
48+ private static final String BATCH_WEBVIEW_ANALYTICS_ID = "batch_webview_analytics_id" ;
49+
4550 /**
4651 * Event name used when logging on Mixpanel
4752 */
@@ -51,7 +56,9 @@ public class MixpanelDispatcher implements BatchEventDispatcher
5156 private static final String MESSAGING_SHOW_NAME = "batch_in_app_show" ;
5257 private static final String MESSAGING_CLOSE_NAME = "batch_in_app_close" ;
5358 private static final String MESSAGING_AUTO_CLOSE_NAME = "batch_in_app_auto_close" ;
59+ private static final String MESSAGING_CLOSE_ERROR_NAME = "batch_in_app_close_error" ;
5460 private static final String MESSAGING_CLICK_NAME = "batch_in_app_click" ;
61+ private static final String MESSAGING_WEBVIEW_CLICK_NAME = "batch_in_app_webview_click" ;
5562 private static final String UNKNOWN_EVENT_NAME = "batch_unknown" ;
5663
5764 MixpanelAPI mixpanelInstance = null ;
@@ -112,6 +119,11 @@ private static Map<String, Object> getInAppParams(Batch.EventDispatcher.Payload
112119 mixpanelParams .put (MEDIUM , "in-app" );
113120 mixpanelParams .put (BATCH_TRACKING_ID , payload .getTrackingId ());
114121
122+ String webViewAnalyticsId = payload .getWebViewAnalyticsID ();
123+ if (webViewAnalyticsId != null ) {
124+ mixpanelParams .put (BATCH_WEBVIEW_ANALYTICS_ID , webViewAnalyticsId );
125+ }
126+
115127 String deeplink = payload .getDeeplink ();
116128 if (deeplink != null ) {
117129 deeplink = deeplink .trim ();
@@ -229,8 +241,12 @@ private static String getMixpanelEventName(Batch.EventDispatcher.Type type) {
229241 return MESSAGING_CLOSE_NAME ;
230242 case MESSAGING_AUTO_CLOSE :
231243 return MESSAGING_AUTO_CLOSE_NAME ;
244+ case MESSAGING_CLOSE_ERROR :
245+ return MESSAGING_CLOSE_ERROR_NAME ;
232246 case MESSAGING_CLICK :
233247 return MESSAGING_CLICK_NAME ;
248+ case MESSAGING_WEBVIEW_CLICK :
249+ return MESSAGING_WEBVIEW_CLICK_NAME ;
234250 }
235251 return UNKNOWN_EVENT_NAME ;
236252 }
0 commit comments