LogoLogo
API Status
  • ๐Ÿ‘‹Welcome
  • ๐ŸŒWhat is Morpheus Platform?
    • Interoperability
  • โ„น๏ธHelp
    • ๐Ÿ“—Glossary
    • ๐Ÿ†˜Support
    • Firewall problems
    • EULA
  • CREATION
    • ๐ŸŽฎUnreal Development
      • โšกGet Started
        • โš’๏ธDownload the Editor
        • โซUpload Content
        • ๐ŸŒŽCreating your own map
        • ๐Ÿ“Morpheus Base Project
        • โ“Differences from Unreal
          • ๐ŸงCharacter Configuration
        • ๐Ÿ“กMorpheus Networking
          • Introduction to Morpheus Networking
          • Network Levels
          • Replicated Properties
          • RPCs
          • Morpheus Render Targets
          • Morpheus Array
          • Networking FAQ
          • Replicating Sublevels
      • ๐Ÿ“šFeatures & Guides
        • ๐Ÿ“’Example Plugin
          • Nameplates
          • In-game roles
          • Resizing
        • ๐ŸŠActor Pooling
        • ๐Ÿ”ŠAudio
        • ๐ŸŽญAvatars
          • Creating an Avatar
          • Attachments
            • MML Attachments
          • Custom Animation Variables
          • Importing an NFT collection
          • Capsules and Mesh Transforms
        • ๐Ÿค–Bots
        • ๐ŸŽ™๏ธChat
          • Unreal Text Chat
        • ๐ŸŽ›๏ธControl Panels
          • Control Panel Configuration
          • DJ booth mission control
          • Observer Controls
        • ๐Ÿ”‰Crowd Audio
        • ๐ŸคผCrowd Rendering
          • Legacy Animated Crowd
            • Animated Crowd Console Commands
            • Attaching static meshes to crowd members
          • Crowd Materials
          • Performance Parameters
          • Live Config Settings
          • Crowd Animation
            • Crowd Anim Blueprint
              • User Guide - Crowd Anim Blueprint
              • Reference Guide - ABP Nodes
                • Animation Playback
                • States and State Machines
                • Variables
                • Transitions
                • Special
                • Blends
                • Additional Notes
        • ๐ŸฑHelpers & Extras
          • "Instanced Objects" in Blueprints
          • Objects with "world context"
          • Making DataAsset classes
          • Duplicate Objects
          • The Bootflow Subsystem
          • The "Wait For Condition" System
          • Advanced Graphics settings
          • Listening to inputs on UObjects
          • Morpheus UserID
          • World Services
          • M2Extras: Skins System
        • ๐Ÿ–ฅ๏ธLoading Screen
        • โšกLive Config
          • Editing for a World
          • Editing Locally
          • Default Settings
          • Accessing via Blueprint
          • Adding New Settings
          • Overriding Defaults
          • Using Arrays
        • ๐ŸงŠMML
        • ๐Ÿ•บMotion Capture
        • ๐Ÿ“กNetworking
        • ๐Ÿ“ขNotifications
        • Raycastable Crowd
        • ๐ŸŒSingletons
        • ๐Ÿ“ฑStreaming & Multiplatform
          • GFN on mobile
        • ๐Ÿ–ฅ๏ธUI
          • "UI Mode"
        • ๐Ÿ—ƒ๏ธUser Collections
          • Creating a New Object Definition
          • Accessing from Unreal
            • Creating Objects Definitions
            • Transfer Objects
            • User Collection Views
            • Receiving Updates
        • ๐Ÿ“บVideo Players
          • Embedded Video Player
          • Millicast video streaming
            • How to Setup an In-Game Video Stream
            • Picture-in-Picture mode
          • Streaming Video Player
            • How to Setup a URL Video Player
            • Picture-in-Picture mode
        • ๐ŸžVisual Debugging
          • Inspector
        • ๐ŸชŸWeb UI
        • Online Services
          • KV Store Service
        • ๐Ÿ’ Web Requests
          • Http Requests
            • Legacy HTTP Nodes
          • JSON Handling
          • WebSockets
          • Identity Validation
          • Allowed External URLs
          • Walkthrough Example
            • Example Counter Service
        • โœˆ๏ธWorld Travel
          • World Travel in the editor
        • Avatar Physics Assets
        • Action Gameplay Helper Components
      • ๐Ÿ”‘Workflows
        • โ†—๏ธUpgrade the Editor
          • ๐Ÿ–ฅ๏ธVersion History
        • โš™๏ธEditing Project Settings
        • ๐Ÿ“ˆProfiling
        • ๐ŸงบMarketplace Importing
        • ๐Ÿ› ๏ธExtra Workflows
          • Setup Play-in-Editor
          • Setup Local Asset Validation
          • Adding Gameplay Tags
          • Validating Game Assets
          • Custom Connection Modes
          • Connect Editor to a World
          • Common Issues
      • ๐Ÿ“šUseful Reading
        • โญBest Practices
    • ๐ŸŒŽWorlds
      • ๐Ÿ“ฉInvite Players
        • Setting Role Groups
      • Persistent Worlds
      • Always on Worlds
    • ๐Ÿ“…Running events
      • โœ…Large scale events - Checklist
      • ๐Ÿ‘พAnti-Cheat (EAC)
      • ๐ŸŽฎPlayer Entry
        • ๐Ÿ“ฑReact Native
        • Steam
        • ๐Ÿ’ปHardware Reqs
      • ๐ŸŽฅBroadcast
        • ๐Ÿ“นOBS Integration
      • Failover
      • ๐ŸCapacity And Queue Management
  • ADMINS
    • ๐Ÿ‘ชAccess Control
      • Adding metaverse contributors
      • Creating a new project
    • ๐Ÿ’ฒPricing
      • Development Support
      • Included Usage & Overages
      • Cloud Streaming
      • Access Modes
      • War Room Support
      • Platform SLA
    • โš™๏ธSettings
      • ๐Ÿ—ƒ๏ธProjects
  • APIs and Tooling
    • ๐Ÿ–ฅ๏ธAPI Reference
      • Accounts
      • Events
      • Key/Value Store
      • Organizations
      • Realtime
      • User Profile
      • World Builder
      • Worlds
    • ๐Ÿ’ปTemplate Web App
      • ๐Ÿ’ขModeration
    • Pixel Streaming
    • ๐Ÿš€Launcher
  • Integrations
    • ๐Ÿ“ŠAnalytics
      • Sending events from web
      • ๐ŸŽฎSending Events from Unreal
    • ๐Ÿ’ฌChat
      • ๐ŸŽฎIntegrating Pubnub with your Unreal Project
      • Adding Moderation to Chat
Powered by GitBook
On this page
  • Overview
  • Setting up the SDK
  • Identifying Users and Creating User Profiles
  • Sending and Tracking Generic Events

Was this helpful?

  1. Integrations
  2. Analytics

Sending events from web

PreviousAnalyticsNextSending Events from Unreal

Last updated 6 months ago

Was this helpful?

Overview

From your web app, you can collect information to build out a user profile, as well as send custom events to your mixpanel project. This can be done by using mixpanel's SDK.

Setting up the SDK

  • npm install mixpanel-browser

Once installed, configure the SDK to start tracking events by initialising:

//Import Mixpanel SDK
import mixpanel from "mixpanel-browser";
 
// Near entry of your product, init Mixpanel
mixpanel.init("YOUR_TOKEN", {
  debug: true,
  track_pageview: true,
  persistence: "localStorage",
  // Route events from Mixpanelโ€™s SDKs via a proxy in your own domain - prevents adblockers impacting tracking.
  // See more: https://docs.mixpanel.com/docs/tracking-methods/sdks/javascript#tracking-via-proxy
  api_host: "YOUR_PROXY_URL",
});

Identifying Users and Creating User Profiles

Once this is initialized, you can identify and define attributes for users of your platform. This will populate their user profile in mixpanel, allowing you to track and gather insights on their user journeys through the platform:


const account = useAppSelector(userSelectors.getAuthUser)
const linkedEvmWallet = useAppSelector(
  userSelectors.getEvmLinkedWalletAddress,
)
const profile = useAppSelector(userSelectors.getProfile)

useEffect(() => {
  if (account?.uid) {
    mixpanel.identify(account.uid)
    mixpanel.people.set({
      $email: account.email,
      $name: profile?.username,
      $avatar: profile?.profilePictureUrl,
      // Optional: example of including a user's wallet in their user profile
      wallet: linkedEvmWallet,
      userId: account.uid,
    })

Sending and Tracking Generic Events

You are also able to track events from your web app. An example is shown below:

mixpanel.track("Joined Experience", {
      "Joined Experience Name": launchContext.worldId,
})

To start sending data, into your project:

An example of how you might want to sync user profile data to mixpanel can be found in our . You can also follow mixpanel's documentation on .

You can follow to learn more about how to send web events from your web application.

๐Ÿ“Š
install the SDK
mixpanel repository
identifying users
mixpanel's documentation