This is the Beta Adjust™ SDK for Unreal apps using Steamworks.
This guide explains how to integrate the Adjust Steamworks Unreal SDK into any Unreal C++ project.
- Unreal Engine 5.x
- OnlineSubsystemSteam configured and working.
- Steam client installed with an active user.
- Copy the provided Adjust source folder Adjust into your game module
Sourcetree.
YourGame/Source/YourGame/Adjust/
Adjust.h
Adjust.cpp
AdjustAttributionData.h
AdjustEvent.h
AdjustEvent.cpp
AdjustLogger.h
AdjustLogger.cpp
AdjustResponseData.h
AdjustResponseData.cpp
- Update Module Dependencies
In YourGame.Build.cs, add required dependencies:
PublicDependencyModuleNames.AddRange(new string[] {
"Core",
"CoreUObject",
"Engine",
"HTTP",
"Json",
"JsonUtilities"
});
PrivateDependencyModuleNames.AddRange(new string[] {
"OnlineSubsystem",
"OnlineSubsystemUtils",
"OnlineSubsystemSteam"
});
- Configure Steam
In your project's Config/DefaultEngine.ini, ensure Steam subsystem entries are present:
[OnlineSubsystem]
DefaultPlatformService=Steam
[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480
[/Script/Engine.GameEngine]
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection"
Call Adjust::InitSdk(...) method once per app launch to initialize the SDK. Initialization arguments:
AppToken(string, required): Your unique Adjust app token, obtainable from the Adjust dashboard.Environment(string, required): Specifies the environment, e.g.,Adjust::EnvironmentSandboxfor testing orAdjust::EnvironmentProductionfor production.
Here is an example of how to initialize the Adjust:
#include "Adjust/Adjust.h"
const FString AppToken = TEXT("YOUR_12_CHAR_TOKEN");
Adjust::InitSdk(AppToken, Adjust::EnvironmentSandbox, [](const AdjustResponseData &Response)
{
UE_LOG(LogExample, Log, TEXT("Adjust init response: code=%lld error=%s json=%s"),
Response.ResponseCode, *Response.Error, *Response.JsonResponse);
});
SDK logging is disabled by default. To enable it, call Adjust::EnableLogging(). For example:
Adjust::EnableLogging();
To track events, call Adjust::TrackEvent. For example:
AdjustEvent Event(TEXT("YOUR_EVENT_TOKEN"));
Event.SetRevenue(1.99, TEXT("USD"));
Event.AddCallbackParameter(TEXT("key"), TEXT("value"));
Event.AddPartnerParameter(TEXT("key"), TEXT("value"));
Adjust::TrackEvent(Event, [](const AdjustResponseData& Response)
{
UE_LOG(LogExample, Log, TEXT("Adjust event response: code=%lld error=%s json=%s"),
Response.ResponseCode, *Response.Error, *Response.JsonResponse);
});
To retrieve attribution data, call Adjust::GetAttribution method. For example:
Adjust::GetAttribution([](const AdjustResponseData& Response)
{
UE_LOG(LogExample, Log, TEXT("Attribution code=%d message=%s tracker_token=%s tracker_name=%s network=%s campaign=%s adgroup=%s creative=%s click_label=%s"),
Response.ResponseCode,
*Response.Message,
*Response.AttributionData.TrackerToken,
*Response.AttributionData.TrackerName,
*Response.AttributionData.Network,
*Response.AttributionData.Campaign,
*Response.AttributionData.Adgroup,
*Response.AttributionData.Creative,
*Response.AttributionData.ClickLabel);
});
Distributed under the MIT license.