Installation
The source is public on GitHub (MIT). The plugin is not on Fab yet.
- Download the latest release. Copy its
Manalensfolder into thePlugins/folder of your project. CreatePlugins/if it does not exist. - Open the project. The editor builds the plugin. A Blueprint-only project needs one C++ class first: use Tools > New C++ Class, then open the project again.
- Open Edit > Plugins and check that Manalens is enabled.
- Copy the Publishable key (
mana_pk_) from Settings. The plugin refuses a Secret key or an API key.
Settings
Open Edit > Project Settings > Plugins > Manalens and set the Publishable key and the endpoint. The engine starts the SDK with the game instance, so there is no init call. At start, the SDK sendssession_start and game_open with is_first_open and first_open_at.
The settings are saved in Config/DefaultGame.ini:
If the key or the endpoint is wrong, the SDK logs why to
LogManalens and stays off.
Track events
In Blueprint, use the Get ManalensSubsystem node, then Track. Track takes the event name and three maps: text, numbers, and true or false values. Leave a map empty when you do not need it. In C++, get the subsystem from the game instance:"Manalens" to PublicDependencyModuleNames in the Build.cs file of your game module. To send a JSON object, use TrackJson(). Values are strings, numbers, booleans, or null. Other values are dropped with a warning. Use the event conventions.
From any object with a world, UManalensSubsystem::Get(this) returns the subsystem. Call the SDK on the game thread. A Track or Track Error call from another thread runs on the game thread later.
Identify players
On sign-in, call Identify with your user ID to join this install’s history to the player. On sign out, call Reset.Open your website from the game
Use Link URL when the game opens your website. The website then joins this player, without Identify:mana_hid=<anonymous ID>.<unix seconds> to the URL. The website needs the Web SDK. The link works for 10 minutes. Before consent, the URL is unchanged.
Error tracking
Error lines of the engine log (UE_LOG) as error events, with the log category as error_type. Shipping builds compile the log out, unless your target sets bUseLoggingInShipping. After a crash, the next launch sends app_unclean_exit. See Error tracking.
Before the SDK queues a log line, it removes personal data:
- Home folders, such as
/Users/<name>,/home/<name>, andC:\Users\<name>, become~. - URLs lose the user name and password, the query string, and the fragment.
- Email addresses become
[email]. - Values after
key=,token=,secret=,password=,Authorization:, andBearer, and runs of 24 or more letters, digits,_, or-, become[redacted].
LogOnline*, LogEOS*, LogSteamShared, LogSlate, LogHttp, or LogManalens. In the editor (Play In Editor), it also skips the categories of editor modules, because the editor logs in the same process as your game: LogBlueprint (the Blueprint compiler), LogEditor*, LogUnrealEd, LogShaderCompilers, LogDerivedDataCache, LogSourceControl, LogCook*, LogAutomation*, and other editor tools. Errors of your Blueprints at run time (LogScript, Print String) are still sent. A packaged game skips none of them. The text of a Track Error call is sent as you give it.
The limits are the same as in the other SDKs: one fingerprint at most once a second, at most 20 errors in 10 seconds, and at most Max Auto Errors Per Session log errors in one session.
Editor runs
Play in Editor sends events like a live game, so you can watch your integration in Activity and Live View while you play. A packaged build and a-game run always send. To send nothing from the editor, turn off Enabled In Editor.
Dev and live data go to the same project. Play in Editor runs send Editor Build (default dev) in place of Build, so you can filter them out. To tell other test builds apart, set Build (for example dev) and filter by it. Each developer machine counts as one player, and your game’s errors in Play in Editor appear in error tracking. The editor’s own errors are not sent (see Error tracking).
Unsent events stay on disk (Saved/Manalens/) and go out at the next launch with that launch’s publishable key. If the key changes between launches (for example a dev key, then a release key), the queued events go to the new key’s project. They keep the Build they were sent with, so you can still filter them out.
Events
Both are Blueprint events on the subsystem. In C++, use
OnSendFailed.AddDynamic().
Sessions
A session ends after 30 minutes without focus or events, and at 24 hours. Then the SDK sendssession_end (duration_s) and starts a new one. After a crash with focus, the next launch ends the old session and sends app_unclean_exit. A mobile game that the OS closes in the background is not a crash. Focus loss and the move to the background save the state and send the queue.
To put a server event (for example a purchase) in the player’s session, send Get Session Id and Get Anonymous Id to your backend.
Offline queue and retries
- Events are saved in
Saved/Manalens. They are sent every 10 seconds, at 20 events, on focus loss, and on quit. - Network errors,
5xx,408, and429are retried with backoff (2, 4, 8 … seconds, at most 5 minutes). ARetry-Afterheader asks for a longer wait, up to 1 hour. Other4xxdrop the batch and log the reason. A202can list refused events: the collector stored the others, and the SDK drops the refused ones, logs the reason codes, and raises On Send Failed with their count. - Events older than 7 days are dropped.
- A retry never counts twice, because each event keeps its
message_id.
Quit
When the game instance shuts down, the SDK sendssession_end and waits at most Quit Timeout Seconds for the last send. Unsent events stay on disk for the next launch.
Consent
Turn on Consent Required. Then, from your consent screen:false) writes a marker file (Saved/Manalens/manalens_optout), and the SDK stays off while it exists. If the saved state cannot be read, the SDK stays off until Set Consent (true).
Data the SDK sends
Each event carriesanonymous_id (a random UUID kept in Saved/Manalens), session_id, user_id after Identify, context.locale, context.utc_offset, and context.app:
platform:windows,macos,linux,android,ios, orother(consoles, tvOS, visionOS).engine:unreal.app_version,build, andstorefront.
Test locally
From the repository, build the plugin with the engine and run its automation tests headless:RunUAT BuildPlugin, copies the plugin into sdks/unreal/HostProject, and runs Automation RunTests Manalens.
FAQ
Can I use it from Blueprint only?
Can I use it from Blueprint only?
Yes. Every call is a Blueprint node on the Manalens subsystem. The project needs one C++ class so that the editor can build the plugin.
How do I keep editor and test runs out of my reports?
How do I keep editor and test runs out of my reports?
Dev and live data go to the same project. Set Build (for example
dev) for those runs and filter by it. See Editor runs.What happens when the player is offline?
What happens when the player is offline?
Events wait on disk and are sent later. See offline queue and retries.
Can I ask for consent before I track?
Can I ask for consent before I track?
Yes, with Consent Required. See consent.
Does it run on a dedicated server?
Does it run on a dedicated server?
No. The SDK stays off on a dedicated server, because a server is not a player. Send server events from your backend instead.