| | 1 | | using System.Collections.Generic; |
| | 2 | | using System.Linq; |
| | 3 | | using DCL.Interface; |
| | 4 | | using Newtonsoft.Json; |
| | 5 | |
|
| | 6 | | /// <summary> |
| | 7 | | /// For the events we use the convention of all lower cases and "_" instead of space |
| | 8 | | /// </summary> |
| | 9 | | public class Analytics : IAnalytics |
| | 10 | | { |
| | 11 | | private static bool VERBOSE = false; |
| | 12 | |
|
| | 13 | | //Remove this once environment is on its own assembly and can be accessed properly |
| | 14 | | public static IAnalytics i; |
| 2013 | 15 | | public Analytics() { i = this; } |
| | 16 | |
|
| | 17 | | public void SendAnalytic(string eventName, Dictionary<string, string> data) |
| | 18 | | { |
| 60 | 19 | | if (VERBOSE) |
| 0 | 20 | | UnityEngine.Debug.Log($"{eventName}:\n{JsonConvert.SerializeObject(data, Formatting.Indented)}"); |
| | 21 | |
|
| 60 | 22 | | SendToSegment(eventName, data); |
| 60 | 23 | | } |
| | 24 | |
|
| 329 | 25 | | internal void SendToSegment(string eventName, Dictionary<string, string> data) { WebInterface.ReportAnalyticsEvent(e |
| | 26 | |
|
| 692 | 27 | | public void Dispose() { } |
| | 28 | | } |