Ads in the game: rewarded video and immersive ads

Earn from players who never spend Robux by adding a rewarded video ad and an immersive ad billboard to Beacon Yard, with the reward routed through the same safe receipt handler as the Coin Pack.

Project lesson, about 70 minutes, 11 steps

By the end you can

  • Add a rewarded video ad for a double-coin round to Beacon Yard, with the reward granted once through the existing receipt handler
  • Explain who decides whether an ad can show, and which rules a reward, a button and a placement must follow
  • Place an immersive ad billboard in the lobby and measure ad views as their own economy source

Before this: Monetization: products, passes, subscriptions, economy, The round loop: a state machine

1A button for the player who never pays

Most players never spend Robux. In Beacon Yard they earn coins, buy Speed and a Shield, and never touch the Coin Pack. A rewarded video ad lets them support the game anyway: they choose to watch a short video, and they get something for it.

Here is the button this lesson adds to the quartermaster's shop, between drills: "Watch an ad: double coins next drill". The player clicks it, a 6 to 30 second video plays full screen, and the next drill pays twice for every coin pickup1. The advertiser pays Roblox, Roblox pays you in Robux, and the player paid nothing.

Roblox has two ways to show ads inside a game. Rewarded video is the one the player starts. Immersive ads sit in the world: a billboard that shows an image or a video, or a portal that teleports to an advertiser's game2. This lesson builds both, starting with the button.

Match each ad format to what the player does.

  1. Rewarded video
  2. Billboard (AdGui)
  3. Portal ad
Answer

Rewarded video: Clicks a button, watches a full-screen video and gets a reward; Billboard (AdGui): Walks past an image or video on a part in the world; Portal ad: Walks through a door into an advertiser's game. Rewarded video is opt-in and pays the player. Billboards earn from views in the world, and portals earn when a player teleports through them.

Open this step in lesson mode · Link to this step · This confused me

2Who decides whether an ad shows

Server sideRewarded video ads is a sponsored sample stall at the shop counter.
In the pictureIn Roblox
The sponsor who pays the shopThe advertiser, who pays Roblox for impressions
The short demo you agree to watchA 6 to 30 second rewarded video, started only by the player's own click
The free sample of something the shop sellsA developer product that is also on sale in the shop, granted after the full view
The sign that says what you getThe disclosure on the button: what the reward is and what to do for it

See the whole analogy cast

A rewarded ad is a sponsored sample stall at the shop counter. A sponsor pays the shop. A customer who agrees to watch a short demo gets a free sample of something the shop already sells, and the sign says exactly what they will get.

Think of it as A sponsored sample stall at the shop counter

The stall does not run itself. Before the button may appear, the client asks AdService:GetAdAvailabilityNowAsync(Enum.AdFormat.RewardedVideo). The answer is an Enum.AdAvailabilityResult3:

ResultWhat it means
IsAvailableAn ad is ready for this player now
NoFillNo advertiser wants this player right now, or a frequency limit was hit
PlayerIneligibleThis player cannot get ads this session, for example under 13 or in a blocked region
PublisherIneligible, ExperienceIneligibleYou or your game do not meet the requirements
DeviceIneligibleThis device cannot show the ad

The game has to qualify too. It must be public and unrestricted, have an approved content questionnaire, and average at least 2,000 unique visitors a month. You must be 13 or older, ID-verified, with two-step verification on. Then you switch on Serving enabled under Monetization, Ads, Settings in Creator Hub1.

You publish your copy of Beacon Yard as a private experience to build along with this course. Can it earn from rewarded video ads today?

  1. No: it is not public and has nowhere near 2,000 unique visitors a month
  2. Yes, as soon as you switch on Serving enabled
  3. Yes, but only for players under 13
  4. Only in Studio, where test ads pay out
Answer

No: it is not public and has nowhere near 2,000 unique visitors a month. Build and test the code now; the ads themselves will only serve once the real game is public and busy enough. Until then GetAdAvailabilityNowAsync will not return IsAvailable, and the button stays hidden.

Open this step in lesson mode · Link to this step · This confused me

3Client asks, server shows, receipt grants

Two calls, two sides. GetAdAvailabilityNowAsync may only run on the client, because the answer is about this player and this device. ShowRewardedVideoAdAsync(player, reward) may only run on the server4. Its reward is an AdReward made by AdService:CreateAdRewardFromDevProductId(productId).

The rewarded video round tripFour boxes in a loop. The client shop asks whether an ad is ready and fires WatchAd to the server. The server shows the ad. Roblox plays it. Roblox then sends a receipt to ProcessReceipt on the server, which grants the double round.WatchAdreceiptShop opensad available now?AdRewardServiceshows the adRobloxplays 6 to 30 sProcessReceiptchannel AdReward
Figure 3.1. The reward never comes back from ShowRewardedVideoAdAsync. It arrives as a receipt.

When the player watches to the end, Roblox grants the developer product through MarketplaceService.ProcessReceipt, the same callback that grants the Coin Pack. The receipt's ProductPurchaseChannel is Enum.ProductPurchaseChannel.AdReward instead of InExperience5. The value ShowRewardedVideoAdAsync returns is only for your UI. The docs say plainly not to grant from it4.

Put one rewarded ad view in order.

  1. Roblox calls ProcessReceipt with the Double Round product and channel AdReward
  2. The player watches the video to the end
  3. The server checks its rules and calls ShowRewardedVideoAdAsync with the AdReward
  4. The button shows, the player clicks it and the client fires WatchAd
  5. The player opens the shop and the client calls GetAdAvailabilityNowAsync
Answer

1. The player opens the shop and the client calls GetAdAvailabilityNowAsync 2. The button shows, the player clicks it and the client fires WatchAd 3. The server checks its rules and calls ShowRewardedVideoAdAsync with the AdReward 4. The player watches the video to the end 5. Roblox calls ProcessReceipt with the Double Round product and channel AdReward. The client asks, the player opts in, the server shows, and Roblox grants through the receipt. Granting from the show result would pay players who closed the ad early.

Open this step in lesson mode · Link to this step · This confused me

4Choosing the reward: a Double Round

Roblox puts rules on the reward. It must be a developer product that is also on sale for Robux in your shop. It must not inflate the currency or unbalance the economy, must not be random, and must be granted as soon as the ad finishes. The ad must never be a gate the player has to pass to keep playing, and it must not hurt their character1.

So the reward is a new developer product, Double Round: the next drill pays twice for every coin pickup. The shop sells it for a few Robux and the ad gives it free. It is useful, it is not random, and it is small. How small?

Luau
-- Config: COIN_VALUE 5, SURVIVAL_BONUS 10, EVENT_MAX_MULTIPLIER 5.
-- CoinService multiplies pickups only; the survival bonus stays 10.
local COIN_VALUE, SURVIVAL_BONUS, MAX = 5, 10, 5
local function drill(pickups, multiplier)
	local per = math.floor(COIN_VALUE * multiplier + 0.5)
	return pickups * per + SURVIVAL_BONUS
end
local plain, boosted = drill(4, 1), drill(4, 2)
print("plain drill: " .. plain .. " coins")
print("double round: " .. boosted .. " coins (+" .. boosted - plain .. ")")
print("Scrap Rush x2: " .. drill(4, 2) .. " -> " .. drill(4, math.min(2 * 2, MAX)) .. " coins")
Figure 4.1. Expected output: plain drill: 30 coins double round: 50 coins (+20) Scrap Rush x2: 50 -> 90 coins

An ad is worth 20 coins in a normal drill, less than half a Coin Pack. That is a real reward that does not flood the shop.

Which of these rewards or placements break Roblox's rewarded video rules?

  1. A random crate that may hold a rare wrench skin
  2. 500 coins per ad, ten times what the Coin Pack sells
  3. The beacon will not start a drill until the player watches an ad
  4. Double Round, also sold in the shop, offered between drills
  5. An ad that plays in the middle of a drill while the drone chases
Answer

A random crate that may hold a rare wrench skin; 500 coins per ad, ten times what the Coin Pack sells; The beacon will not start a drill until the player watches an ad; An ad that plays in the middle of a drill while the drone chases. Rewards cannot be random or flood the economy, an ad cannot gate progress, and it must not put the player's character at risk. A small developer product the shop also sells, offered at a safe moment, is what the docs describe.

Open this step in lesson mode · Link to this step · This confused me

5One receipt handler, two products

Open MonetizationService.process at m14-ship. It was written for one product.

function MonetizationService.process(raw: unknown): Enum.ProductPurchaseDecision
	local receipt = readReceipt(raw)
	if receipt == nil or Ids.COIN_PACK_PRODUCT_ID <= 0 or receipt.ProductId ~= Ids.COIN_PACK_PRODUCT_ID then
		return Enum.ProductPurchaseDecision.NotProcessedYet
Figure 5.1

Any receipt whose product is not the Coin Pack gets NotProcessedYet. Add a Double Round product and change nothing else, and every ad reward is refused.

A player finishes an ad. Roblox calls the m14-ship handler with a Double Round receipt. What happens?

  1. It returns NotProcessedYet, so the player gets nothing and the receipt waits to be delivered again
  2. It grants 50 coins, because the handler only knows the Coin Pack
  3. It grants the double round, because the channel is AdReward
  4. The ad replays until the handler accepts it
Answer

It returns NotProcessedYet, so the player gets nothing and the receipt waits to be delivered again. The Double Round id fails the Coin Pack check. The receipt stays unresolved, and the player who watched to the end gets no reward, which also breaks the rule to grant it right away.

Server sideRemember: Rewarded video ads is a sponsored sample stall at the shop counter.

The fix is a lookup by product id, the same "check, grant, record, save" order as the Coin Pack, and one new profile field, doubleRounds. The id goes into recentPurchaseIds with the grant, so a redelivered ad receipt grants once. The Run above showed the boost math. Now look at where the stall picture stops being true.

Where does it break?“A sponsored sample stall at the shop counter” is a good picture of rewarded video ads. Where does it stop being true?

It breaks here. The shop decides neither who may watch nor how the sample is handed over: Roblox decides eligibility (age, region, fill, frequency), and the reward arrives later as a ProcessReceipt receipt, not across the counter.

The true model. The client asks AdService:GetAdAvailabilityNowAsync when the shop opens. The server calls ShowRewardedVideoAdAsync with an AdReward made from a developer product. When the ad plays to the end, Roblox delivers a receipt for that product through ProcessReceipt with ProductPurchaseChannel AdReward. You earn Robux per impression, not per reward.

At a sample stall, the shopkeeper decides who may watch and hands the sample across the counter. In Beacon Yard, which part of that is still true?

  1. Neither: Roblox decides who can see an ad, and the reward arrives later as a receipt
  2. Both: the server picks who watches and grants when ShowRewardedVideoAdAsync returns
  3. The server picks who watches, but Roblox grants
  4. The client grants the reward when the video closes
Answer

Neither: Roblox decides who can see an ad, and the reward arrives later as a receipt. You can only narrow who sees the button. Roblox decides who can get an ad, and the reward travels the same road as a purchase.

Open this step in lesson mode · Link to this step · This confused me

6Measuring ads

Ad coins should not hide among drill pickups. Roblox's economy events accept your own transaction type names besides the built-in ones6, and there is no built-in type for ads. So the coins a boosted drill adds are logged as a source with the type RewardedAd, and the Economy page shows them as their own row.

The rest lives in Creator Hub under Monetization, Ads, Analytics: impressions, fill rateFill rateThe share of ad requests that came back with an ad to show.Think of it as how often the vending machine actually has something in the slot you picked., EPMEPMEarnings per mille: the Robux an ad format earns for every 1,000 impressions.Think of it as the price per thousand views that advertisers end up paying you., opt-in rate and frequency. Earnings are Robux: EPM times impressions, divided by 1,0001. Roblox's optimization guide gives targets of a 10 to 20 percent opt-in rate and two to four ads per user a day, and asks for a cap of at least two or three prompts per session7. Beacon Yard's cap is three a session.

Two more habits. Register the button with AdService:RegisterAdOpportunityAsync so Creator Hub counts how often the offer was seen against how often it was taken. And roll a new placement out to part of your players with an Experiment first1.

Luau
-- An invented week. Roblox publishes no EPM: read yours from Ads analytics.
local impressions, epm = 4000, 150
print("earnings: " .. impressions / 1000 * epm .. " Robux")
 
-- Opt-in rate: ads-eligible players who watched, out of those offered.
local offered, watched = 800, 96
print("opt-in rate: " .. math.round(watched / offered * 100) .. "%")
Figure 6.1. Expected output: earnings: 600 Robux opt-in rate: 12%

Beacon Yard's opt-in rate comes out at 12 percent and frequency at 0.6 ads per player a day. Which number should you work on first?

  1. Frequency: it is below the two to four a day target, so the offer may be too hard to find or too rare
  2. Opt-in rate: 12 percent is far below target
  3. Neither: any opt-in above zero is good
  4. Both, by showing the ad during drills as well
Answer

Frequency: it is below the two to four a day target, so the offer may be too hard to find or too rare. Players who see the offer take it often enough; they just do not see it often. Offer it at more safe moments, such as after a lost drill, before touching the reward.

Open this step in lesson mode · Link to this step · This confused me

7Immersive ads in the lobby

The lobby has players standing around between matches, which suits a billboard. An immersive billboard is a block part with an AdGui on one face8. The face must be at least 8 by 4.5 studs and at most 32 by 18, with no other surface GUI on it. Tick EnableVideoAds to allow video; without it the billboard shows images only2.

You earn when a click-to-play video is watched for at least 15 seconds, when an image or autoplay video counts as a viewable impression, and for each player a portal ad sends to an advertiser's game. Portal ads come from the BasePortal package in the Creator Store's Ads category, and you may only move, rotate and scale them. Roblox pays on the 25th of the month after you inserted the ad units2.

Ineligible players see a fallback image. To hide the units for them instead, read AreAdsAllowed from PolicyService:GetPolicyInfoForPlayerAsync29. Beacon Yard's PolicyProbe already calls it for paid random items, so it can store this answer too. Faking impressions or teleports breaks the advertising standards and can cost the payout or the game.

You add a lobby billboard in LobbyBuilder. Which part face can carry an AdGui?

  1. 16 by 9 studs
  2. 40 by 22.5 studs
  3. 6 by 3.4 studs
  4. Any size, the ad scales itself
Answer

16 by 9 studs. A 16:9 face between those limits works. Name the part clearly, because the ads metrics list each unit by its name in Studio.

Open this step in lesson mode · Link to this step · This confused me

8How studios think about ads

Other ways pros do this

OptionWhat it isWhen pros pick itTrade-offs
Rewarded videoAn opt-in full-screen video that grants a developer product.Games with many non-paying players and a natural pause, such as a shop between rounds.Needs a public game with 2,000 monthly visitors; a badly placed or too generous reward hurts retention or the economy.
Immersive billboards and portalsAdGui billboards and BasePortal doors placed in the world.Lobbies, hubs and long walks where players look around anyway.Earns per view or teleport with no player choice; portals send players away to another game.
No adsEarn only from products, passes, subscriptions and Creator Rewards.Young audiences, competitive games, or a game below the eligibility bar.Leaves the non-paying majority earning you nothing directly.
Buying ads (Ads Manager)The other side: you pay to advertise your own game.Growth, covered in the marketing lesson.Costs money; it does not earn.

Double Round is sold in the shop and offered as an ad reward. Should Beacon Yard turn on Exclude your most likely purchasers?

  1. It can: the reward is also for sale, so likely spenders can still buy it
  2. No, the setting is only for random rewards
  3. No, it turns off ads for everyone
  4. Yes, and it also raises the EPM
Answer

It can: the reward is also for sale, so likely spenders can still buy it. The docs suggest it only when the ad reward can also be bought; for a unique ad-only reward they suggest leaving it off.

Open this step in lesson mode · Link to this step · This confused me

9Build along: the Double Round ad

This extends the finished game. Start a branch from m14-ship, do the level 3 challenge's rules first, then wire them in. Ads will not serve until the game is eligible, so check each step with the expected Output, not a real ad.

Build along

m14-ship

  • challenges/work/ad_reward.luau
  • src/shared/Ids.luau
  • src/shared/Config.luau
  • src/server/DataMigration.luau
  • src/server/MonetizationService.luau
  • src/server/AdRewardService.luau
  • src/server/CoinService.luau
  • src/client/ShopApp.luau
  1. Write the five rules in challenges/work/ad_reward.luau: offer, grant, transactionType, multiplier and startRound. Then copy the module to src/shared/AdRules.luau so the game can require it.

    You should see The level 3 challenge prints TEST PASS for all 21 checks.

  2. Create the Double Round developer product in Creator Hub and put its id only in Ids.local.luau. Add doubleRounds = 0 to DataMigration.template() and to the ProfileData type.

    You should see Ids.luau has DOUBLE_ROUND_PRODUCT_ID = 0, Config has AD_SESSION_CAP = 3, and a new profile shows doubleRounds = 0 after Reconcile.

  3. In MonetizationService.process, replace the Coin Pack check with AdRules.grant: answer NotProcessedYet for "unknown", PurchaseGranted for "duplicate", and save before granting for the rest. Log coins with AdRules.transactionType(receipt.ProductPurchaseChannel.Name).

    You should see A Coin Pack test purchase in Studio still grants 50 coins once, and the Output shows no [Monetization] warning.

  4. Create AdRewardService with a WatchAd remote. Check AdRules.offer on the server with the RoundPhase attribute and a per-session view count, then call CreateAdRewardFromDevProductId and ShowRewardedVideoAdAsync in pcall.

    You should see With the id at 0, pressing the button prints one [Ids] warning and the server answers with a deny message instead of an ad.

  5. At the start of a drill, spend one round with AdRules.startRound and set a DoubleRound player attribute. In CoinService, pay AdRules.multiplier(boosted, FlagService.coinMultiplier(), Config.EVENT_MAX_MULTIPLIER). In ShopApp, show the button only when the client's GetAdAvailabilityNowAsync says IsAvailable, with the reward written on it.

    You should see During a drill after a double round was granted, each coin pickup adds 10 coins instead of 5, and the next drill is back to 5.

Browser
Creator Hub, Monetization, Ads, Eligibility for a private course experience, cropped to three unmet requirements: make the experience public, complete the content rating questionnaire, and 2K monthly active users.

Select a numbered pin, or a row below, to read what it marks.

Figure 9.1.

Creator Hub's ads eligibility page for a private build copy, cropped to the experience requirements. The pins mark the three it does not meet yet.

Open this step in lesson mode · Link to this step · This confused me

10Challenges

Level 3, Professional

Challenge

Start from the m14-ship tag in the game repo and fill in challenges/work/ad_reward.luau. Run it in Play with game.ServerScriptService.RunGameTests:Invoke("ads", "ads-reward-rules"). The written solution is challenges/solutions/ads.md.

Start from
The game at milestone m14 (download)
Grade it
In Studio, press Play, then run game.ServerScriptService.RunGameTests:Invoke("ads", "ads-reward-rules") in the server command bar. Copy the pass code from Output.

Done means

  • offer returns ok only for an available ad outside a drill, with no double round held and under the session cap, and names the first rule that fails otherwise
  • grant routes the Coin Pack and Double Round by product id, grants a purchase id once, refuses unknown and 0 ids, and keeps the newest 50 ids
  • transactionType marks ad receipts as RewardedAd and everything else as IAP
  • multiplier doubles the Scrap Rush multiplier and never passes the cap; startRound spends one held round
  • challenges/ads.luau prints TEST PASS for all 21 checks

Hints

  1. Check the rules in the order the stub's header lists them, and return as soon as one fails.
  2. Decide which product it is before you look up the purchase id, so an unknown product never touches the profile.
  3. A bought double round is never refused: the one-at-a-time rule belongs to offer only.

Level 2, Builder

Challenge

Add the immersive billboard to the lobby. There is no automated test: check each criterion in Studio and in the Explorer during Play.

Start from
m14-ship, with the game published as a private test experience

Done means

  • LobbyBuilder makes an anchored 16 by 9 stud block named LobbyBillboard facing the spawn, with one AdGui on its front face and EnableVideoAds on
  • The AdGui has a FallbackImage you own, so ineligible players see your art, not a blank face
  • PolicyProbe also stores AreAdsAllowed as a player attribute, and a client script hides the billboard for a player whose attribute is false
  • Self-check: you can say why the billboard serves no ads in your private copy

Hints

  1. AdGui is a surface GUI: set its Face to the side that faces the spawn.
  2. Store the answer the same way PolicyProbe stores ArePaidRandomItemsRestricted, only when it is a boolean.

A player watched three ads this session and holds no double round. The phase is Cooldown and an ad is available. What does offer return?

print(AdRules.offer("Cooldown", "IsAvailable", 0, 3, Config.AD_SESSION_CAP))
  1. session-cap
  2. ok
  3. in-round
  4. unavailable
Answer

session-cap. Availability passes, the phase is safe, no round is held, and the view count has reached the cap, so offer names session-cap.

Open this step in lesson mode · Link to this step · This confused me

11Recap

Retiring the analogy

You no longer need “a sponsored sample stall at the shop counter”. The client asks AdService:GetAdAvailabilityNowAsync when the shop opens. The server calls ShowRewardedVideoAdAsync with an AdReward made from a developer product. When the ad plays to the end, Roblox delivers a receipt for that product through ProcessReceipt with ProductPurchaseChannel AdReward. You earn Robux per impression, not per reward.

Recap

  1. Rewarded video is opt-in: the client asks GetAdAvailabilityNowAsync, the server calls ShowRewardedVideoAdAsync with an AdReward made from a developer product, and the reward arrives through ProcessReceipt with channel AdReward.
  2. The reward must be a developer product also sold in the shop, not random, not inflating, granted right away, never a gate and never shown mid-drill; Beacon Yard's Double Round adds about 20 coins.
  3. Immersive billboards and portals earn from views and teleports; only public games with 2,000 monthly visitors earn from ads, and ad coins get their own RewardedAd economy source.

Rewarded video ads is a sponsored sample stall at the shop counter, until the shop decides neither who may watch nor how the sample is handed over: Roblox decides eligibility (age, region, fill, frequency), and the reward arrives later as a ProcessReceipt receipt, not across the counter.

Next Recurring revenue: subscriptions and a season pass

Open this step in lesson mode · Link to this step · This confused me