[Repost] Roblox Immersive Ads

I’m trying to understand how to work with Roblox Immersive Ads based on the official documentation: Immersive ads | Documentation - Roblox Creator Hub.

According to the example code provided:

local function grantReward(PlayerId)
   -- grant an in-game reward
end
local function showRewardPrompt(PlayerId)
   -- show Prompt
end
local function hideRewardPrompt(PlayerId)
   -- hide Prompt
end
local AdGui = script.Parent
AdGui.OnAdEvent = function(eventData)
   local AdEventType = eventData.AdEventType
   local PlayerId = eventData.PlayerId
   if AdEventType == Enum.AdEventType.RewardedAdLoaded then
       showRewardPrompt(PlayerId)
       return true
   elseif AdEventType == Enum.AdEventType.RewardedAdGrant then
       grantReward(PlayerId)
       hideRewardPrompt(PlayerId)
       return true
   elseif AdEventType == Enum.AdEventType.RewardedAdUnloaded then
       hideRewardPrompt(PlayerId)
       return true
   end
   return false
end

It seems like the code listens for event to determine if ad is loaded, watched or unloaded(didn’t load), but doesn’t show any explicitly query for Reward Ad, I don’t understand how the Rewarded Ad is actually requested.

Looking for possible answers to the following questions:

  • How do I work with RewardedAd, including querying Roblox to load a rewarded ad?
  • Can AdGui work as a 2D GUI (like ScreenGui), or does it only work with 3D parts? If it can, how?

Also, I have inserted an ad here: https://www.roblox.com/games/11188299153
However, the ad doesn’t seem to be loading or being shown to players.

How do I request a click-to-play (rewarded) ad?

I don’t think you can currently choose to exclusively serve click-to-play ads. OnAdEvent is there to tell you when a click-to-play ad is being served so that you can contextually offer a reward. Using the AdEventType value:

  • RewardedAdLoaded → A click-to-play ad is being served. Display the reward promotion.
  • RewardedAdGrant → The given user has watched the ad. Give them the indicated reward.
  • RewardedAdUnloaded → The ad has been rotated out. Hide the reward promotion.

Can an AdGui work like a ScreenGui?

It is a type of SurfaceGui, so it must be attached to a surface in the world.

Why aren’t my ads generating impressions?

The metric section indicates that data should appear about 48 hours after placing a unit in your experience. It could also be that you haven’t served any ads yet! Units enter an inactive state if demand is low, the user is ineligible, or they don’t meet any targeting criteria.

1 Like