| | 1 | | using System.Collections.Generic; |
| | 2 | |
|
| | 3 | | namespace DCL.MyAccount |
| | 4 | | { |
| | 5 | | public class MyAccountAnalyticsService : IMyAccountAnalyticsService |
| | 6 | | { |
| | 7 | | private const string PLAYER_SWAP_NAME = "player_swap_name"; |
| | 8 | | private const string PLAYER_OPEN_CLAIM_NAME = "player_open_claim_name"; |
| | 9 | | private const string WALLET_BUY_ETHEREUM_MANA = "player_wallet_buy_mana"; |
| | 10 | | private const string PROFILE_INFO_EDIT = "profile_info_edit"; |
| | 11 | | private const string PROFILE_INFO_ADDITIONAL_INFO_ADD = "profile_info_additional_info_add"; |
| | 12 | | private const string PROFILE_INFO_ADDITIONAL_INFO_REMOVE = "profile_info_additional_info_remove"; |
| | 13 | | private const string PROFILE_LINK_ADD = "profile_link_add"; |
| | 14 | | private const string PROFILE_LINK_REMOVE = "profile_link_remove"; |
| | 15 | |
|
| | 16 | | private readonly IAnalytics analytics; |
| | 17 | |
|
| 0 | 18 | | public MyAccountAnalyticsService(IAnalytics analytics) |
| | 19 | | { |
| 0 | 20 | | this.analytics = analytics; |
| 0 | 21 | | } |
| | 22 | |
|
| | 23 | | public void SendPlayerSwapNameAnalytic(bool claimed, int totalNames) |
| | 24 | | { |
| 0 | 25 | | Dictionary<string, string> data = new Dictionary<string, string> |
| | 26 | | { |
| | 27 | | { "claimed", claimed.ToString() }, |
| | 28 | | { "total_names", totalNames.ToString() }, |
| | 29 | | }; |
| | 30 | |
|
| 0 | 31 | | analytics.SendAnalytic(PLAYER_SWAP_NAME, data); |
| 0 | 32 | | } |
| | 33 | |
|
| | 34 | | public void SendPlayerOpenClaimNameAnalytic() |
| | 35 | | { |
| 0 | 36 | | analytics.SendAnalytic(PLAYER_OPEN_CLAIM_NAME, null); |
| 0 | 37 | | } |
| | 38 | |
|
| | 39 | | public void SendPlayerWalletBuyManaAnalytic(bool isPolygonNetwork) |
| | 40 | | { |
| 0 | 41 | | Dictionary<string, string> data = new Dictionary<string, string> |
| | 42 | | { |
| | 43 | | { "is_polygon_network", isPolygonNetwork.ToString() }, |
| | 44 | | }; |
| | 45 | |
|
| 0 | 46 | | analytics.SendAnalytic(WALLET_BUY_ETHEREUM_MANA, data); |
| 0 | 47 | | } |
| | 48 | |
|
| | 49 | | public void SendProfileInfoEditAnalytic(int lenght) |
| | 50 | | { |
| 0 | 51 | | Dictionary<string, string> data = new Dictionary<string, string> |
| | 52 | | { |
| | 53 | | { "lenght", lenght.ToString() }, |
| | 54 | | }; |
| | 55 | |
|
| 0 | 56 | | analytics.SendAnalytic(PROFILE_INFO_EDIT, data); |
| 0 | 57 | | } |
| | 58 | |
|
| | 59 | | public void SendProfileInfoAdditionalInfoAddAnalytic(string type, string value) |
| | 60 | | { |
| 0 | 61 | | Dictionary<string, string> data = new Dictionary<string, string> |
| | 62 | | { |
| | 63 | | { "type", type }, |
| | 64 | | { "value", value }, |
| | 65 | | }; |
| | 66 | |
|
| 0 | 67 | | analytics.SendAnalytic(PROFILE_INFO_ADDITIONAL_INFO_ADD, data); |
| 0 | 68 | | } |
| | 69 | |
|
| | 70 | | public void SendProfileInfoAdditionalInfoRemoveAnalytic(string type) |
| | 71 | | { |
| 0 | 72 | | Dictionary<string, string> data = new Dictionary<string, string> |
| | 73 | | { |
| | 74 | | { "type", type }, |
| | 75 | | }; |
| | 76 | |
|
| 0 | 77 | | analytics.SendAnalytic(PROFILE_INFO_ADDITIONAL_INFO_REMOVE, data); |
| 0 | 78 | | } |
| | 79 | |
|
| | 80 | | public void SendProfileLinkAddAnalytic(string name, string url) |
| | 81 | | { |
| 0 | 82 | | Dictionary<string, string> data = new Dictionary<string, string> |
| | 83 | | { |
| | 84 | | { "name", name }, |
| | 85 | | { "url", url }, |
| | 86 | | }; |
| | 87 | |
|
| 0 | 88 | | analytics.SendAnalytic(PROFILE_LINK_ADD, data); |
| 0 | 89 | | } |
| | 90 | |
|
| | 91 | | public void SendProfileLinkRemoveAnalytic(string name, string url) |
| | 92 | | { |
| 0 | 93 | | Dictionary<string, string> data = new Dictionary<string, string> |
| | 94 | | { |
| | 95 | | { "name", name }, |
| | 96 | | { "url", url }, |
| | 97 | | }; |
| | 98 | |
|
| 0 | 99 | | analytics.SendAnalytic(PROFILE_LINK_REMOVE, data); |
| 0 | 100 | | } |
| | 101 | | } |
| | 102 | | } |