How do I install the Unreal plugin?

The plugin is public on GitHub under the MIT license. It is not on Fab yet. Install it from the v0.1.0 release, or clone the repository. The setup has four steps and no init call.

  1. Download the latest release from GitHub. Copy its Manalens folder into the Plugins folder of your project. Create the Plugins folder if it does not exist.
  2. 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.
  3. Open Edit, Plugins, and check that Manalens is enabled.
  4. Copy the Publishable key from your Manalens project settings, and paste it in Edit, Project Settings, Plugins, Manalens. Set the endpoint there too.

How do I start the SDK?

There is no init call. The plugin adds a game instance subsystem, UManalensSubsystem, and the engine starts it with the game instance. At start, it sends session_start and game_open with is_first_open. The Publishable key is safe to ship in a build. The plugin refuses a Secret key or an API key, and logs the reason to LogManalens.

The settings are saved in Config/DefaultGame.ini. Set Build and Storefront, so you can compare builds and stores in the reports.

Config/DefaultGame.ini

[/Script/Manalens.ManalensSettings]
PublishableKey=YOUR_PUBLISHABLE_KEY
Endpoint=https://events.manalens.dev
Build=571
Storefront=Steam

How do I track game events in Unreal?

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. Other nodes are Identify, Set Consent, Flush, Track Error, Reset, and Link URL.

In C++, add "Manalens" to PublicDependencyModuleNames in the Build.cs file of your game module, then get the subsystem from the game instance. Use flat snake_case names: level_start, level_complete, level_fail, resource, and purchase.

C++

#include "ManalensSubsystem.h"

if (UManalensSubsystem* Manalens = GetGameInstance()->GetSubsystem<UManalensSubsystem>())
{
    Manalens->Track(TEXT("level_complete"), { { TEXT("mode"), TEXT("story") } }, { { TEXT("level"), 3 }, { TEXT("score"), 1200 } }, {});
    Manalens->Identify(TEXT("player_42"), {}, {}, {});
}

How does the plugin capture errors?

The plugin sends Error lines of the engine log as error events, with the log category as the error type. Before it queues a line, it removes home folder names, URL queries, email addresses, and long tokens. Call Track Error for errors that you catch yourself. After a crash, the next launch sends app_unclean_exit.

Shipping builds compile the log out, unless your target sets bUseLoggingInShipping.

How do I check that Unreal events arrive?

The plugin sends from Play in Editor, a packaged build and a -game run. Editor and live data go to the same project, so set Build to dev for test runs and filter by build.

  • Turn on Debug to log each queued event and each failed send to LogManalens.
  • Start the game and check that game_open and session_start appear in the project activity feed, with engine unreal.
  • Quit and start again. Check that game_open has is_first_open false on the second launch.
  • Replace the test key with the production Publishable key before you ship.

Can I send events without the plugin?

A custom engine build, or a game that cannot add a plugin, can send the same app events over HTTP. Post them to /v0/events with the Publishable key and engine set to unreal. Your code then keeps the player ID, the sessions, and the queue. The blog guide has a complete C++ example.

Frequently asked questions

Which Unreal Engine versions and platforms are supported?

The plugin is for Unreal Engine 5. It is built and tested on macOS with Unreal Engine 5.8. The code for Windows, Linux, Android, and iOS is written, but those builds are not tested yet. Test your target platforms with a packaged build before you ship, and tell us what you find.

Can I use the plugin from Blueprint only?

Yes. Every call is a Blueprint node on the Manalens subsystem: Track, Identify, Set Consent, Flush, Track Error, Reset, and Link URL. The project needs one C++ class, so that the editor can build the plugin. Add it once with Tools, New C++ Class, then open the project again.

Does the plugin collect a device ID or the IP address?

No. It sends a random anonymous ID, the session ID, your user ID after Identify, the locale, and the app context: platform, engine, version, build, and storefront. It sends no device ID and no hardware details. Manalens gets the country from the request IP and does not store the IP.

What happens offline?

Events wait on disk in Saved/Manalens and are sent later. The plugin sends every 10 seconds, at 20 queued events, on focus loss, and on quit. After a network error it retries with longer waits, up to 5 minutes. Manalens accepts app events up to 7 days old, so older events are dropped.

Does the plugin run on a dedicated server?

No. The plugin stays off on a dedicated server, because a server is not a player. Send server events from your backend or your game server instead, with the Secret key and channel server. Keep the Secret key on the server, and never put it in a game build or the repository.

Sources and implementation