| [ Web Proxy ] |
| Viewing: https://www.docs.developers.amplitude.com/data/sdks/unreal/ | [Back] [Original] |
Products
For AI agents: a documentation index is available at /docs/llms.txt. Append .md to any page URL for markdown, or send Accept: text/markdown.
Download the latest version of AmplitudeUnreal.zip from the GitHub releases page. Unzip the file into a folder inside your Unreal project's Plugins directory.
mkdir -p Plugins/AmplitudeUnreal
unzip AmplitudeUnreal.zip -d Plugins/AmplitudeUnreal
Open your project in the UE4 editor. Go to Settings > Plugins > Project > Analytics and enable AmplitudeUnreal.
Go to Settings > Project Settings > Analytics > Amplitude and fill in the fields with your API key.
In any file that involves instrumentation, include the Unreal Engine analytics headers.
#include "Runtime/Analytics/Analytics/Public/Analytics.h"
#include "Runtime/Analytics/Analytics/Public/Interfaces/IAnalyticsProvider.h"
The Amplitude Unreal API follows the analytics provider interface that Unreal Engine defines.
Events represent how users interact with your app. For example, you can track a Game Started event.
FAnalytics::Get().GetDefaultConfiguredProvider()->StartSession();
FAnalytics::Get().GetDefaultConfiguredProvider()->RecordEvent(TEXT("Game started"));
FAnalytics::Get().GetDefaultConfiguredProvider()->EndSession();
Events can contain properties. Properties give context about the event.
TArray<FAnalyticsEventAttribute> AppendedAttributes;
AppendedAttributes.Emplace(TEXT("Test Event Prop key1"), TEXT("Test Event value1"));
AppendedAttributes.Emplace(TEXT("Test Event Prop key2"), TEXT("Test Event value2"));
FAnalytics::Get().GetDefaultConfiguredProvider()->RecordEvent(TEXT("Game Started"), AppendedAttributes);
User properties describe your users at the time they take an action in your app.
The generic Unreal Engine IAnalyticsProvider supports a limited number of user properties.
FAnalytics::Get().GetDefaultConfiguredProvider()->SetLocation(TEXT("Test location"));
FAnalytics::Get().GetDefaultConfiguredProvider()->SetGender(TEXT("Test gender"));
FAnalytics::Get().GetDefaultConfiguredProvider()->SetAge(TEXT(27));
If your app has its own login system, use SetUserId to set a custom user ID.
FAnalytics::Get().GetDefaultConfiguredProvider()->SetUserID(TEXT("test123@test.com"));
Was this helpful?
On this page
Platform
Resources
Partners & Support
20122026 Amplitude, Inc.. All rights reserved. Amplitude is a registered trademark of Amplitude, Inc.
| Web Proxy Viewer | New URL | Original Page |