Skip to content

Commit 44c2002

Browse files
committed
Mixpanel events
1 parent c4e912d commit 44c2002

7 files changed

Lines changed: 42 additions & 12 deletions

File tree

Samples/AppKit Sample/Assets/Resources/Mixpanel.asset

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@ MonoBehaviour:
1212
m_Script: {fileID: 11500000, guid: 5e37f1d599a72b64eba3799d826c755b, type: 3}
1313
m_Name: Mixpanel
1414
m_EditorClassIdentifier:
15-
ShowDebug: 1
15+
ShowDebug: 0
1616
ManualInitialization: 0
1717
APIHostAddress: https://api.mixpanel.com/
18-
RuntimeToken:
19-
DebugToken:
20-
FlushInterval: 60
18+
FlushInterval: 10
2119
UseIpAddressForGeolocation: 1

Samples/AppKit Sample/Assets/Scripts/AppInit.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using mixpanel;
12
using Skibitsky.Unity;
23
using UnityEngine;
34
using UnityEngine.SceneManagement;
@@ -14,6 +15,7 @@ public class AppInit : MonoBehaviour
1415
private void Start()
1516
{
1617
InitDebugConsole();
18+
ConfigureMixpanel();
1719
SceneManager.LoadScene(_mainScene);
1820
}
1921

@@ -24,5 +26,18 @@ private void InitDebugConsole()
2426
_debugConsole.SetActive(true);
2527
#endif
2628
}
29+
30+
private void ConfigureMixpanel()
31+
{
32+
Application.logMessageReceived += (logString, stackTrace, type) =>
33+
{
34+
var props = new Value
35+
{
36+
["type"] = type.ToString(),
37+
["scene"] = SceneManager.GetActiveScene().name
38+
};
39+
Mixpanel.Track(logString, props);
40+
};
41+
}
2742
}
2843
}

Samples/AppKit Sample/Assets/Scripts/AppKitInit.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using mixpanel;
22
using Skibitsky.Unity;
33
using UnityEngine;
44
using UnityEngine.SceneManagement;
@@ -8,12 +8,19 @@ namespace WalletConnect.Web3Modal.Sample
88
public class AppKitInit : MonoBehaviour
99
{
1010
[SerializeField] private SceneReference _menuScene;
11-
11+
1212
private async void Start()
1313
{
1414
Debug.Log($"[AppKit Init] Initializing AppKit...");
1515
await Web3Modal.InitializeAsync();
1616

17+
var wc = WalletConnectConnector.WalletConnectInstance;
18+
if (wc is { IsInitialized: true })
19+
{
20+
var clientId = await wc.SignClient.Core.Crypto.GetClientId();
21+
Mixpanel.Identify(clientId);
22+
}
23+
1724
Debug.Log($"[AppKit Init] AppKit initialized. Loading menu scene...");
1825
SceneManager.LoadScene(_menuScene);
1926
}

Samples/AppKit Sample/Assets/UI Toolkit/Components/Resources/SettingsOverlay/SettingsOverlay.uss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
width: 100%;
1212
max-width: 300px;
1313
flex-direction: column;
14-
margin: 24 12 24 12px;
14+
padding: 24 12 24 12px;
1515
align-self: center;
1616
}
1717

Samples/AppKit Sample/Packages/manifest.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"dependencies": {
3-
"com.mixpanel.unity": "3.5.2",
3+
"com.bgtools.playerprefseditor": "1.2.2",
44
"com.skibitsky.scene-reference": "1.1.1",
55
"com.unity.ide.rider": "3.0.31",
66
"com.unity.ide.visualstudio": "2.0.22",
@@ -44,13 +44,15 @@
4444
"com.unity.modules.video": "1.0.0",
4545
"com.unity.modules.vr": "1.0.0",
4646
"com.unity.modules.wind": "1.0.0",
47-
"com.unity.modules.xr": "1.0.0"
47+
"com.unity.modules.xr": "1.0.0",
48+
"com.mixpanel.unity": "3.5.2"
4849
},
4950
"scopedRegistries": [
5051
{
5152
"name": "package.openupm.com",
5253
"url": "https://package.openupm.com",
5354
"scopes": [
55+
"com.bgtools.playerprefseditor",
5456
"com.mixpanel.unity",
5557
"com.nethereum.unity",
5658
"com.openupm",
@@ -61,4 +63,4 @@
6163
]
6264
}
6365
]
64-
}
66+
}

Samples/AppKit Sample/Packages/packages-lock.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
{
22
"dependencies": {
3+
"com.bgtools.playerprefseditor": {
4+
"version": "1.2.2",
5+
"depth": 0,
6+
"source": "registry",
7+
"dependencies": {},
8+
"url": "https://package.openupm.com"
9+
},
310
"com.mixpanel.unity": {
411
"version": "3.5.2",
512
"depth": 0,

Samples/AppKit Sample/ProjectSettings/PackageManagerSettings.asset

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ MonoBehaviour:
3030
m_Name: package.openupm.com
3131
m_Url: https://package.openupm.com
3232
m_Scopes:
33+
- com.bgtools.playerprefseditor
3334
- com.mixpanel.unity
3435
- com.nethereum.unity
3536
- com.openupm
@@ -45,6 +46,6 @@ MonoBehaviour:
4546
m_RegistryInfoDraft:
4647
m_Modified: 0
4748
m_ErrorMessage:
48-
m_UserModificationsInstanceId: -852
49-
m_OriginalInstanceId: -856
49+
m_UserModificationsInstanceId: -834
50+
m_OriginalInstanceId: -838
5051
m_LoadAssets: 0

0 commit comments

Comments
 (0)