GamebeastDocs
Dashboard
Unreal SDKAPI Reference

Experiments

This API is used to read the experiments the local player is currently enrolled in.

For more information about Experiments, visit the Experiments Guide.

Enrollment happens automatically: loading a configuration evaluates active experiments for the local player, and the values from the Configs service already include the assigned group's changes. This service is read-only, for display, analytics segmentation, and debugging.

#include "GamebeastExperiments.h"

UGamebeastExperiments* GamebeastExperiments = UGamebeastSubsystem::Get(this)->GetExperiments();

Types

FGamebeastExperimentAssignment

USTRUCT(BlueprintType)
struct FGamebeastExperimentAssignment
{
    int64 ExperimentId;
    FString ExperimentName;      // Empty until the first check for changes.
    int64 GroupId;
    FString GroupLabel;          // Empty until the first check for changes.
    FString ConfigurationAlias;  // The configuration whose evaluation reported it.
    FString Source;              // "weightedHash", "roundRobin" or "manual".
};

GetAssignments()

TArray<FGamebeastExperimentAssignment>return type

The player's assignments across every configuration loaded so far, sorted by experiment id.

Usage

for (const FGamebeastExperimentAssignment& Assignment : GamebeastExperiments->GetAssignments())
{
    UE_LOG(LogTemp, Log, TEXT("%s: %s"), *Assignment.ExperimentName, *Assignment.GroupLabel);
}

OnAssignmentsChanged

Fires with the full list whenever it changes: when a configuration reports new assignments, when names arrive, and after Identify. Bind the Blueprint event, or OnAssignmentsChangedNative in C++:

GamebeastExperiments->OnAssignmentsChangedNative.AddUObject(this, &UMyHud::HandleAssignments);

Targeting

Experiments can target players by these fields, which the SDK sends with every evaluation. They're offered on the dashboard as Unreal fields:

FieldValues
Platformwindows, mac, linux, ios, android, playstation, xbox, switch
Devicepc, mobile or console, derived from the platform
CountryISO country code from the device's region setting, like US. Not the player's location.
LanguageISO language code from the device's language setting, like en
Game versionYour Project Version (Project Settings > Description)
Engine versionLike 5.4.2

Each is unknown when the device can't say. To target anything else, add it to FGamebeastSetupOptions::UserProperties: strings, numbers, booleans, or arrays of one of those. They're targeted as custom properties.

On this page