| | 1 | | using System.Collections; |
| | 2 | | using System.Collections.Generic; |
| | 3 | | using DCL; |
| | 4 | | using DCL.Controllers; |
| | 5 | | using UnityEngine; |
| | 6 | |
|
| | 7 | | public static class AnalyticsHelper |
| | 8 | | { |
| | 9 | | public static void AddSceneNameAndBasePositionToDictionary(Dictionary<string, string> analyticDict) |
| | 10 | | { |
| 3 | 11 | | string sceneId = Environment.i.world.state.currentSceneId; |
| 3 | 12 | | if (!string.IsNullOrEmpty(sceneId)) |
| | 13 | | { |
| 0 | 14 | | analyticDict.Add("parcel", Environment.i.world.state.loadedScenes[sceneId].sceneData.basePosition.x + "," + |
| 0 | 15 | | analyticDict.Add("scene", sceneId); |
| | 16 | | } |
| 3 | 17 | | } |
| | 18 | |
|
| | 19 | | public static void SendVoiceChatStartedAnalytic() |
| | 20 | | { |
| 0 | 21 | | Dictionary<string, string> eventToSend = new Dictionary<string, string>(); |
| 0 | 22 | | AddSceneNameAndBasePositionToDictionary(eventToSend); |
| 0 | 23 | | IAnalytics analytics = Environment.i.platform.serviceProviders.analytics; |
| 0 | 24 | | analytics.SendAnalytic("voice_chat_start_recording", eventToSend); |
| 0 | 25 | | } |
| | 26 | |
|
| | 27 | | public static void SendExternalLinkAnalytic(string url, string nftToken) |
| | 28 | | { |
| 3 | 29 | | Dictionary<string, string> eventToSend = new Dictionary<string, string>(); |
| 3 | 30 | | eventToSend.Add("url", url); |
| 3 | 31 | | if (nftToken != null) |
| 0 | 32 | | eventToSend.Add("nft_token_id", nftToken); |
| 3 | 33 | | AddSceneNameAndBasePositionToDictionary(eventToSend); |
| 3 | 34 | | IAnalytics analytics = Environment.i.platform.serviceProviders.analytics; |
| 3 | 35 | | analytics.SendAnalytic("external_link_open", eventToSend); |
| 3 | 36 | | } |
| | 37 | |
|
| 6 | 38 | | public static void SendExternalLinkAnalytic(string url) { SendExternalLinkAnalytic(url, null); } |
| | 39 | | } |