Using SDK
Create Ad Surfaces for your game in Unity using the SDK.
Last updated
Create Ad Surfaces for your game in Unity using the SDK.
Last updated
Once the Rene SDK is successfully installed and opened, you can start utilizing its features. If you have correctly added the API Credentials generated for your game on the ReneVerse Portal into the ReneVerse Settings menu in Unity, you can click Sync Game Assets. Once successfully synced through your API keys with the ReneVerse Portal, you'll see foldouts for Ad Surfaces and Branded Object Placements, which you had created and configured on the portal.
Within the Ad Surfaces section or a Branded Object Placement, you'll see a list of items created in the ReneVerse Portal. These include associated metadata such as AdSurfaceId
, AdType
, Interactivity
, and TargetingTags
, along with a button to Create Ad Surface or Create Branded Object Placement. Clicking these buttons will generate the respective entity in your Unity project, predefined and linked to the data on the portal. The details of the created object will be visible in the Inspector window for easy validation against the portal configurations.
Key Features of Ad Surfaces and Branded Object Placements
Compatibility with Unity Rendering Pipelines:
The SDK supports both Built-in and Universal Render Pipelines. Materials for ad surfaces or branded object placements are automatically assigned based on your current graphics settings. However, you can customize these materials either in Packages/com.reneverse.services/Resources/Materials
or directly on the instantiated objects to suit your project’s needs.
Hierarchy Placement:
New ad surfaces or branded object placements are created inside the currently selected GameObject in the hierarchy. This ensures seamless integration as child objects of assets representing potential advertising spaces, such as banners, shop windows, or branded displays.
Prefab Workflow:
Ad surfaces and branded object placements integrate with Unity's prefab system and are created as such.
Inspector Configuration:
The instantiated objects have parameters visible in the Inspector for validation. The relative scale of these objects corresponds to the resolution set in the portal. Transform manipulations should primarily occur on the parent GameObject to avoid unintended content distortions. Also keep in mind that you should universally change the scale of ad surfaces or branded object placements to adhere to content that is going to be sent.
Visual Representation:
In the scene, a Gizmo represents the branded object placement and a mesh represents ad surface. The front-facing side is labeled for easy identification, and the ID is displayed for quick cross-referencing with the portal. Gizmos can be toggled on or off for convenience during debugging. As per unity workflow the front facing side is Z axis.
Global Ad Serving:
When creating globally identical ad surfaces or branded object placements. This ensures delivering the same ad content to the ad surface or branded object placement making level design more pattern driven and controllable.
You can duplicate existing ad surfaces, meaning that even if in your profile on the Reneverse website you have just one ad surface, in the actual game there could be thousands of them, preferably in a prefab, since it will help you to modify it within seconds on each instance, but essentially it's going to be just one ad surface with one ID.
Once an individual ad surface is selected and play mode is on, meaning your game is running, there will appear a button to check the advertisement, how it will look. But keep in mind that it will serve the current advertisement if there is no advertisement campaign running, meaning you have no content to receive. You will get the correspondent log for it and you can check on the website what could be the issue.
However, there is implemented the possibility to play rene ads on multiple of them, meaning that if you select thousands of video ad surfaces, hit play button in unity and select play ad in the inspector, the ads will be playing. The only limitation is that they should be of the same type, meaning that you can select only video ad surfaces together or only banner ad surfaces together. This happens because of the Unity editor's way of calling derived objects, and is easily handled if you search the corresponding game objects in the hierarchy and select only them. In our case, it's either video ad surfaces or banner ad surfaces, and using CTRL-A you could select all of them.
Once you play multiple advertisements, you could see that they are played if the ad surface corresponds to currently present content in currently running ad campaign. And this play ad button corresponds to one of the two public methods that you might be using, namely, PlayAd()
and StopAd()
. And once the ad is played, you can stop it afterward. For now, the video and banner are cached, meaning that if it's served once to the user, another time it will be taken from the cache, meaning that the second time serving of the ad does not count as serving. Only the first one is considered to be serving the advertisement.
Branded Object Placements
Branded object placements represent 3D models or interactive spaces within your game that can dynamically load branded content. These objects:
Automatically adjust to fit within designated collider bounds.
Support custom scaling to ensure content visibility while maintaining aspect ratios.
Include gradual tracking features to capture user interactions with branded content over time.
Automatic Tracking
The SDK automatically tracks user engagement with both ad surfaces and branded objects:
Screen Coverage: Monitors how much of the ad or branded object is visible to the user.
Interaction Time: Measures the duration of engagement with the content.
Tracking occurs lightweightly, requiring a camera tagged as MainCamera
in Unity.
Notice how once the advertisement is served, the system automatically starts showing the current percentage of the seen ad relative to the game screen. It happens automatically and is lightweight. However, the Camera that you will be using for looking at Ads should be marked MainCamera
which is default in Unity.
Coding is not necessary if you ticked Serve Ad On Start in the inspector of surface and you have camera tagged MainCamera
(everything should start automatically). However, if you need more control over when ads are loaded, all you need to do is calling public method ServeAd()
on the surfaces you want the ads to be served to (no matter which type they have). Getting reference to particular ad surfaces is up to you.
For letting your user to connect to ReneVerse portal to gain its benefits you can essentially use 3 methods:
2) Game Connect
That should be it to integrate and use the ReneVerse SDK into your game! Feel free to check Player Authentication to see how to use our SDK from the code perspective.