# Unreal Engine Quick Start
This guide will show you how to integrate the Frameplay plugin into your Unreal Engine project.
We officially support:
- Unreal Engine 4.23 - 4.27, 5.0 - 5.1
- Windows, Android, iOS, Mac
# Prerequisites
Before getting started you must create a Developer Account (opens new window) and a Game (opens new window) on the Frameplay Platform.
# Getting Started
# Download and Install the Frameplay Plugin
- Download and unzip the latest version of the Frameplay Unreal Engine plugin from the downloads page (opens new window)
- Go to your Project's Plugins folder [Project Root] > Plugins
- Copy the
Frameplay
folder into the Plugins folder
See the
# Reload Your Project
- Code projects will need to regenerate the Visual Studio Project Files (opens new window)
- Open your Unreal Project and enable the Frameplay plugin (opens new window) from the Plugins Window.
# Configure Project Name and Version
- Confirm your Project Name and Version have been setup under Edit > Project Settings menu
- Select Project > Description and enter your Project Name and current Project Version
# Configure the Frameplay Developer Settings
The Frameplay Developer Settings are stored in a Data Asset and is used to maintain the link between your project and the Developer Dashboard.
- Under the Frameplay menu icon located on the Main Toolbar in the Unreal Editor, select Developer Settings
- Enter the Developer API Key and Game ID with the corresponding values found on your Game Page (opens new window)
See the FAQ
See the
# Initialize the Frameplay SDK
- Initialize the Frameplay SDK by calling
UFrameplayFunctionLibrary::Start_Session()
. This starts a Session and creates a secure runtime connection to the Frameplay server - Configure the player parameter with the current player details. (If available, the players Age and Gender should be passed as parameters. These can be sourced from a client API or a custom login)
- Set the Allow Data Collection player parameter. This corresponds to the respective platform signal Limit Ad Tracking
# Blueprint Example
The Frameplay Session requires knowledge of the active Camera to use for measuring viewability. More information on Registered Cameras
# Code Example
# .h
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "Frameplay/frameplay_wrapper.h"
#include "AExampleInit.generated.h"
UCLASS()
class UNREALPROJECT_API AAExampleInit : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
AAExampleInit();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
};
# .cpp
#include "AExampleInit.h"
#include "FrameplayFunctionLibrary.h"
// Sets default values
AAExampleInit::AAExampleInit()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
}
// Called when the game starts or when spawned
void AAExampleInit::BeginPlay()
{
Super::BeginPlay();
//Capture player data
const FPlayer_Data Player{UData_Collection::allow, 20, EFrameplayGender::unknown, "en", "newPlayer"};
//Start SDK
UFrameplayFunctionLibrary::Start_Session(Player);
}
void AAExampleInit::EndPlay(const EEndPlayReason::Type EndPlayReason)
{
Super::EndPlay(EndPlayReason);
UFrameplayFunctionLibrary::Shutdown_Session();
}
# .Build.cs
Reference the Frameplay module in your project.
using UnrealBuildTool;
public class UnrealProject : ModuleRules
{
public UnrealProject(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "Frameplay" });
PrivateDependencyModuleNames.AddRange(new string[] { });
}
}
More information on the Frameplay Session & Cameras.
More information on the Frameplay API.
# Create an Ad Space
An Ad Space is an Actor that displays intrinsic advertisements to the player. They can be created through the editor Place Actor menu or in a Blueprint.
- Using the Place Actors Mode, drag and drop a Frameplay Ad Space Actor into the Viewport
- Position the Ad Space to best fit your environment
# Configure an Ad Space
- Select the Ad Space in the World Outliner to view the Ad Space Configuration located in the Details panel
- Enter a unique name for the Ad Space
- Set the image ratio to one of the preset aspect ratios to best fit your environment
- (Optional) Select
Synchronize Ad Space
and enter aChannel Name
to begin creating a Group of Synchonized Ad Spaces that render the same image
# Load a Mock Advertisement
Begin Play In Editor Mode and the Ad Space will request, download and display a mock advertisement.
Congratulations! You have created your first intrinsic advertisement.
# View Impression Data
Sessions started in-editor and in development builds will automatically run in Test Mode and mock advertisements will be used.
Impression data gathered in Test Mode will display on the Test Dashboard (opens new window) and will not yet generate revenue.
# Packaging Builds
- When packaging a shipping version of your project, select File > Package Project > Build Configuration and toggle Shipping mode
- Submit your account and game for approval on the Frameplay Platform:
- Submit Developer Account for approval (opens new window)
- Submit Game for approval (opens new window)
Please allow 48 hours for approval. Advertisements will not load in Production builds until both your account and game is approved.
At this time our integration team will contact you. Once approved, your Ad Spaces in your production build will load advertisements, earn revenue and analytics will be recorded on the Live Dashboard (opens new window).
# Best Practices
We highly recommend you check out the Best Practices Guide to maximize revenue, impression quality and user experience!
# Troubleshooting
If something went wrong during setup, check console logs for details and visit our FAQ page.