From 23ccfc845ca2350075f6027e16c6206fc7b71716 Mon Sep 17 00:00:00 2001
From: Joram Wilander <jwawilander@gmail.com>
Date: Mon, 26 Jun 2017 08:16:57 -0400
Subject: Move remaining actions over to use redux and v4 endpoints (#6720)

---
 webapp/actions/diagnostics_actions.jsx | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

(limited to 'webapp/actions/diagnostics_actions.jsx')

diff --git a/webapp/actions/diagnostics_actions.jsx b/webapp/actions/diagnostics_actions.jsx
index 4ffdfa552..72cf387b4 100644
--- a/webapp/actions/diagnostics_actions.jsx
+++ b/webapp/actions/diagnostics_actions.jsx
@@ -1,8 +1,24 @@
 // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
 // See License.txt for license information.
 
-import Client from 'client/web_client.jsx';
+import UserStore from 'stores/user_store.jsx';
 
-export function trackEvent(category, event, properties) {
-    Client.trackEvent(category, event, properties);
+export function trackEvent(category, event, props) {
+    if (global.window && global.window.analytics) {
+        const properties = Object.assign({category, type: event, user_actual_id: UserStore.getCurrentId()}, props);
+        const options = {
+            context: {
+                ip: '0.0.0.0'
+            },
+            page: {
+                path: '',
+                referrer: '',
+                search: '',
+                title: '',
+                url: ''
+            },
+            anonymousId: '00000000000000000000000000'
+        };
+        global.window.analytics.track('event', properties, options);
+    }
 }
-- 
cgit v1.2.3-1-g7c22

